TargetEndpointResolver implements EndpointResolver { public ResolvedEndpoint resolve(Request serverRequest, ExecutionContext executionContext) { String targetUri = (String) executionContext.getAttribute(ExecutionContext.ATTR_REQUEST_ENDPOINT); return (targetUri != null) ? selectUserDefinedEndpoint(serverRequest, targetUri, executionContext) : selectLoadBalancedEndpoint(serverRequest); }  ResolvedEndpoint resolve(Request serverRequest, ExecutionContext executionContext);  }
@Test public void shouldResolveUserDefinedEndpoint_withPointsInName() { String expectedURI = "http: String requestEndpoint = "lo:cal:"; String endpointName = "lo:cal"; String endpointTarget = "http: when(executionContext.getAttribute(ExecutionContext.ATTR_REQUEST_ENDPOINT)).thenReturn(requestEndpoint); Endpoint endpoint = mock(Endpoint.class); when(endpoint.name()).thenReturn(endpointName); referenceRegister.add(new EndpointReference(endpoint)); EndpointResolver.ResolvedEndpoint resolvedEndpoint = resolver.resolve(serverRequest, executionContext); Assert.assertNull(resolvedEndpoint); verify(endpoint, never()).target(); verify(endpoint, never()).available(); verify(groupManager, never()).getDefault(); verify(loadBalancedEndpointGroup, never()).next(); }