You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/08/13 17:18:06 UTC
[24/26] syncope git commit: [SYNCOPE-652] Fixing test execution
[SYNCOPE-652] Fixing test execution
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/554b7259
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/554b7259
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/554b7259
Branch: refs/heads/master
Commit: 554b7259f23b1172453f3a78278109b15bc3d992
Parents: 74aed4a
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Aug 13 16:18:20 2015 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Aug 13 17:16:51 2015 +0200
----------------------------------------------------------------------
.../org/apache/syncope/core/logic/DomainLogic.java | 2 +-
.../syncope/fit/core/reference/DomainITCase.java | 17 ++++++++++-------
2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/554b7259/core/logic/src/main/java/org/apache/syncope/core/logic/DomainLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/DomainLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/DomainLogic.java
index c946fb1..e95f70b 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/DomainLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/DomainLogic.java
@@ -76,7 +76,7 @@ public class DomainLogic extends AbstractTransactionalLogic<DomainTO> {
+ "T(org.apache.syncope.common.lib.SyncopeConstants).MASTER_DOMAIN")
public DomainTO create(final DomainTO domainTO) {
if (!domainsHolder.getDomains().keySet().contains(domainTO.getKey())) {
- throw new NotFoundException("No configuration is available for domain '" + domainTO.getKey());
+ throw new NotFoundException("No configuration is available for domain " + domainTO.getKey());
}
return binder.getDomainTO(domainDAO.save(binder.create(domainTO)));
http://git-wip-us.apache.org/repos/asf/syncope/blob/554b7259/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DomainITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DomainITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DomainITCase.java
index e6b1984..51d4aaf 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DomainITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/DomainITCase.java
@@ -25,7 +25,6 @@ import static org.junit.Assert.fail;
import java.security.AccessControlException;
import java.util.List;
-import org.apache.commons.lang3.SerializationUtils;
import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.DomainTO;
@@ -63,11 +62,18 @@ public class DomainITCase extends AbstractITCase {
}
}
+ private void restoreTwo() {
+ DomainTO two = new DomainTO();
+ two.setKey("Two");
+ two.setAdminCipherAlgorithm(CipherAlgorithm.SHA);
+ two.setAdminPwd("password2");
+ domainService.create(two);
+ }
+
@Test
public void update() {
DomainTO two = domainService.read("Two");
assertNotNull(two);
- DomainTO origTwo = SerializationUtils.clone(two);
try {
// 1. change admin pwd for domain Two
@@ -87,8 +93,7 @@ public class DomainITCase extends AbstractITCase {
new SyncopeClientFactoryBean().setAddress(ADDRESS).setDomain("Two").
create(ADMIN_UNAME, "password3").self();
} finally {
- // restore old password
- domainService.create(origTwo);
+ restoreTwo();
}
}
@@ -107,9 +112,7 @@ public class DomainITCase extends AbstractITCase {
assertEquals(ClientExceptionType.NotFound, e.getType());
}
} finally {
- // restore old password
- two.setAdminPwd("password2");
- domainService.create(two);
+ restoreTwo();
}
}
}