use of io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher in project kubernetes-client by fabric8io.
the class CustomResourceCrud1109Test method test1109GetList.
@Test
@DisplayName("Get CR list, with CR created through KubernetesCrudDispatcher, should perform GET to crd list with dashed plural")
void test1109GetList() {
// Given
final FooBar fb1 = new FooBar();
fb1.getMetadata().setName("example");
fooBarClient.inNamespace("default").create(fb1);
// When
final KubernetesResourceList<FooBar> fooBarList = fooBarClient.inNamespace("default").list();
// Then
assertThat(fooBarList).isNotNull().extracting(KubernetesResourceList::getItems).asList().hasSize(1);
}
use of io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher in project kubernetes-client by fabric8io.
the class CustomResourceCrud1109Test method test1109GetSingleResource.
@Test
@DisplayName("Get single CR resource, with CR created through KubernetesCrudDispatcher, should perform GET to crd list with dashed plural")
void test1109GetSingleResource() {
// Given
final FooBar fb1 = new FooBar();
fb1.getMetadata().setName("example");
fooBarClient.inNamespace("default").create(fb1);
// When
final FooBar fooBar = fooBarClient.inNamespace("default").withName("example").get();
// Then
assertThat(fooBar).isNotNull().hasFieldOrPropertyWithValue("metadata.name", "example").hasFieldOrPropertyWithValue("kind", "FooBar").isNotSameAs(fb1);
}
use of io.fabric8.kubernetes.client.server.mock.KubernetesCrudDispatcher in project kas-fleetshard by bf2fc6cc711aee1a0c2a.
the class IngressControllerManagerTest method cleanup.
@BeforeEach
@AfterEach
void cleanup() {
// clears the mock server state
// won't be needed after quarkus fixes issues with WithKubernetesTestServer
kubernetesServer.getMockServer().setDispatcher(new KubernetesCrudDispatcher());
ingressControllerManager.getRouteMatchLabels().clear();
}
Aggregations