Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit

Permalink
BC-7232 - test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 authored May 14, 2024
1 parent 06decaa commit 895663a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-kubernetes-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-kubernetes-client</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
34 changes: 34 additions & 0 deletions src/test/java/de/svs/doido/mongo/NamespacesTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package svs.doido.mongo;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;

@WithKubernetesTestServer
@QuarkusTest
class NamespacesTest {

@KubernetesTestServer
KubernetesServer mockServer;
@Inject
KubernetesClient client;

@BeforeEach
public void before() {
final Pod pod1 = new PodBuilder().withNewMetadata().withName("pod1").withNamespace("test").and().build();
final Pod pod2 = new PodBuilder().withNewMetadata().withName("pod2").withNamespace("test").and().build();

// Set up Kubernetes so that our "pretend" pods are created
client.pods().resource(pod1).create();
client.pods().resource(pod2).create();
}

@Test
public void testInteractionWithAPIServer() {
RestAssured.when().get("/pod/test").then()
.body("size()", is(2));
}

}

0 comments on commit 895663a

Please sign in to comment.