48
48
import org .cloudfoundry .client .v2 .serviceplans .ServicePlanResource ;
49
49
import org .cloudfoundry .client .v2 .services .ListServicesRequest ;
50
50
import org .cloudfoundry .client .v2 .services .ServiceResource ;
51
- import org .cloudfoundry .client .v2 .shareddomains .CreateSharedDomainRequest ;
52
- import org .cloudfoundry .client .v2 .shareddomains .CreateSharedDomainResponse ;
53
51
import org .cloudfoundry .routing .RoutingClient ;
54
- import org .cloudfoundry .routing .v1 .routergroups .ListRouterGroupsRequest ;
55
- import org .cloudfoundry .routing .v1 .routergroups .ListRouterGroupsResponse ;
56
- import org .cloudfoundry .routing .v1 .routergroups .RouterGroup ;
57
52
import org .cloudfoundry .util .JobUtils ;
58
53
import org .cloudfoundry .util .LastOperationUtils ;
59
54
import org .cloudfoundry .util .PaginationUtils ;
@@ -623,41 +618,6 @@ public void listRoutesFilterByPath() {
623
618
.verify (Duration .ofMinutes (5 ));
624
619
}
625
620
626
- @ Test
627
- public void listRoutesFilterByPort () {
628
- String domainName = this .nameFactory .getDomainName ();
629
- Integer port = this .nameFactory .getPort ();
630
- String serviceInstanceName = this .nameFactory .getServiceInstanceName ();
631
-
632
- Mono .zip (this .organizationId , this .spaceId )
633
- .flatMap (function ((organizationId , spaceId ) -> Mono .zip (
634
- getRouterGroupId (this .routingClient , DEFAULT_ROUTER_GROUP )
635
- .flatMap (routerGroupId -> createTcpDomainId (this .cloudFoundryClient , domainName , routerGroupId )),
636
- createServiceInstanceId (this .cloudFoundryClient , this .serviceBrokerId , serviceInstanceName , this .serviceName , spaceId ),
637
- Mono .just (spaceId )
638
- )))
639
- .flatMap (function ((domainId , serviceInstanceId , spaceId ) -> Mono .zip (
640
- createRouteId (this .cloudFoundryClient , domainId , port , spaceId ),
641
- Mono .just (serviceInstanceId ))
642
- ))
643
- .flatMap (function ((routeId , serviceInstanceId ) -> requestBindServiceInstanceRoute (this .cloudFoundryClient , routeId , serviceInstanceId )
644
- .thenReturn (serviceInstanceId )))
645
- .flatMapMany (serviceInstanceId -> Mono .zip (
646
- Mono .just (serviceInstanceId ),
647
- PaginationUtils .requestClientV2Resources (page -> this .cloudFoundryClient .serviceInstances ()
648
- .listRoutes (ListServiceInstanceRoutesRequest .builder ()
649
- .page (page )
650
- .port (port .toString ())
651
- .serviceInstanceId (serviceInstanceId )
652
- .build ()))
653
- .map (resource -> ResourceUtils .getEntity (resource ).getServiceInstanceId ())
654
- .single ()))
655
- .as (StepVerifier ::create )
656
- .consumeNextWith (tupleEquality ())
657
- .expectComplete ()
658
- .verify (Duration .ofMinutes (5 ));
659
- }
660
-
661
621
@ Test
662
622
public void listServiceBindings () {
663
623
String applicationName = this .nameFactory .getApplicationName ();
@@ -825,11 +785,6 @@ private static Mono<String> createRouteId(CloudFoundryClient cloudFoundryClient,
825
785
.map (ResourceUtils ::getId );
826
786
}
827
787
828
- private static Mono <String > createRouteId (CloudFoundryClient cloudFoundryClient , String domainId , Integer port , String spaceId ) {
829
- return requestCreateRoute (cloudFoundryClient , domainId , port , spaceId )
830
- .map (ResourceUtils ::getId );
831
- }
832
-
833
788
private static Mono <String > createServiceBindingId (CloudFoundryClient cloudFoundryClient , String applicationId , String serviceInstanceId ) {
834
789
return requestCreateServiceBinding (cloudFoundryClient , applicationId , serviceInstanceId )
835
790
.map (ResourceUtils ::getId );
@@ -847,11 +802,6 @@ private static Mono<String> createServiceKeyId(CloudFoundryClient cloudFoundryCl
847
802
.map (ResourceUtils ::getId );
848
803
}
849
804
850
- private static Mono <String > createTcpDomainId (CloudFoundryClient cloudFoundryClient , String name , String routerGroupId ) {
851
- return requestCreateTcpDomain (cloudFoundryClient , name , routerGroupId )
852
- .map (ResourceUtils ::getId );
853
- }
854
-
855
805
private static Mono <String > getPlanId (CloudFoundryClient cloudFoundryClient , String serviceBrokerId , String serviceName ) {
856
806
return requestListServices (cloudFoundryClient , serviceBrokerId , serviceName )
857
807
.filter (resource -> serviceName .equals (ResourceUtils .getEntity (resource ).getLabel ()))
@@ -862,14 +812,6 @@ private static Mono<String> getPlanId(CloudFoundryClient cloudFoundryClient, Str
862
812
.map (ResourceUtils ::getId );
863
813
}
864
814
865
- private static Mono <String > getRouterGroupId (RoutingClient routingClient , String routerGroupName ) {
866
- return requestListRouterGroups (routingClient )
867
- .flatMapIterable (ListRouterGroupsResponse ::getRouterGroups )
868
- .filter (group -> routerGroupName .equals (group .getName ()))
869
- .single ()
870
- .map (RouterGroup ::getRouterGroupId );
871
- }
872
-
873
815
private static Mono <BindServiceInstanceRouteResponse > requestBindServiceInstanceRoute (CloudFoundryClient cloudFoundryClient , String routeId , String serviceInstanceId ) {
874
816
return cloudFoundryClient .serviceInstances ()
875
817
.bindRoute (BindServiceInstanceRouteRequest .builder ()
@@ -894,15 +836,6 @@ private static Mono<CreatePrivateDomainResponse> requestCreatePrivateDomain(Clou
894
836
.build ());
895
837
}
896
838
897
- private static Mono <CreateRouteResponse > requestCreateRoute (CloudFoundryClient cloudFoundryClient , String domainId , Integer port , String spaceId ) {
898
- return cloudFoundryClient .routes ()
899
- .create (CreateRouteRequest .builder ()
900
- .domainId (domainId )
901
- .port (port )
902
- .spaceId (spaceId )
903
- .build ());
904
- }
905
-
906
839
private static Mono <CreateRouteResponse > requestCreateRoute (CloudFoundryClient cloudFoundryClient , String domainId , String hostName , String path , String spaceId ) {
907
840
return cloudFoundryClient .routes ()
908
841
.create (CreateRouteRequest .builder ()
@@ -939,20 +872,6 @@ private static Mono<CreateServiceKeyResponse> requestCreateServiceKey(CloudFound
939
872
.build ());
940
873
}
941
874
942
- private static Mono <CreateSharedDomainResponse > requestCreateTcpDomain (CloudFoundryClient cloudFoundryClient , String name , String routerGroupId ) {
943
- return cloudFoundryClient .sharedDomains ()
944
- .create (CreateSharedDomainRequest .builder ()
945
- .name (name )
946
- .routerGroupId (routerGroupId )
947
- .build ());
948
- }
949
-
950
- private static Mono <ListRouterGroupsResponse > requestListRouterGroups (RoutingClient routingClient ) {
951
- return routingClient .routerGroups ()
952
- .list (ListRouterGroupsRequest .builder ()
953
- .build ());
954
- }
955
-
956
875
private static Flux <RouteResource > requestListRoutes (CloudFoundryClient cloudFoundryClient , String serviceInstanceId ) {
957
876
return PaginationUtils
958
877
.requestClientV2Resources (page -> cloudFoundryClient .serviceInstances ()
0 commit comments