Skip to content

Commit 8696a80

Browse files
committed
enrich TU
Signed-off-by: Etienne Homer <[email protected]>
1 parent 99fb2d7 commit 8696a80

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/org/gridsuite/useradmin/server/UserAdminTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.test.web.servlet.MockMvc;
2323

2424
import java.time.LocalDateTime;
25+
import java.time.ZoneOffset;
2526
import java.util.List;
2627
import java.util.UUID;
2728

@@ -108,8 +109,10 @@ public void testUserAdmin() throws Exception {
108109
assertEquals(2, connectionRepository.findAll().size());
109110
assertTrue(connectionRepository.findBySub(USER_SUB).getConnectionAccepted());
110111
assertFalse(connectionRepository.findBySub("UNKNOWN").getConnectionAccepted());
111-
112112
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+
113116
mockMvc.perform(head("/" + UserAdminApi.API_VERSION + "/users/{sub}", USER_SUB))
114117
.andExpect(status().isOk())
115118
.andReturn();

0 commit comments

Comments
 (0)