Search in sources :

Example 1 with CustomResourceDefinitionListBuilder

use of io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionListBuilder in project kubernetes-client by fabric8io.

the class CustomResourceTest method testListWithFields.

@Test
void testListWithFields() {
    final CustomResourceDefinitionList customResourceDefinitionList = new CustomResourceDefinitionListBuilder().addNewItem().and().addNewItem().and().build();
    server.expect().get().withPath("/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions?fieldSelector=" + Utils.toUrlEncoded("key1=value1,key2=value2,key3!=value3,key3!=value4")).andReturn(HttpURLConnection.HTTP_CREATED, customResourceDefinitionList).once();
    CustomResourceDefinitionList list = client.apiextensions().v1beta1().customResourceDefinitions().withField("key1", "value1").withField("key2", "value2").withoutField("key3", "value3").withoutField("key3", "value4").list();
    List<CustomResourceDefinition> items = list.getItems();
    assertNotNull(items);
    assertEquals(2, items.size());
}
Also used : CustomResourceDefinitionList(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList) CustomResourceDefinitionListBuilder(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionListBuilder) CustomResourceDefinition(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition) Test(org.junit.jupiter.api.Test)

Aggregations

CustomResourceDefinition (io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition)1 CustomResourceDefinitionList (io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionList)1 CustomResourceDefinitionListBuilder (io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinitionListBuilder)1 Test (org.junit.jupiter.api.Test)1