@Test public void testUpdateMembershipsOnHeartbeatEventRequestsMessageRoutingInformationByHttpRequestWithContextRoot() { testSubject.updateMembership(LOAD_FACTOR, COMMAND_NAME_FILTER); ServiceInstance remoteInstance = mock(ServiceInstance.class); when(remoteInstance.getServiceId()).thenReturn(SERVICE_INSTANCE_ID); when(remoteInstance.getUri()).thenReturn(testRemoteUri); Map<String, String> metadataWithContextRootPath = new HashMap<>(); metadataWithContextRootPath.put(contextRootMetadataPropertyName, "/contextRootPath"); when(remoteInstance.getMetadata()).thenReturn(metadataWithContextRootPath); when(discoveryClient.getServices()).thenReturn(ImmutableList.of(SERVICE_INSTANCE_ID)); when(discoveryClient.getInstances(SERVICE_INSTANCE_ID)) .thenReturn(ImmutableList.of(remoteInstance)); testSubject.updateMemberships(mock(HeartbeatEvent.class)); verify(discoveryClient).getServices(); verify(discoveryClient).getInstances(SERVICE_INSTANCE_ID); verify(restTemplate).exchange( eq(UriComponentsBuilder.fromUriString("http: .build().toUri()), eq(HttpMethod.GET), eq(HttpEntity.EMPTY), eq(MessageRoutingInformation.class)); }
@Override public void updateMembership(int loadFactor, CommandMessageFilter commandFilter) { messageRoutingInfo = new MessageRoutingInformation(loadFactor, commandFilter, serializer); super.updateMembership(loadFactor, commandFilter); }
SpringCloudHttpBackupCommandRouter extends SpringCloudCommandRouter { @Override public void updateMembership(int loadFactor, CommandMessageFilter commandFilter) { messageRoutingInfo = new MessageRoutingInformation(loadFactor, commandFilter, serializer); super.updateMembership(loadFactor, commandFilter); } }
SpringCloudHttpBackupCommandRouter extends SpringCloudCommandRouter { @Override public void updateMembership(int loadFactor, CommandMessageFilter commandFilter) { messageRoutingInfo = new MessageRoutingInformation(loadFactor, commandFilter, serializer); super.updateMembership(loadFactor, commandFilter); } protected  SpringCloudHttpBackupCommandRouter(Builder builder); }
SpringCloudHttpBackupCommandRouter extends SpringCloudCommandRouter { @Override public void updateMembership(int loadFactor, CommandMessageFilter commandFilter) { messageRoutingInfo = new MessageRoutingInformation(loadFactor, commandFilter, serializer); super.updateMembership(loadFactor, commandFilter); } protected  SpringCloudHttpBackupCommandRouter(Builder builder); static Builder builder(); @Override void updateMembership(int loadFactor, CommandMessageFilter commandFilter); @GetMapping MessageRoutingInformation getLocalMessageRoutingInformation(); }
SpringCloudHttpBackupCommandRouter extends SpringCloudCommandRouter { @Override public void updateMembership(int loadFactor, CommandMessageFilter commandFilter) { messageRoutingInfo = new MessageRoutingInformation(loadFactor, commandFilter, serializer); super.updateMembership(loadFactor, commandFilter); } protected  SpringCloudHttpBackupCommandRouter(Builder builder); static Builder builder(); @Override void updateMembership(int loadFactor, CommandMessageFilter commandFilter); @GetMapping MessageRoutingInformation getLocalMessageRoutingInformation();  }