syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: Adding search by date test case
Date Tue, 08 Mar 2016 14:46:13 GMT
Repository: syncope
Updated Branches:
  refs/heads/1_2_X 0b344b3b2 -> cf1ae34ca


Adding search by date test case


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/cf1ae34c
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/cf1ae34c
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/cf1ae34c

Branch: refs/heads/1_2_X
Commit: cf1ae34cae74435e431349f547fd8c58d319f53c
Parents: 0b344b3
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Mar 8 15:46:07 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Mar 8 15:46:07 2016 +0100

----------------------------------------------------------------------
 .../apache/syncope/core/rest/SearchTestITCase.java    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/cf1ae34c/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java b/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java
index 2eb998b..b58261c 100644
--- a/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java
+++ b/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Set;
 import org.apache.syncope.client.SyncopeClient;
 import org.apache.syncope.common.reqres.PagedResult;
+import org.apache.syncope.common.services.UserSelfService;
 import org.apache.syncope.common.to.RoleTO;
 import org.apache.syncope.common.to.UserTO;
 import org.junit.FixMethodOrder;
@@ -138,6 +139,19 @@ public class SearchTestITCase extends AbstractTest {
     }
 
     @Test
+    public void searchByDate() {
+        clientFactory.create("bellini", "password").getService(UserSelfService.class).read();
+
+        PagedResult<UserTO> users = userService.search(
+                SyncopeClient.getUserSearchConditionBuilder().
+                is("lastLoginDate").lexicalNotBefore("2016-03-02 15:21:22").
+                and("username").equalTo("bellini").query());
+        assertNotNull(users);
+        assertEquals(1, users.getTotalCount());
+        assertEquals(1, users.getResult().size());
+    }
+
+    @Test
     public void searchByEntitlement() {
         final PagedResult<RoleTO> matchingRoles = roleService.search(
                 SyncopeClient.getRoleSearchConditionBuilder().hasEntitlements("USER_LIST",
"USER_READ").query());


Mime
View raw message