diff --git a/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceIntegrationTest.java b/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceIntegrationTest.java index 0c4d34db7..a58f86dd4 100644 --- a/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceIntegrationTest.java +++ b/avni-server-api/src/test/java/org/avni/server/service/AddressLevelServiceIntegrationTest.java @@ -61,6 +61,10 @@ public void findByAddressMap() { AddressLevel gp2AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("gp2").title("gp2").type(grandParent).build()); AddressLevel parent2AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("parent2").title("parent2").type(parent).parent(gp2AddressLevel).build()); AddressLevel child2AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("child2").title("child2").type(child).parent(parent2AddressLevel).build()); +// AddressLevel gp3AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("gp3").title("gp3").type(grandParent).build()); +// AddressLevel parent3AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("parent3").title("parent2").type(parent).parent(gp3AddressLevel).build()); +// AddressLevel child3AddressLevel = testLocationService.save(new AddressLevelBuilder().withUuid("child3").title("child1").type(child).parent(parent3AddressLevel).build()); + Map addressLevelMap = new HashMap<>(); //valid hierarchy @@ -86,5 +90,13 @@ public void findByAddressMap() { //partial hierarchy addressLevelMap.remove(grandParent.getName()); assertEquals(Optional.empty(), addressLevelService.findByAddressMap(addressLevelMap)); + +// //valid locations in valid hierarchy and related, but with duplicate title +// addressLevelMap.put(grandParent.getName(), gp3AddressLevel.getTitle()); +// assertEquals(Optional.empty(), addressLevelService.findByAddressMap(addressLevelMap)); +// addressLevelMap.put(parent.getName(), parent3AddressLevel.getTitle()); +// assertEquals(Optional.empty(), addressLevelService.findByAddressMap(addressLevelMap)); +// addressLevelMap.put(child.getName(), child3AddressLevel.getTitle()); +// assertEquals(child3AddressLevel, addressLevelService.findByAddressMap(addressLevelMap).get()); } }