@Test public void testGetMethodFactory() { Transport transport = new Transport(); transport.setDefaultLayer(Layer.HTTP); when(kermossProperties.getTransport()).thenReturn(transport); assertThat(httpClientStrategyUnderTest.get()).isInstanceOf(RestCommandTransporterStrategy.class); }
public CommandTransporterStrategy get() { CommandTransporterStrategy strategy; Layer defaultLayer = kermossProperties.getTransport().getDefaultLayer(); if (Layer.HTTP.equals(defaultLayer)) { strategy = new RestCommandTransporterStrategy(restTemplate, kermossProperties); } else { strategy = new FeignCommandTransporterStrategy(client, kermossProperties, FeignCommandTransporterStrategy::defaultClientFactory); } return strategy; }
HttpClientStrategy { public CommandTransporterStrategy get() { CommandTransporterStrategy strategy; Layer defaultLayer = kermossProperties.getTransport().getDefaultLayer(); if (Layer.HTTP.equals(defaultLayer)) { strategy = new RestCommandTransporterStrategy(restTemplate, kermossProperties); } else { strategy = new FeignCommandTransporterStrategy(client, kermossProperties, FeignCommandTransporterStrategy::defaultClientFactory); } return strategy; } }
HttpClientStrategy { public CommandTransporterStrategy get() { CommandTransporterStrategy strategy; Layer defaultLayer = kermossProperties.getTransport().getDefaultLayer(); if (Layer.HTTP.equals(defaultLayer)) { strategy = new RestCommandTransporterStrategy(restTemplate, kermossProperties); } else { strategy = new FeignCommandTransporterStrategy(client, kermossProperties, FeignCommandTransporterStrategy::defaultClientFactory); } return strategy; } HttpClientStrategy(KermossProperties kermossProperties, RestTemplate restTemplate, Client client); }
HttpClientStrategy { public CommandTransporterStrategy get() { CommandTransporterStrategy strategy; Layer defaultLayer = kermossProperties.getTransport().getDefaultLayer(); if (Layer.HTTP.equals(defaultLayer)) { strategy = new RestCommandTransporterStrategy(restTemplate, kermossProperties); } else { strategy = new FeignCommandTransporterStrategy(client, kermossProperties, FeignCommandTransporterStrategy::defaultClientFactory); } return strategy; } HttpClientStrategy(KermossProperties kermossProperties, RestTemplate restTemplate, Client client); CommandTransporterStrategy get(); }
HttpClientStrategy { public CommandTransporterStrategy get() { CommandTransporterStrategy strategy; Layer defaultLayer = kermossProperties.getTransport().getDefaultLayer(); if (Layer.HTTP.equals(defaultLayer)) { strategy = new RestCommandTransporterStrategy(restTemplate, kermossProperties); } else { strategy = new FeignCommandTransporterStrategy(client, kermossProperties, FeignCommandTransporterStrategy::defaultClientFactory); } return strategy; } HttpClientStrategy(KermossProperties kermossProperties, RestTemplate restTemplate, Client client); CommandTransporterStrategy get();  }