ClassifierRspUpdateDataGetter { public List<Acl> filterAclsByRspName(RspName theRspName) { InstanceIdentifier<AccessLists> ifConfigIID = InstanceIdentifier.builder(AccessLists.class).build(); return Optional.ofNullable(SfcDataStoreAPI.readTransactionAPI(ifConfigIID, LogicalDatastoreType.CONFIGURATION)) .map(AccessLists::getAcl) .orElse(Collections.emptyList()) .stream() .filter(acl -> acl.getAccessListEntries() != null) .filter(acl -> acl.getAccessListEntries().getAce() .stream() .map(Ace::getActions) .map(actions -> actions.getAugmentation(Actions1.class)) .map(actions1 -> (AclRenderedServicePath) actions1.getSfcAction()) .anyMatch(sfcAction -> sfcAction.getRenderedServicePath().equals(theRspName.getValue()))) .collect(Collectors.toList()); }  List<Acl> filterAclsByRspName(RspName theRspName); List<SclServiceFunctionForwarder> filterClassifierNodesByAclName(String theAclName);  }
@Test public void testAclFilteringByRspName() { PowerMockito.when(SfcDataStoreAPI .readTransactionAPI(any(), any())).thenReturn(accessLists); RspName theRspName = new RspName("rsp1"); ClassifierRspUpdateDataGetter rspUpdateListener = new ClassifierRspUpdateDataGetter(); Assert.assertFalse(rspUpdateListener.filterAclsByRspName(theRspName).isEmpty()); Assert.assertEquals(1, rspUpdateListener.filterAclsByRspName(theRspName).size()); Assert.assertEquals("acl1", rspUpdateListener.filterAclsByRspName(theRspName).get(0).getAclName()); }