Skip to content

Commit aca921f

Browse files
committed
fix: make kubernetes CredentialsSecretConfiguratorTest Mockito 5 compatible
Avoid spying on the Fabric8 mock-server client (it is already a mock) and refresh the license header to satisfy license checks. Signed-off-by: Oleksii Orel <oorel@redhat.com>
1 parent a32d114 commit aca921f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/configurator/CredentialsSecretConfiguratorTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2025 Red Hat, Inc.
2+
* Copyright (c) 2012-2026 Red Hat, Inc.
33
* This program and the accompanying materials are made
44
* available under the terms of the Eclipse Public License 2.0
55
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -15,7 +15,6 @@
1515
import static org.mockito.ArgumentMatchers.eq;
1616
import static org.mockito.Mockito.doThrow;
1717
import static org.mockito.Mockito.never;
18-
import static org.mockito.Mockito.spy;
1918
import static org.mockito.Mockito.verify;
2019
import static org.mockito.Mockito.when;
2120
import static org.testng.Assert.assertEquals;
@@ -84,10 +83,8 @@ public void setUp() throws InfrastructureException {
8483
new KubernetesMixedDispatcher(responses),
8584
true);
8685
kubernetesMockServer.init();
87-
kubernetesClient = spy(kubernetesMockServer.createClient());
88-
89-
KubernetesClient client = spy(kubernetesClient);
90-
when(cheServerKubernetesClientFactory.create()).thenReturn(client);
86+
kubernetesClient = kubernetesMockServer.createClient();
87+
when(cheServerKubernetesClientFactory.create()).thenReturn(kubernetesClient);
9188

9289
namespaceResolutionContext =
9390
new NamespaceResolutionContext(TEST_WORKSPACE_ID, TEST_USER_ID, TEST_USERNAME);

0 commit comments

Comments
 (0)