SdxL2VCManager implements SdxL2VCService { @Override public Set<String> getVCs(Optional<String> sdxl2) { return this.sdxL2Store.getVCs(sdxl2); } SdxL2VCManager(ApplicationId sdxl2id,
                          SdxL2Store store,
                          IntentService intentService); @Override void addVC(String sdxl2, SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs); @Override void removeVC(SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs); @Override void removeVC(SdxL2ConnectionPoint cp); Collection<Intent> buildIntents(String sdxl2, SdxL2ConnectionPoint ingress,
                                           SdxL2ConnectionPoint egress); @Override void removeVCs(String sdxl2); @Override Set<String> getVCs(Optional<String> sdxl2); @Override String getVC(SdxL2ConnectionPoint sdxl2cplhs, SdxL2ConnectionPoint sdxl2cprhs);  }
@Test public void testGetVCs() { connectionSetup(); Iterator<SdxL2ConnectionPoint> lhs = setupLhsCPs().iterator(); Iterator<SdxL2ConnectionPoint> rhs = setupRhsCPs().iterator(); Set<String> expectedVCs = Sets.newHashSet(); String vc; String lhsName; String rhsName; while (lhs.hasNext()) { lhsName = lhs.next().name(); rhsName = rhs.next().name(); vc = lhsName.compareTo(rhsName) < 0 ? format(SdxL2VCManager.NAME_FORMAT, SDXL2_2, lhsName, rhsName) : format(SdxL2VCManager.NAME_FORMAT, SDXL2_2, rhsName, lhsName); expectedVCs.add(vc); } Set<String> vcs = manager.getVCs(Optional.of(SDXL2_2)); assertEquals(expectedVCs, vcs); vcs = manager.getVCs(Optional.of(SDXL2_1)); assertEquals(Collections.emptySet(), vcs); vcs = manager.getVCs(Optional.empty()); assertEquals(expectedVCs, vcs); }