[SYNCOPE-1015] Fixing test exec
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/6a41ff24 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/6a41ff24 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/6a41ff24 Branch: refs/heads/SYNCOPE-808 Commit: 6a41ff24d427745aa7a8f60c880d2a140f533e9d Parents: d4c7d74 Author: Francesco Chicchiriccò <ilgro...@apache.org> Authored: Wed Feb 15 17:21:56 2017 +0100 Committer: Francesco Chicchiriccò <ilgro...@apache.org> Committed: Wed Feb 15 17:21:56 2017 +0100 ---------------------------------------------------------------------- .../src/test/resources/domains/MasterContent.xml | 2 +- .../org/apache/syncope/fit/core/UserSelfITCase.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/6a41ff24/core/persistence-jpa/src/test/resources/domains/MasterContent.xml ---------------------------------------------------------------------- diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml index 7337f4f..9b70be9 100644 --- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml +++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml @@ -97,7 +97,7 @@ under the License. <CPlainAttrValue id="c13660b5-926c-47ea-946d-52db32dd492b" attribute_id="577c6c4d-7149-43c2-9821-9ab4510effbd" stringValue="username"/> <CPlainAttrValue id="0f112dbd-00d4-441c-b732-331e7f348f8a" - attribute_id="577c6c4d-7149-43c2-9821-9ab4510effbd" stringValue="email"/> + attribute_id="577c6c4d-7149-43c2-9821-9ab4510effbd" stringValue="userId"/> <SyncopeSchema id="authentication.statuses"/> <PlainSchema id="authentication.statuses" type="String" multivalue="1" uniqueConstraint="0" readonly="0"/> http://git-wip-us.apache.org/repos/asf/syncope/blob/6a41ff24/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java ---------------------------------------------------------------------- diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java index fef308f..b7b6f56 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java @@ -150,9 +150,17 @@ public class UserSelfITCase extends AbstractITCase { Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create("rossini", ADMIN_PWD).self(); assertEquals("rossini", self.getValue().getUsername()); + } - Pair<Map<String, Set<String>>, UserTO> byEmail = clientFactory.create("ve...@syncope.org", ADMIN_PWD).self(); - assertEquals("verdi", byEmail.getValue().getUsername()); + @Test + public void authenticateByPlainAttribute() { + UserTO rossini = userService.read("rossini"); + assertNotNull(rossini); + String userId = rossini.getPlainAttrMap().get("userId").getValues().get(0); + assertNotNull(userId); + + Pair<Map<String, Set<String>>, UserTO> self = clientFactory.create(userId, ADMIN_PWD).self(); + assertEquals(rossini.getUsername(), self.getValue().getUsername()); } @Test