Skip to content

Commit 7d2edde

Browse files
authored
Resetting wiremock manually (#3753)
1 parent 794f387 commit 7d2edde

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/imds/src/test/java/software/amazon/awssdk/imds/internal/CachedTokenClientTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
3535
import java.net.URI;
3636
import java.time.Duration;
37+
import org.junit.jupiter.api.AfterEach;
3738
import org.junit.jupiter.api.BeforeEach;
3839
import org.junit.jupiter.api.Test;
3940
import software.amazon.awssdk.core.exception.SdkClientException;
@@ -51,6 +52,11 @@ void init(WireMockRuntimeInfo wmRuntimeInfo) {
5152
.endpoint(URI.create("http://localhost:" + wmRuntimeInfo.getHttpPort()));
5253
}
5354

55+
@AfterEach
56+
void tearDown(WireMockRuntimeInfo wmRuntimeInfo) {
57+
wmRuntimeInfo.getWireMock().resetMappings();
58+
}
59+
5460
@Test
5561
void get_tokenFailsError4xx_shouldNotRetry() {
5662
stubFor(put(urlPathEqualTo("/latest/api/token")).willReturn(aResponse().withStatus(400).withBody("ERROR 400")));

0 commit comments

Comments
 (0)