Skip to content

Commit c4984da

Browse files
committed
Update Caller.java
1 parent fc001fe commit c4984da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/api_assured/Caller.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import java.io.IOException;
1414
import java.nio.charset.StandardCharsets;
1515
import java.util.Objects;
16+
17+
import static utils.FileUtilities.Json.*;
1618
import static utils.reflection.ReflectionUtilities.getPreviousMethodName;
1719
import static utils.StringUtilities.Color.*;
1820
import static utils.reflection.ReflectionUtilities.isOfType;
@@ -142,15 +144,15 @@ private static <T> Response<T> getResponse(Call<T> call, boolean printBody) thro
142144
T body = response.body();
143145
if (keepLogs) log.success("The response code is: " + response.code());
144146
if (keepLogs && !response.message().isEmpty()) log.info(response.message());
145-
if (printBody && printableResponse) log.info("The response body is: \n" + MappingUtilities.Json.getJsonString(body));
147+
if (printBody && printableResponse) log.info("The response body is: \n" + getJsonString(body));
146148
return Response.success(body, response.raw());
147149
}
148150
else {
149151
log.warning("The response code is: " + response.code());
150152
if (response.message().length()>0) log.warning(response.message());
151153
if (response.errorBody() != null && printBody) {
152154
Object errorBody = isOfType(response, Object.class) ?
153-
MappingUtilities.Json.getJsonString(getErrorObject(response, Object.class)) :
155+
getJsonString(getErrorObject(response, Object.class)) :
154156
response.raw();
155157
String errorLog = errorBody.equals("null") ?
156158
"The error body is empty." :

0 commit comments

Comments
 (0)