LogicalClassifierDataGetter { public Optional<String> getInterfaceBetweenDpnIds(DpnIdType srcDpnId, DpnIdType dstDpnId) { return theGeniusRpcClient.getTargetInterfaceFromGeniusRPC(srcDpnId, dstDpnId); } 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 getTunnelInterfaceNamePositive() { DpnIdType srcDpn = new DpnIdType(new BigInteger(FIRST_SF_DPN_ID)); DpnIdType dstDpn = new DpnIdType(new BigInteger("9876543210")); Assert.assertEquals(FIRST_SF_NEUTRON_PORT, dataGetter.getInterfaceBetweenDpnIds(srcDpn, dstDpn).get()); }
@Test public void getTunnelInterfaceNameNegative() { DpnIdType srcDpn = new DpnIdType(new BigInteger(FIRST_SF_DPN_ID)); DpnIdType dstDpn = new DpnIdType(new BigInteger("9876543210")); when(geniusRpc.getTargetInterfaceFromGeniusRPC(any(DpnIdType.class), any(DpnIdType.class))) .thenReturn(Optional.empty()); Assert.assertFalse(dataGetter.getInterfaceBetweenDpnIds(srcDpn, dstDpn).isPresent()); }