Skip to content

Commit a8d66fe

Browse files
committed
clean
Signed-off-by: Etienne Homer <[email protected]>
1 parent 00bad76 commit a8d66fe

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

src/main/java/org/gridsuite/useradmin/server/service/ConnectionsService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void recordConnectionAttempt(String sub, Boolean isAllowed) {
4545
public List<ConnectionEntity> removeDuplicates() {
4646
Map<String, List<ConnectionEntity>> connectionsBySub = connectionRepository.findAll().stream().collect(Collectors.groupingBy(ConnectionEntity::getSub));
4747

48-
connectionsBySub.keySet().forEach(sub -> {
48+
connectionsBySub.keySet().forEach(sub ->
4949
connectionsBySub.get(sub).stream().skip(1).forEach(connectionEntity -> {
5050
ConnectionEntity groupedEntity = connectionsBySub.get(sub).get(0);
5151
if (connectionEntity.getLastConnexionDate().isAfter(groupedEntity.getLastConnexionDate())) {
@@ -55,8 +55,8 @@ public List<ConnectionEntity> removeDuplicates() {
5555
groupedEntity.setFirstConnexionDate(connectionEntity.getFirstConnexionDate());
5656
}
5757
connectionRepository.delete(connectionEntity);
58-
});
59-
});
58+
})
59+
);
6060
return connectionsBySub.values().stream().map(list -> list.get(0)).collect(Collectors.toList());
6161
}
6262
}

src/main/java/org/gridsuite/useradmin/server/service/UserAdminService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
*/
2929
@Service
3030
public class UserAdminService {
31-
private static final Logger LOGGER = LoggerFactory.getLogger(UserAdminService.class);
3231
private UserAdminRepository userAdminRepository;
3332

3433
private ConnectionsService connectionsService;

src/main/resources/config/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ dbName: useradmin
66

77
useradmin:
88
admins:
9-
- etiennehomer
9+
# - admin1
1010
# - admin2
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"/>

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ public void testGetConnections() throws Exception {
181181

182182
assertEquals(2, userEntities.size());
183183

184-
UUID userId = userEntities.get(0).getId();
185-
186184
mockMvc.perform(head("/" + UserAdminApi.API_VERSION + "/users/{sub}", USER_SUB))
187185
.andExpect(status().isOk())
188186
.andReturn();
@@ -203,10 +201,8 @@ public void testGetConnections() throws Exception {
203201
assertEquals(2, connectionEntities.size());
204202

205203
connectionRepository.save(new ConnectionEntity(USER_SUB, LocalDateTime.now(), LocalDateTime.now(), true));
206-
207-
connectionRepository.save(new ConnectionEntity(USER_SUB, LocalDateTime.now(), LocalDateTime.now(), true));
208-
209204
connectionRepository.save(new ConnectionEntity(USER_SUB, LocalDateTime.now(), LocalDateTime.now(), true));
205+
connectionRepository.save(new ConnectionEntity(USER_SUB2, LocalDateTime.now(), LocalDateTime.now(), false));
210206

211207
connectionEntities = objectMapper.readValue(
212208
mockMvc.perform(get("/" + UserAdminApi.API_VERSION + "/connections")

0 commit comments

Comments
 (0)