LogicalClassifierDataGetter { public Optional<String> getNodeName(String theInterfaceName) { return theGeniusRpcClient .getDpnIdFromInterfaceNameFromGeniusRPC(theInterfaceName) .map(dpnID -> String.format("openflow:%s", dpnID.getValue().toString())); } private  LogicalClassifierDataGetter();  LogicalClassifierDataGetter(SfcGeniusRpcClient theRpcClient); Optional<String> getInterfaceBetweenDpnIds(DpnIdType srcDpnId, DpnIdType dstDpnId); List<Action> getEgressActionsForTunnelInterface(String theTunnelInterface, int actionOffset); Optional<String> getNodeName(String theInterfaceName); Optional<DpnIdType> getFirstHopDataplaneId(RenderedServicePath theRsp); Optional<DpnIdType> getHopDataplaneId(RenderedServicePathHop hopData); static Optional<Long> getOpenflowPort(String theInterfaceName); static DpnIdType getDpnIdFromNodeName(String theNodeName);  }
@Test public void getNodeNamePositive() { Optional<String> theNodeName = dataGetter.getNodeName(FIRST_SF_NEUTRON_PORT); Assert.assertTrue(theNodeName.isPresent()); Assert.assertEquals(FIRST_SF_NODE_NAME, theNodeName.get()); }
@Test public void getNodeNameNegative () { when(geniusRpc.getDpnIdFromInterfaceNameFromGeniusRPC(anyString())).thenReturn(Optional.empty()); Optional<String> theNodeName = dataGetter.getNodeName(FIRST_SF_NEUTRON_PORT); Assert.assertFalse(theNodeName.isPresent()); }