Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <[email protected]>
  • Loading branch information
LE SAULNIER Kevin committed Sep 17, 2024
1 parent a96f9ae commit e47545c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,19 @@ void unbuildNode() {
}

@Test
void disabledNetworkModificationTest() {
void activateNetworkModificationTest() {
List<UUID> modificationToDisabledUuids = List.of(UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID());
updateNetworkModificationActivationStatus(modificationToDisabledUuids, node1Uuid, List.of(node2Uuid, node3Uuid), List.of(node1Uuid, node2Uuid), false);
}

@Test
void enableNetworkModificationTest() {
void deactivateNetworkModificationTest() {
List<UUID> modificationToDisabledUuids = List.of(UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID());
updateNetworkModificationActivationStatus(modificationToDisabledUuids, node1Uuid, List.of(node2Uuid, node3Uuid), List.of(node1Uuid, node2Uuid), true);
}

private void updateNetworkModificationActivationStatus(List<UUID> networkModificationUuids, UUID nodeWithModification, List<UUID> childrenNodes, List<UUID> nodesToUnbuild, boolean active) {
studyController.updateNetworkModificationsActivation(studyUuid, node1Uuid, networkModificationUuids, active, "userId");
private void updateNetworkModificationActivationStatus(List<UUID> networkModificationUuids, UUID nodeWithModification, List<UUID> childrenNodes, List<UUID> nodesToUnbuild, boolean activated) {
studyController.updateNetworkModificationsActivation(studyUuid, node1Uuid, networkModificationUuids, activated, "userId");

checkModificationUpdatedMessageReceived(studyUuid, nodeWithModification, childrenNodes, NotificationService.MODIFICATIONS_UPDATING_IN_PROGRESS);
checkUpdateBuildStateMessageReceived(studyUuid, nodesToUnbuild);
Expand All @@ -178,7 +178,7 @@ private void updateNetworkModificationActivationStatus(List<UUID> networkModific
Mockito.verify(restTemplate, Mockito.times(1)).exchange(
matches(".*network-modifications\\?" + networkModificationUuids.stream().map(uuid -> "uuids=" + uuid.toString() + "&").collect(Collectors.joining()) +
"groupUuid=" + node1Infos.getModificationGroupUuid().toString() + "&" +
"active=" + active), eq(HttpMethod.PUT), any(HttpEntity.class), eq(Void.class));
"activated=" + activated), eq(HttpMethod.PUT), any(HttpEntity.class), eq(Void.class));
}

private void checkModificationUpdatedMessageReceived(UUID studyUuid, UUID nodeUuid, List<UUID> childrenNodeUuids, String notificationType) {
Expand Down

0 comments on commit e47545c

Please sign in to comment.