use of io.fabric8.kubernetes.api.model.DoneableEndpoints in project strimzi by strimzi.
the class MockKube method build.
public KubernetesClient build() {
KubernetesClient mockClient = mock(KubernetesClient.class);
MixedOperation<ConfigMap, ConfigMapList, DoneableConfigMap, Resource<ConfigMap, DoneableConfigMap>> mockCms = buildConfigMaps();
MixedOperation<PersistentVolumeClaim, PersistentVolumeClaimList, DoneablePersistentVolumeClaim, Resource<PersistentVolumeClaim, DoneablePersistentVolumeClaim>> mockPvcs = buildPvcs();
MixedOperation<Endpoints, EndpointsList, DoneableEndpoints, Resource<Endpoints, DoneableEndpoints>> mockEndpoints = buildEndpoints();
MixedOperation<Service, ServiceList, DoneableService, Resource<Service, DoneableService>> mockSvc = buildServices();
MixedOperation<Pod, PodList, DoneablePod, PodResource<Pod, DoneablePod>> mockPods = buildPods();
MixedOperation<StatefulSet, StatefulSetList, DoneableStatefulSet, RollableScalableResource<StatefulSet, DoneableStatefulSet>> mockSs = buildStatefulSets(mockPods);
MixedOperation<Deployment, DeploymentList, DoneableDeployment, ScalableResource<Deployment, DoneableDeployment>> mockDep = buildDeployments();
when(mockClient.configMaps()).thenReturn(mockCms);
when(mockClient.services()).thenReturn(mockSvc);
AppsAPIGroupDSL api = mock(AppsAPIGroupDSL.class);
when(api.statefulSets()).thenReturn(mockSs);
when(mockClient.apps()).thenReturn(api);
ExtensionsAPIGroupDSL ext = mock(ExtensionsAPIGroupDSL.class);
when(mockClient.extensions()).thenReturn(ext);
when(ext.deployments()).thenReturn(mockDep);
when(mockClient.pods()).thenReturn(mockPods);
when(mockClient.endpoints()).thenReturn(mockEndpoints);
when(mockClient.persistentVolumeClaims()).thenReturn(mockPvcs);
return mockClient;
}
Aggregations