-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
@WithKubernetesTestServer
meta-annotation
- Loading branch information
Showing
3 changed files
with
44 additions
and
36 deletions.
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
35 changes: 35 additions & 0 deletions
35
...etes-client/src/main/java/io/quarkus/test/kubernetes/client/WithKubernetesTestServer.java
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,35 @@ | ||
package io.quarkus.test.kubernetes.client; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import io.fabric8.kubernetes.client.server.mock.KubernetesServer; | ||
import io.quarkus.test.common.QuarkusTestResource; | ||
|
||
/** | ||
* Use on your test resource to get a mock {@link KubernetesServer} spawn up, and injectable with {@link KubernetesTestServer}. | ||
* This annotation is only active when used on a test class, and only for this test class. | ||
*/ | ||
@QuarkusTestResource(value = KubernetesServerTestResource.class, restrictToAnnotatedTest = true) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface WithKubernetesTestServer { | ||
|
||
/** | ||
* Start it with HTTPS | ||
*/ | ||
boolean https() default false; | ||
|
||
/** | ||
* Start it in CRUD mode | ||
*/ | ||
boolean crud() default true; | ||
|
||
/** | ||
* Port to use, defaults to any available port | ||
*/ | ||
int port() default 0; | ||
|
||
} |