Skip to content

Commit

Permalink
Upgrade to gridsuite dependencies 36 (#661)
Browse files Browse the repository at this point in the history
* upgrade to gridsuite dependencies 36

Signed-off-by: Franck LECUYER <[email protected]>
  • Loading branch information
FranckLecuyer authored Jan 15, 2025
1 parent 25b8003 commit dc6d020
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</developers>

<properties>
<gridsuite-dependencies.version>35</gridsuite-dependencies.version>
<gridsuite-dependencies.version>36</gridsuite-dependencies.version>
<liquibase-hibernate-package>org.gridsuite.study.server</liquibase-hibernate-package>
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
<apache.httpclient.version>5.3</apache.httpclient.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void afterRemoval(String s) {
}

@Override
public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
public void onVariantCreated(String sourceVariantId, String targetVariantId) {
// Nothing to do in this listener
}

Expand All @@ -53,6 +53,11 @@ public void onVariantRemoved(String variantId) {
equipmentInfosService.deleteVariants(networkUuid, List.of(variantId));
}

@Override
public void onVariantOverwritten(String sourceVariantId, String targetVariantId) {
// Nothing to do in this listener
}

@Override
public void onExtensionAfterRemoval(Identifiable<?> identifiable, String s) {
// Implement the method here
Expand All @@ -64,7 +69,7 @@ public void onExtensionCreation(Extension<?> extension) {
}

@Override
public void onUpdate(Identifiable<?> identifiable, String s, String s1, Object o, Object o1) {
public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) {
// Implement the method here
}

Expand All @@ -74,7 +79,22 @@ public void onExtensionBeforeRemoval(Extension<?> extension) {
}

@Override
public void onExtensionUpdate(Extension<?> extension, String s, Object o, Object o1) {
public void onExtensionUpdate(Extension<?> extension, String s, String variantId, Object o, Object o1) {
// Implement the method here
}

@Override
public void onPropertyAdded(Identifiable identifiable, String attribute, Object newValue) {
// Nothing to do in this listener
}

@Override
public void onPropertyReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) {
// Nothing to do in this listener
}

@Override
public void onPropertyRemoved(Identifiable identifiable, String attribute, Object oldValue) {
// Nothing to do in this listener
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ void testVariantNotifications() {
NetworkVariantsListener listener = new NetworkVariantsListener(NETWORK_UUID, equipmentInfosService);

listener.onVariantRemoved(VARIANT_ID);
listener.onVariantCreated("variant_1", "variant_2");
listener.onVariantOverwritten("variant_2", "variant_3");
listener.onUpdate(null, null, null, null, null);
listener.onExtensionUpdate(null, null, null, null, null);
listener.onPropertyAdded(null, null, null);
listener.onPropertyReplaced(null, null, null, null);
listener.onPropertyRemoved(null, null, null);

List<EquipmentInfos> equipmentInfos = equipmentInfosService.findAllEquipmentInfos(NETWORK_UUID);
assertEquals(2, equipmentInfos.size());
assertEquals(2, equipmentInfos.stream().filter(eq -> eq.getVariantId().equals(VariantManagerConstants.INITIAL_VARIANT_ID)).count());
Expand Down

0 comments on commit dc6d020

Please sign in to comment.