Skip to content

Commit

Permalink
less code
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt committed Jun 14, 2024
1 parent 5591ff2 commit 7786299
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.logging.HttpLoggingInterceptor;
import org.junit.After;
import org.junit.Test;
Expand Down Expand Up @@ -270,17 +269,15 @@ public JsonNode assertTransactionReported(String pathToTest, int expectedRespons

public void executeAndValidateRequest(String pathToTest, String expectedContent, Integer expectedResponseCode,
Map<String, String> headersMap) throws IOException, InterruptedException {
final ResponseBody responseBody;
final String responseString;
try (Response response = executeRequest(pathToTest, headersMap)) {
if (expectedResponseCode != null) {
assertThat(response.code())
.withFailMessage(response + getServerLogs())
.isEqualTo(expectedResponseCode);
}
responseBody = response.body();
responseString = response.body().string();
}
assertThat(responseBody).isNotNull();
String responseString = responseBody.string();
if (expectedContent != null) {
assertThat(responseString)
.describedAs("unexpected response content")
Expand Down

0 comments on commit 7786299

Please sign in to comment.