use of org.cloudfoundry.client.v3.processes.HealthCheck in project promregator by promregator.
the class CFAccessorMock method retrieveProcesses.
@Override
public Mono<ListProcessesResponse> retrieveProcesses(String orgId, String spaceId, String appId) {
if (orgId.equals(UNITTEST_ORG_UUID) && spaceId.equals(UNITTEST_SPACE_UUID)) {
List<ProcessResource> list = new LinkedList<>();
Data data = Data.builder().timeout(100).build();
HealthCheck hc = HealthCheck.builder().type(HealthCheckType.HTTP).data(data).build();
Builder builder = ProcessResource.builder().type("dummy").command("dummycommand").memoryInMb(1024).diskInMb(1024).healthCheck(hc).createdAt(CREATED_AT_TIMESTAMP).updatedAt(UPDATED_AT_TIMESTAMP);
ProcessResource ar = null;
if (appId.equals(UNITTEST_APP1_UUID)) {
ar = builder.instances(2).id(UNITTEST_APP1_UUID).build();
} else if (appId.equals(UNITTEST_APP2_UUID)) {
ar = builder.instances(1).id(UNITTEST_APP2_UUID).build();
}
if (ar == null) {
Assert.fail("Invalid process request, invalid app id provided");
return null;
}
list.add(ar);
ListProcessesResponse resp = ListProcessesResponse.builder().addAllResources(list).build();
return Mono.just(resp);
}
Assert.fail("Invalid process request");
return null;
}
Aggregations