SfcScfOfProcessor { public boolean deletedServiceFunctionClassifier(ServiceFunctionClassifier scf) { Optional<Acl> theAcl = classifierHandler.extractAcl(scf); if ( !theAcl.isPresent() || !validateInputs(theAcl.get()) ) { LOG.error("createdServiceFunctionClassifier: Could not retrieve the ACL from the classifier: {}", scf); return false; } List<SclServiceFunctionForwarder> sfflist = scf.getSclServiceFunctionForwarder(); if (sfflist == null) { LOG.error("deletedServiceFunctionClassifier: sfflist is null"); return false; } openflowWriter.removeFlows(classifierProcessor.processClassifierList(theAcl.get(), false, sfflist)); openflowWriter.clearSffsIfNoRspExists(); openflowWriter.deleteFlowSet(); return true; } SfcScfOfProcessor(SfcOfFlowWriterInterface theOpenflowWriter,
                             OpenflowClassifierProcessor theClassifierProcessor); boolean createdServiceFunctionClassifier(ServiceFunctionClassifier scf); boolean deletedServiceFunctionClassifier(ServiceFunctionClassifier scf);  }
@Test public void testDeletedServiceFunctionClassifier() { initTest(); assertFalse(sfcScfProcessor.deletedServiceFunctionClassifier(null)); initTest(); assertTrue(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); initTest(); when(acl.getAccessListEntries()).thenReturn(null); assertFalse(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); initTest(); when(accessListEntries.getAce()).thenReturn(null); assertFalse(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); initTest(); PowerMockito.stub(PowerMockito.method(SfcProviderAclAPI.class, "readAccessList")) .toReturn(null); assertFalse(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); initTest(); PowerMockito.stub(PowerMockito.method(SfcOvsUtil.class, "getOpenFlowNodeIdForSff")) .toReturn(null); assertTrue(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); initTest(); PowerMockito.stub(PowerMockito.method(SfcOvsUtil.class, "getVxlanOfPort")) .toReturn(null); assertTrue(sfcScfProcessor.deletedServiceFunctionClassifier(scf)); }