Search in sources :

Example 1 with SharedInformerFactoryImpl

use of io.fabric8.kubernetes.client.informers.impl.SharedInformerFactoryImpl in project kubernetes-client by fabric8io.

the class SharedInformerFactoryImplTest method testSharedIndexInformerForCustomResourceNoType.

@Test
void testSharedIndexInformerForCustomResourceNoType() {
    // Given
    SharedInformerFactory sharedInformerFactory = new SharedInformerFactoryImpl(mockBaseClient, executorService);
    CustomResourceDefinitionContext context = new CustomResourceDefinitionContext.Builder().withKind("Dummy").withScope("Namespaced").withVersion("v1").withGroup("demos.fabric8.io").withPlural("dummies").build();
    // When
    SharedIndexInformer<GenericKubernetesResource> informer = sharedInformerFactory.inNamespace("ns1").sharedIndexInformerForCustomResource(context, 10 * 1000L);
    // Then
    assertThat(informer).isNotNull();
}
Also used : CustomResourceDefinitionContext(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext) SharedInformerFactoryImpl(io.fabric8.kubernetes.client.informers.impl.SharedInformerFactoryImpl) GenericKubernetesResource(io.fabric8.kubernetes.api.model.GenericKubernetesResource) Test(org.junit.jupiter.api.Test)

Aggregations

GenericKubernetesResource (io.fabric8.kubernetes.api.model.GenericKubernetesResource)1 CustomResourceDefinitionContext (io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext)1 SharedInformerFactoryImpl (io.fabric8.kubernetes.client.informers.impl.SharedInformerFactoryImpl)1 Test (org.junit.jupiter.api.Test)1