@Test public void testLookupEndpoint_NotPresent() { when(readOptional.isPresent()).thenReturn(false); Endpoint result = EndpointHelper.lookupEndpoint(epKey, readTransaction); assertNull(result); }
public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) { Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()), transaction); if (optionalEp.isPresent()) { return optionalEp.get(); } return null; }
EndpointHelper { public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) { Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()), transaction); if (optionalEp.isPresent()) { return optionalEp.get(); } return null; } }
EndpointHelper { public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) { Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()), transaction); if (optionalEp.isPresent()) { return optionalEp.get(); } return null; }  }
EndpointHelper { public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) { Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()), transaction); if (optionalEp.isPresent()) { return optionalEp.get(); } return null; }  static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction); static void updateEndpointWithLocation(Endpoint endpoint, String nodeIdString, String nodeConnectorIdString,
            ReadWriteTransaction rwTx); static void updateEndpointRemoveLocation(Endpoint endpoint, ReadWriteTransaction rwTx); }
EndpointHelper { public static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction) { Optional<Endpoint> optionalEp = readFromDs(LogicalDatastoreType.OPERATIONAL, endpointIid(epKey.getL2Context(), epKey.getMacAddress()), transaction); if (optionalEp.isPresent()) { return optionalEp.get(); } return null; }  static Endpoint lookupEndpoint(EndpointKey epKey, ReadOnlyTransaction transaction); static void updateEndpointWithLocation(Endpoint endpoint, String nodeIdString, String nodeConnectorIdString,
            ReadWriteTransaction rwTx); static void updateEndpointRemoveLocation(Endpoint endpoint, ReadWriteTransaction rwTx);  }