Skip to content

Commit 6a20ea5

Browse files
committed
🔊 Add logging to endpoint tests
The test keeps hanging during CI processing. Hopefully this will help us debug that.
1 parent 9e0cf00 commit 6a20ea5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎spring/fluentforms-spring-boot-autoconfigure/src/test/java/com/_4point/aem/fluentforms/spring/AemProxyEndpointTest.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.junit.jupiter.params.provider.Arguments;
1313
import org.junit.jupiter.params.provider.FieldSource;
1414
import org.junit.jupiter.params.provider.ValueSource;
15+
import org.slf4j.Logger;
16+
import org.slf4j.LoggerFactory;
1517
import org.springframework.boot.SpringApplication;
1618
import org.springframework.boot.autoconfigure.SpringBootApplication;
1719
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -40,6 +42,8 @@
4042
"logging.level.com._4point.aem.fluentforms.spring.AemProxyEndpoint=DEBUG"
4143
})
4244
class AemProxyEndpointTest {
45+
private final static Logger logger = LoggerFactory.getLogger(AemProxyEndpointTest.class);
46+
4347
static final int WIREMOCK_PORT = 5504;
4448
static final String AF_BASE_LOCATION = "/aem";
4549

@@ -103,6 +107,12 @@ void testProxyGet_Utils_Js() {
103107
private void runTest(String endpoint, String inputText, String expectedResponseText) {
104108
stubFor(get(urlPathEqualTo(endpoint)).willReturn(okForContentType("text/plain", inputText)));
105109

110+
logger.atInfo()
111+
.addArgument(endpoint)
112+
.addArgument(inputText)
113+
.addArgument(expectedResponseText)
114+
.log("Testing proxy endpoint '{}' with input '{}', expecting response '{}'.");
115+
106116
// When
107117
// Make rest call to the proxy endpoint
108118
String result = restClient.get()

0 commit comments

Comments
 (0)