This repository was archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
|
||
} |