committed by
GitHub
parent
fc0ed8fe3d
commit
01406f1c8b
@@ -6,11 +6,11 @@ import cucumber.api.java.en.When;
|
||||
public class OtherDefsIntegrationTest extends SpringIntegrationTest {
|
||||
@When("^the client calls /baeldung$")
|
||||
public void the_client_issues_POST_hello() throws Throwable {
|
||||
executePost("http://localhost:8080/baeldung");
|
||||
executePost("http://localhost:8082/baeldung");
|
||||
}
|
||||
|
||||
@Given("^the client calls /hello$")
|
||||
public void the_client_issues_GET_hello() throws Throwable {
|
||||
executeGet("http://localhost:8080/hello");
|
||||
executeGet("http://localhost:8082/hello");
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,11 @@ public class SpringIntegrationTest {
|
||||
final ResponseResultErrorHandler errorHandler = new ResponseResultErrorHandler();
|
||||
|
||||
restTemplate.setErrorHandler(errorHandler);
|
||||
latestResponse = restTemplate.execute(url, HttpMethod.GET, requestCallback, new ResponseExtractor<ResponseResults>() {
|
||||
@Override
|
||||
public ResponseResults extractData(ClientHttpResponse response) throws IOException {
|
||||
if (errorHandler.hadError) {
|
||||
return (errorHandler.getResults());
|
||||
} else {
|
||||
return (new ResponseResults(response));
|
||||
}
|
||||
latestResponse = restTemplate.execute(url, HttpMethod.GET, requestCallback, response -> {
|
||||
if (errorHandler.hadError) {
|
||||
return (errorHandler.getResults());
|
||||
} else {
|
||||
return (new ResponseResults(response));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -56,14 +53,11 @@ public class SpringIntegrationTest {
|
||||
}
|
||||
|
||||
restTemplate.setErrorHandler(errorHandler);
|
||||
latestResponse = restTemplate.execute(url, HttpMethod.POST, requestCallback, new ResponseExtractor<ResponseResults>() {
|
||||
@Override
|
||||
public ResponseResults extractData(ClientHttpResponse response) throws IOException {
|
||||
if (errorHandler.hadError) {
|
||||
return (errorHandler.getResults());
|
||||
} else {
|
||||
return (new ResponseResults(response));
|
||||
}
|
||||
latestResponse = restTemplate.execute(url, HttpMethod.POST, requestCallback, response -> {
|
||||
if (errorHandler.hadError) {
|
||||
return (errorHandler.getResults());
|
||||
} else {
|
||||
return (new ResponseResults(response));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class StepDefsIntegrationTest extends SpringIntegrationTest {
|
||||
|
||||
@When("^the client calls /version$")
|
||||
public void the_client_issues_GET_version() throws Throwable {
|
||||
executeGet("http://localhost:8080/version");
|
||||
executeGet("http://localhost:8082/version");
|
||||
}
|
||||
|
||||
@Then("^the client receives status code of (\\d+)$")
|
||||
|
||||
Reference in New Issue
Block a user