|
1 | 1 | package io.javaoperatorsdk.operator;
|
2 | 2 |
|
3 |
| -import java.net.URI; |
4 |
| - |
5 | 3 | import org.junit.jupiter.api.Test;
|
6 | 4 |
|
7 | 5 | import io.fabric8.kubernetes.api.model.ContainerBuilder;
|
|
15 | 13 | import io.fabric8.kubernetes.api.model.apps.DeploymentSpec;
|
16 | 14 | import io.fabric8.kubernetes.client.CustomResource;
|
17 | 15 | import io.fabric8.kubernetes.client.KubernetesClientException;
|
18 |
| -import io.fabric8.kubernetes.client.http.HttpRequest; |
19 | 16 | import io.fabric8.kubernetes.model.annotation.Group;
|
20 | 17 | import io.fabric8.kubernetes.model.annotation.ShortNames;
|
21 | 18 | import io.fabric8.kubernetes.model.annotation.Version;
|
|
31 | 28 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
32 | 29 | import static org.junit.jupiter.api.Assertions.assertThrows;
|
33 | 30 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
34 |
| -import static org.mockito.Mockito.mock; |
35 |
| -import static org.mockito.Mockito.when; |
36 | 31 |
|
37 | 32 | class ReconcilerUtilsTest {
|
38 | 33 |
|
@@ -121,13 +116,10 @@ private Deployment createTestDeployment() {
|
121 | 116 |
|
122 | 117 | @Test
|
123 | 118 | void handleKubernetesExceptionShouldThrowMissingCRDExceptionWhenAppropriate() {
|
124 |
| - var request = mock(HttpRequest.class); |
125 |
| - when(request.uri()).thenReturn(URI |
126 |
| - .create(RESOURCE_URI)); |
127 | 119 | assertThrows(MissingCRDException.class, () -> handleKubernetesClientException(
|
128 | 120 | new KubernetesClientException(
|
129 |
| - "Failure executing: GET at: " + RESOURCE_URI + ". Message: Not Found.", |
130 |
| - null, 404, null, request), |
| 121 | + "Failure executing: GET at: https://kubernetes.docker.internal:6443/apis/tomcatoperator.io/v1/tomcats. Message: Not Found.", |
| 122 | + 404, null), |
131 | 123 | HasMetadata.getFullResourceName(Tomcat.class)));
|
132 | 124 | }
|
133 | 125 |
|
|
0 commit comments