@SuppressWarnings("unchecked") @Test public void testUpdateMembershipsOnHeartbeatEventDoesNotRequestInfoFromBlackListedServiceInstance() { testSubject.updateMembership(LOAD_FACTOR, COMMAND_NAME_FILTER); String nonAxonServiceInstanceId = "nonAxonInstance"; ServiceInstance nonAxonInstance = mock(ServiceInstance.class); when(nonAxonInstance.getServiceId()).thenReturn(nonAxonServiceInstanceId); when(nonAxonInstance.getUri()).thenReturn(URI.create("http: when(discoveryClient.getServices()).thenReturn(ImmutableList.of(SERVICE_INSTANCE_ID, nonAxonServiceInstanceId)); when(discoveryClient.getInstances(nonAxonServiceInstanceId)).thenReturn(ImmutableList.of(nonAxonInstance)); ResponseEntity<MessageRoutingInformation> responseEntity = mock(ResponseEntity.class); URI testRemoteUri = URI.create("http: when(restTemplate.exchange( eq(testRemoteUri), eq(HttpMethod.GET), eq(HttpEntity.EMPTY), eq(MessageRoutingInformation.class) )).thenReturn(responseEntity); testSubject.updateMemberships(mock(HeartbeatEvent.class)); testSubject.updateMemberships(mock(HeartbeatEvent.class)); verify(discoveryClient, times(2)).getServices(); verify(discoveryClient, times(2)).getInstances(nonAxonServiceInstanceId); verify(discoveryClient, times(2)).getInstances(SERVICE_INSTANCE_ID); verify(restTemplate, times(1)).exchange(uriArgumentCaptor.capture(), eq(HttpMethod.GET), eq(HttpEntity.EMPTY), eq(MessageRoutingInformation.class)); URI resultUri = uriArgumentCaptor.getValue(); assertEquals(messageRoutingInformationEndpoint, resultUri.getPath()); }
@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();  }