X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=servicehandler%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2FDowngradeConstraintsTest.java;h=abc8d502ae84d755aefdb71ea57fcdb022a57d8c;hb=refs%2Fchanges%2F46%2F100646%2F27;hp=61596966ebe50196b155fbde00acfba310d5fac4;hpb=211dacfed540c8ddbf552c229c74b6054b185720;p=transportpce.git diff --git a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/DowngradeConstraintsTest.java b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/DowngradeConstraintsTest.java index 61596966e..abc8d502a 100644 --- a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/DowngradeConstraintsTest.java +++ b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/DowngradeConstraintsTest.java @@ -18,8 +18,7 @@ import static org.junit.Assert.assertTrue; import static org.opendaylight.transportpce.servicehandler.utils.ConstraintsUtils.buildHardConstraint; import static org.opendaylight.transportpce.servicehandler.utils.ConstraintsUtils.buildSoftConstraint; -import java.util.Arrays; -import java.util.List; +import java.util.Set; import org.hamcrest.collection.IsMapContaining; import org.junit.Test; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev210528.NodeIdType; @@ -48,7 +47,7 @@ public class DowngradeConstraintsTest { initialHardConstraints, initialSoftConstraints); assertNull("updated soft constraints should contain no customer code", generatedSoftConstraints.getCustomerCode()); - List softCustomerCode = Arrays.asList("soft-customer-code 3", "soft-customer-code 4"); + Set softCustomerCode = Set.of("soft-customer-code 3", "soft-customer-code 4"); initialSoftConstraints = buildSoftConstraint(softCustomerCode, false, null, null, null, null, false, false, null, null); generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints( @@ -56,7 +55,7 @@ public class DowngradeConstraintsTest { assertEquals(initialSoftConstraints.getCustomerCode(), generatedSoftConstraints.getCustomerCode()); // test addition of hard customer-code when no soft customer-code - List hardCustomerCode = Arrays.asList("hard-customer-code 1", "hard-customer-code 2"); + Set hardCustomerCode = Set.of("hard-customer-code 1", "hard-customer-code 2"); initialHardConstraints = buildHardConstraint(hardCustomerCode, false, null, null, null, null, false, false, null, null); initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, false, false, null, null); @@ -87,7 +86,7 @@ public class DowngradeConstraintsTest { initialHardConstraints, initialSoftConstraints); assertNull("updated soft constraints should contain no diversity constraint", generatedSoftConstraints.getDiversity()); - List softDiversityServiceid = Arrays.asList("soft-service 3"); + Set softDiversityServiceid = Set.of("soft-service 3"); initialSoftConstraints = buildSoftConstraint(null, false, softDiversityServiceid, null, null, null, false, false, null, null); generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints( @@ -95,7 +94,7 @@ public class DowngradeConstraintsTest { assertEquals(initialSoftConstraints.getDiversity(), generatedSoftConstraints.getDiversity()); // test addition of hard diversity when no soft diversity - List hardDiversityServiceid = Arrays.asList("hard-service 1", "hard-service 2"); + Set hardDiversityServiceid = Set.of("hard-service 1", "hard-service 2"); initialHardConstraints = buildHardConstraint(null, false, hardDiversityServiceid, null, null, null, false, false, null, null); initialSoftConstraints = buildSoftConstraint(null, false, null, null, null, null, false, false, null, null); @@ -477,7 +476,7 @@ public class DowngradeConstraintsTest { assertNull("generated soft constraints should be empty", genSoftConstraints.getCoRouting()); assertNull("generated soft constraints should be empty", genSoftConstraints.getLatency()); - List hardCustomerCode = Arrays.asList("customer-code 1", "customer-code 2"); + Set hardCustomerCode = Set.of("customer-code 1", "customer-code 2"); initialHardConstraints = buildHardConstraint(hardCustomerCode, false, null, "link1", "node", null, false, false, null, null); genSoftConstraints = DowngradeConstraints.convertToSoftConstraints(initialHardConstraints);