|
1 | 1 | package dev.tomr.hcloud.component.http; |
2 | 2 |
|
| 3 | +import com.fasterxml.jackson.core.JsonProcessingException; |
3 | 4 | import com.fasterxml.jackson.databind.ObjectMapper; |
4 | 5 | import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder; |
5 | 6 | import com.github.tomakehurst.wiremock.common.Notifier; |
6 | 7 | import com.github.tomakehurst.wiremock.junit5.WireMockExtension; |
7 | 8 | import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; |
8 | 9 | import com.github.tomakehurst.wiremock.junit5.WireMockTest; |
| 10 | +import dev.tomr.hcloud.HetznerCloud; |
9 | 11 | import dev.tomr.hcloud.http.HetznerCloudHttpClient; |
10 | 12 | import dev.tomr.hcloud.http.RequestVerb; |
11 | 13 | import dev.tomr.hcloud.http.exception.HetznerApiException; |
|
14 | 16 | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | 17 | import org.junit.jupiter.params.ParameterizedTest; |
16 | 18 | import org.junit.jupiter.params.provider.ValueSource; |
| 19 | +import org.mockito.MockedStatic; |
17 | 20 |
|
18 | 21 | import java.io.IOException; |
| 22 | +import java.util.List; |
19 | 23 |
|
20 | 24 | import static com.github.tomakehurst.wiremock.client.WireMock.*; |
21 | 25 | import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; |
22 | 26 | import static org.junit.jupiter.api.Assertions.*; |
| 27 | +import static org.mockito.Mockito.*; |
23 | 28 |
|
24 | 29 | public class HttpClientComponentTest { |
25 | 30 |
|
@@ -116,7 +121,7 @@ void testHttpClientThrowsHetznerApiExceptionWhenBadJsonResponse() { |
116 | 121 |
|
117 | 122 | @Test |
118 | 123 | @DisplayName("HTTP Client handles 204 no content correctly") |
119 | | - void httpClientHandles204NoContent() throws IOException, InterruptedException, IllegalAccessException { |
| 124 | + void httpClientHandles204NoContent() { |
120 | 125 | // this test is needed because 204 does not support handling a body |
121 | 126 | // todo refactor how we handle HTTP Status codes we **know** will never supply a body, i.e. 204 - this implementation leaves a lot to be desired |
122 | 127 | wireMockExtension.stubFor(get("/test").willReturn(aResponse().withStatus(204))); |
|
0 commit comments