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());
}
Aggregations