Search in sources :

Example 1 with RouteMappingEntity

use of org.cloudfoundry.client.v2.routemappings.RouteMappingEntity 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);
}
Also used : RouteMappingEntity(org.cloudfoundry.client.v2.routemappings.RouteMappingEntity) RouteMappingResource(org.cloudfoundry.client.v2.routemappings.RouteMappingResource) LinkedList(java.util.LinkedList) ListRouteMappingsResponse(org.cloudfoundry.client.v2.routemappings.ListRouteMappingsResponse)

Aggregations

LinkedList (java.util.LinkedList)1 ListRouteMappingsResponse (org.cloudfoundry.client.v2.routemappings.ListRouteMappingsResponse)1 RouteMappingEntity (org.cloudfoundry.client.v2.routemappings.RouteMappingEntity)1 RouteMappingResource (org.cloudfoundry.client.v2.routemappings.RouteMappingResource)1