@Test public void getInterfaceNameFromClassifierWrongAttachmentPoint() { when(sffClassifier.getAttachmentPointType()).thenReturn(new BridgeBuilder().build()); Optional<String> res = handler.getInterfaceNameFromClassifier(sffClassifier); Assert.assertFalse(res.isPresent()); }
public Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier) { return Optional.ofNullable(theClassifier) .filter(classifier -> classifier.getAttachmentPointType() instanceof Interface) .map(classifier -> (Interface) classifier.getAttachmentPointType()) .map(Interface::getInterface); }
ClassifierHandler { public Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier) { return Optional.ofNullable(theClassifier) .filter(classifier -> classifier.getAttachmentPointType() instanceof Interface) .map(classifier -> (Interface) classifier.getAttachmentPointType()) .map(Interface::getInterface); } }
ClassifierHandler { public Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier) { return Optional.ofNullable(theClassifier) .filter(classifier -> classifier.getAttachmentPointType() instanceof Interface) .map(classifier -> (Interface) classifier.getAttachmentPointType()) .map(Interface::getInterface); }  }
ClassifierHandler { public Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier) { return Optional.ofNullable(theClassifier) .filter(classifier -> classifier.getAttachmentPointType() instanceof Interface) .map(classifier -> (Interface) classifier.getAttachmentPointType()) .map(Interface::getInterface); }  String buildFlowKeyName(String scfName, String aclName, String aceName, String type); Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier); FlowDetails deleteFlowFromTable(String nodeName, String flowKey, short tableID); FlowDetails addRspRelatedFlowIntoNode(String nodeName, FlowBuilder flow, long rspId); boolean usesLogicalInterfaces(ServiceFunctionForwarder theSff); Optional<Acl> extractAcl(ServiceFunctionClassifier scf); }
ClassifierHandler { public Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier) { return Optional.ofNullable(theClassifier) .filter(classifier -> classifier.getAttachmentPointType() instanceof Interface) .map(classifier -> (Interface) classifier.getAttachmentPointType()) .map(Interface::getInterface); }  String buildFlowKeyName(String scfName, String aclName, String aceName, String type); Optional<String> getInterfaceNameFromClassifier(SclServiceFunctionForwarder theClassifier); FlowDetails deleteFlowFromTable(String nodeName, String flowKey, short tableID); FlowDetails addRspRelatedFlowIntoNode(String nodeName, FlowBuilder flow, long rspId); boolean usesLogicalInterfaces(ServiceFunctionForwarder theSff); Optional<Acl> extractAcl(ServiceFunctionClassifier scf);  }