File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/test/java/org/gridsuite/useradmin/server Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 22
22
import org .springframework .test .web .servlet .MockMvc ;
23
23
24
24
import java .time .LocalDateTime ;
25
+ import java .time .ZoneOffset ;
25
26
import java .util .List ;
26
27
import java .util .UUID ;
27
28
@@ -108,8 +109,10 @@ public void testUserAdmin() throws Exception {
108
109
assertEquals (2 , connectionRepository .findAll ().size ());
109
110
assertTrue (connectionRepository .findBySub (USER_SUB ).getConnectionAccepted ());
110
111
assertFalse (connectionRepository .findBySub ("UNKNOWN" ).getConnectionAccepted ());
111
-
112
112
LocalDateTime firstConnectionDate = connectionRepository .findBySub (USER_SUB ).getFirstConnexionDate ();
113
+ //firstConnectionDate and lastConnectionDate are equals cause this is the first connection for this user
114
+ assertTrue (firstConnectionDate .toEpochSecond (ZoneOffset .UTC ) < connectionRepository .findBySub (USER_SUB ).getLastConnexionDate ().toEpochSecond (ZoneOffset .UTC ) + 2 );
115
+
113
116
mockMvc .perform (head ("/" + UserAdminApi .API_VERSION + "/users/{sub}" , USER_SUB ))
114
117
.andExpect (status ().isOk ())
115
118
.andReturn ();
You can’t perform that action at this time.
0 commit comments