use of org.cloudfoundry.client.v2.routemappings.ListRouteMappingsResponse in project promregator by promregator.
the class CFAccessorMock method retrieveRouteMapping.
@Override
public Mono<ListRouteMappingsResponse> retrieveRouteMapping(String appId) {
RouteMappingEntity entity = null;
if (appId.equals(UNITTEST_APP1_UUID)) {
entity = RouteMappingEntity.builder().applicationId(appId).routeId(UNITTEST_APP1_ROUTE_UUID).build();
} else if (appId.equals(UNITTEST_APP2_UUID)) {
entity = RouteMappingEntity.builder().applicationId(appId).routeId(UNITTEST_APP2_ROUTE_UUID).build();
}
if (entity == null) {
Assert.fail("Invalid route mapping request");
return null;
}
RouteMappingResource rmr = null;
rmr = RouteMappingResource.builder().entity(entity).build();
List<RouteMappingResource> list = new LinkedList<>();
list.add(rmr);
ListRouteMappingsResponse resp = ListRouteMappingsResponse.builder().addAllResources(list).build();
return Mono.just(resp);
}
Aggregations