Add logging for bulkhead test (#13834)

This commit is contained in:
Adrian Bob 2023-04-13 19:25:49 +03:00 committed by GitHub
parent 771269e07a
commit 7a426829cb
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,8 @@ import java.util.stream.IntStream;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.client.TestRestTemplate;
@ -32,6 +34,8 @@ import org.springframework.http.ResponseEntity;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class ResilientAppControllerIntegrationTest { class ResilientAppControllerIntegrationTest {
private final Logger LOGGER = LoggerFactory.getLogger(getClass());
@Autowired private TestRestTemplate restTemplate; @Autowired private TestRestTemplate restTemplate;
@LocalServerPort private Integer port; @LocalServerPort private Integer port;
@ -226,6 +230,7 @@ class ResilientAppControllerIntegrationTest {
executorService.shutdown(); executorService.shutdown();
assertEquals(2, responseStatusCount.keySet().size()); assertEquals(2, responseStatusCount.keySet().size());
LOGGER.info("Response statuses: " + responseStatusCount.keySet());
assertTrue(responseStatusCount.containsKey(BANDWIDTH_LIMIT_EXCEEDED.value())); assertTrue(responseStatusCount.containsKey(BANDWIDTH_LIMIT_EXCEEDED.value()));
assertTrue(responseStatusCount.containsKey(OK.value())); assertTrue(responseStatusCount.containsKey(OK.value()));
EXTERNAL_SERVICE.verify(3, getRequestedFor(urlEqualTo("/api/external"))); EXTERNAL_SERVICE.verify(3, getRequestedFor(urlEqualTo("/api/external")));