Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2611] Fixed Non-deterministic behavior of Class.getDeclaredFields() that might fail test in EmbedUrlProcessorServletTest #2630

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import com.adobe.cq.wcm.core.components.internal.services.embed.PinterestUrlProcessor;
import com.adobe.cq.wcm.core.components.services.embed.UrlProcessor;
import com.adobe.cq.wcm.core.components.testing.Utils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.testing.mock.aem.junit5.AemContextExtension;

Expand Down Expand Up @@ -74,6 +77,9 @@ public void testUrlWithRegisteredProvider() throws Exception {
String expectedOutput = "{\"processor\":\"pinterest\",\"options\":{\"pinId\":\"99360735500167749\"}}";
assertEquals(HttpServletResponse.SC_OK, context.response().getStatus(), "Expected the 200 status code.");
assertEquals("application/json;charset=utf-8", context.response().getContentType(), "Expected the JSON content type.");
assertEquals(expectedOutput, context.response().getOutputAsString(), "Does not match the expected response output.");
ObjectMapper mapper = new ObjectMapper();
JsonNode expected = mapper.readTree(expectedOutput);
JsonNode actual = mapper.readTree(context.response().getOutputAsString());
assertEquals(expected, actual, "Does not match the expected response output.");
}
}
Loading