add live profile
This commit is contained in:
@@ -45,7 +45,7 @@ public class RestTemplateFactory implements FactoryBean<RestTemplate>, Initializ
|
||||
final RequestConfig config = RequestConfig.custom().setConnectTimeout(timeout * 1000).setConnectionRequestTimeout(timeout * 1000).setSocketTimeout(timeout * 1000).build();
|
||||
|
||||
final BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||
credentialsProvider.setCredentials(new AuthScope("localhost", 8080, AuthScope.ANY_REALM), new UsernamePasswordCredentials("user1", "user1Pass"));
|
||||
credentialsProvider.setCredentials(new AuthScope("localhost", 8082, AuthScope.ANY_REALM), new UsernamePasswordCredentials("user1", "user1Pass"));
|
||||
final CloseableHttpClient client = HttpClientBuilder.create().setDefaultRequestConfig(config).setDefaultCredentialsProvider(credentialsProvider).build();
|
||||
|
||||
final ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(client);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ClientLiveTest {
|
||||
|
||||
@Test
|
||||
public final void whenSecuredRestApiIsConsumed_then200OK() {
|
||||
final ResponseEntity<Foo> responseEntity = secureRestTemplate.exchange("http://localhost:8080/spring-security-rest-basic-auth/api/foos/1", HttpMethod.GET, null, Foo.class);
|
||||
final ResponseEntity<Foo> responseEntity = secureRestTemplate.exchange("http://localhost:8082/spring-security-rest-basic-auth/api/foos/1", HttpMethod.GET, null, Foo.class);
|
||||
assertThat(responseEntity.getStatusCode().value(), is(200));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
* */
|
||||
public class RestClientLiveManualTest {
|
||||
|
||||
final String urlOverHttps = "http://localhost:8080/spring-security-rest-basic-auth/api/bars/1";
|
||||
final String urlOverHttps = "http://localhost:8082/spring-security-rest-basic-auth/api/bars/1";
|
||||
|
||||
// tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user