### Question:
DestinationMapperUtils { OrdinalFactory.EndpointFwdCtxOrdinals getEndpointOrdinals(Endpoint endpoint) { try { return OrdinalFactory.getEndpointFwdCtxOrdinals(ctx, endpoint); } catch (Exception e) { LOG.error("Failed to get fwd ctx ordinals for endpoint {}", endpoint); return null; } } DestinationMapperUtils(OfContext ctx);   }### Answer:
@Test public void getEndpointOrdinals_exceptionCaught() { EndpointBuilder endpointBuilder = buildEndpoint(IPV4_0, MAC_0, CONNECTOR_0); endpointBuilder.setEndpointGroup(ENDPOINT_GROUP_0); when(ctx.getTenant(Mockito.any(TenantId.class))).thenReturn(getTestIndexedTenant()); OrdinalFactory.EndpointFwdCtxOrdinals ordinals = utils.getEndpointOrdinals(endpointBuilder.build()); assertNull(ordinals); }
@Test public void getEndpointOrdinals() { EndpointBuilder endpointBuilder = buildEndpoint(IPV4_0, MAC_0, CONNECTOR_0); endpointBuilder.setEndpointGroup(ENDPOINT_GROUP_0); when(ctx.getTenant(Mockito.any(TenantId.class))).thenReturn(getTestIndexedTenant()); when(ctx.getEndpointManager()).thenReturn(endpointManager); when(ctx.getCurrentPolicy()).thenReturn(policyInfo); OrdinalFactory.EndpointFwdCtxOrdinals ordinals = utils.getEndpointOrdinals(endpointBuilder.build()); assertEquals(ordinals.getEp().toString(), new EpKey(new L2ContextId(L2BD_ID), new MacAddress(MAC_0)).toString()); assertEquals(ordinals.getNetworkContainment(), SUBNET_0); }