Skip to content

Commit

Permalink
chore: fix ci integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mamin11 committed Nov 21, 2024
1 parent 29acd23 commit 8f69bb0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public CoreV1Api coreV1Api() throws IOException {
// Validate the kubeconfig file exists
if (!new java.io.File(kubeConfigPath).exists()) {
log.error("Kubeconfig file not found at {}. Exiting.", kubeConfigPath);
System.exit(1);
throw new IllegalStateException("Kubeconfig file not found at " + kubeConfigPath);
}

apiClient = Config.fromConfig(kubeConfigPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
package mamin.k8s.watcher;

import io.kubernetes.client.openapi.apis.CoreV1Api;
import mamin.k8s.watcher.event.service.EventWatcherService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;

@SpringBootTest
@ExtendWith(MockitoExtension.class)
class KubernetesWatcherApplicationTests {
@MockBean
private CoreV1Api coreV1Api;
@MockBean
private EventWatcherService eventWatcherService;

@Test
void contextLoads() {
Mockito.doNothing().when(eventWatcherService).watchEvents();
}

}

0 comments on commit 8f69bb0

Please sign in to comment.