Skip to content

Commit

Permalink
Format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadzim Hushchanskou authored and Vadzim Hushchanskou committed Nov 30, 2024
1 parent 8ce1de9 commit ca8c20b
Showing 1 changed file with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,31 @@ public Response send(RequestSender requestSender) {

@Override
public Response next(FilterableRequestSpecification requestSpecification,
FilterableResponseSpecification responseSpecification) {
FilterableResponseSpecification responseSpecification) {
return response;
}
};
}

public static Iterable<Object[]> requestData() {
return Arrays.asList(
new Object[] { JSON_TYPE, "{\"object\": {\"key\": \"value\"}}", "{\"object\": {\"key\": \"value\"}}", JsonPrettier.INSTANCE,
null, null },
new Object[] { "application/xml", "<test><key><value>value</value></key></test>",
"<test><key><value>value</value></key></test>", XmlPrettier.INSTANCE, null, null }
new Object[]{JSON_TYPE, "{\"object\": {\"key\": \"value\"}}", "{\"object\": {\"key\": \"value\"}}",
JsonPrettier.INSTANCE, null, null},
new Object[]{"application/xml", "<test><key><value>value</value></key></test>",
"<test><key><value>value</value></key></test>", XmlPrettier.INSTANCE, null, null}
);
}

private void runFilter(FilterableRequestSpecification requestSpecification, Response responseObject,
Consumer<MockedStatic<ReportPortal>> mocks, OrderedFilter filter) {
Consumer<MockedStatic<ReportPortal>> mocks, OrderedFilter filter) {
try (MockedStatic<ReportPortal> utilities = Mockito.mockStatic(ReportPortal.class)) {
mocks.accept(utilities);
filter.filter(requestSpecification, null, getFilterContext(responseObject));
}
}

private void runFilter(FilterableRequestSpecification requestSpecification, Response responseObject,
Consumer<MockedStatic<ReportPortal>> mocks) {
Consumer<MockedStatic<ReportPortal>> mocks) {
runFilter(requestSpecification, responseObject, mocks, new ReportPortalRestAssuredLoggingFilter(42, LogLevel.INFO));
}

Expand All @@ -147,7 +147,7 @@ private List<String> runFilterTextMessageCapture(FilterableRequestSpecification
}

private List<ReportPortalMessage> runFilterBinaryMessageCapture(FilterableRequestSpecification requestSpecification,
Response responseObject) {
Response responseObject) {
ArgumentCaptor<ReportPortalMessage> logCapture = ArgumentCaptor.forClass(ReportPortalMessage.class);
runFilter(
requestSpecification,
Expand Down Expand Up @@ -222,7 +222,7 @@ public void test_rest_assured_logger_null_values() {
@MethodSource("requestData")
@SuppressWarnings("rawtypes")
public void test_rest_assured_logger_text_body(String mimeType, Object requestBody, Object responseBody,
Function<String, String> prettier) {
Function<String, String> prettier) {
FilterableRequestSpecification requestSpecification = mockBasicRequest(mimeType);
when(requestSpecification.getBody()).thenReturn(requestBody);

Expand All @@ -244,7 +244,7 @@ public void test_rest_assured_logger_text_body(String mimeType, Object requestBo
}

public static Iterable<Object[]> testTypes() {
return Arrays.asList(new Object[] { HTML_TYPE }, new Object[] { null });
return Arrays.asList(new Object[]{HTML_TYPE}, new Object[]{null});
}

@ParameterizedTest
Expand Down Expand Up @@ -361,7 +361,7 @@ private byte[] getResource(String imagePath) {
private static final String WILDCARD_TYPE = "*/*";

@ParameterizedTest
@ValueSource(strings = { IMAGE_TYPE, WILDCARD_TYPE })
@ValueSource(strings = {IMAGE_TYPE, WILDCARD_TYPE})
@SuppressWarnings("rawtypes")
public void test_rest_assured_logger_image_body(String mimeType) throws IOException {
FilterableRequestSpecification requestSpecification = mockBasicRequest(mimeType);
Expand Down Expand Up @@ -461,7 +461,7 @@ private MultiPartSpecification getBinaryPart(String mimeType, String filePath, b
}

@ParameterizedTest
@ValueSource(booleans = { true, false })
@ValueSource(booleans = {true, false})
public void test_rest_assured_logger_image_multipart(boolean isFile) throws IOException {
byte[] image = getResource(IMAGE);
String imageType = ContentType.IMAGE_JPEG.getMimeType();
Expand Down Expand Up @@ -557,13 +557,13 @@ public void test_rest_assured_logger_text_and_image_multipart() throws IOExcepti

public static Iterable<Object[]> invalidContentTypes() {
return Arrays.asList(
new Object[] { "", ContentType.APPLICATION_OCTET_STREAM.getMimeType() },
new Object[] { null, ContentType.APPLICATION_OCTET_STREAM.getMimeType() },
new Object[] { "*/*", "*/*" },
new Object[] { "something invalid", "something invalid" },
new Object[] { "/", "/" },
new Object[] { "#*'\\`%^!@/\"$;", "#*'\\`%^!@/\"$" },
new Object[] { "a/a;F#%235f\\=f324$%^&", "a/a" }
new Object[]{"", ContentType.APPLICATION_OCTET_STREAM.getMimeType()},
new Object[]{null, ContentType.APPLICATION_OCTET_STREAM.getMimeType()},
new Object[]{"*/*", "*/*"},
new Object[]{"something invalid", "something invalid"},
new Object[]{"/", "/"},
new Object[]{"#*'\\`%^!@/\"$;", "#*'\\`%^!@/\"$"},
new Object[]{"a/a;F#%235f\\=f324$%^&", "a/a"}
);
}

Expand Down

0 comments on commit ca8c20b

Please sign in to comment.