RemoteConnectionSocketBindingCustomizer implements Customizer { @Override public void customize() { List<Server> servers = fraction.subresources().servers(); servers.stream() .filter(e -> e instanceof EnhancedServer) .forEach(server -> { ((EnhancedServer) server).remoteConnections() .forEach(connection -> { OutboundSocketBinding binding = new OutboundSocketBinding(connection.name()); binding.remoteHost(connection.host()) .remotePort(connection.port()); group.outboundSocketBinding(binding); }); }); }  @Override void customize();  }
@Test public void testNoOp() { this.customizer.customize(); assertThat( this.group.outboundSocketBindings() ).isEmpty(); }
@Test public void testSocketBinding() { this.fraction.defaultServer( (server)->{ server.remoteConnection( "postoffice" ); }); this.customizer.customize(); assertThat( this.group.outboundSocketBindings() ).hasSize(1); OutboundSocketBinding binding = this.group.outboundSocketBindings().get(0); assertThat( binding.name() ).isEqualTo( "postoffice" ); assertThat( binding.remotePortExpression() ).isEqualTo("" +MessagingProperties.DEFAULT_REMOTE_PORT ); assertThat( binding.remoteHostExpression() ).isEqualTo(MessagingProperties.DEFAULT_REMOTE_HOST ); }