16
16
17
17
package org .cloudfoundry .routing .v1 ;
18
18
19
-
20
- import static org .cloudfoundry .util .DelayUtils .exponentialBackOff ;
21
19
import java .time .Duration ;
22
- import java .util .List ;
23
-
24
20
import org .cloudfoundry .AbstractIntegrationTest ;
25
21
import org .cloudfoundry .NameFactory ;
26
22
import org .cloudfoundry .routing .RoutingClient ;
36
32
import org .cloudfoundry .routing .v1 .tcproutes .TcpRoute ;
37
33
import org .cloudfoundry .routing .v1 .tcproutes .TcpRouteConfiguration ;
38
34
import org .cloudfoundry .routing .v1 .tcproutes .TcpRouteDeletion ;
39
- import org .cloudfoundry .routing .v1 .tcproutes .TcpRoutes ;
40
35
import org .junit .jupiter .api .Test ;
41
36
import org .springframework .beans .factory .annotation .Autowired ;
42
-
43
37
import reactor .core .publisher .Flux ;
44
38
import reactor .core .publisher .Mono ;
45
39
import reactor .test .StepVerifier ;
@@ -103,7 +97,7 @@ public void delete() {
103
97
port ,
104
98
routerGroupId ))
105
99
.flatMap (
106
- routerGroupId ->
100
+ routerGroupId ->
107
101
this .routingClient
108
102
.tcpRoutes ()
109
103
.delete (
@@ -116,19 +110,26 @@ public void delete() {
116
110
.routerGroupId (
117
111
routerGroupId )
118
112
.build ())
119
- .build ())
120
- )
121
- .thenMany (requestListTcpRoutes (this .routingClient )
122
- .flatMapIterable (ListTcpRoutesResponse ::getTcpRoutes )
123
- .filter (route -> backendIp .equals (route .getBackendIp ()))
124
- .filter (route -> backendPort .equals (route .getBackendPort ()))
125
- .filter (route -> port .equals (route .getPort ()))
126
- .flatMap (e -> !"" .equals (e .getBackendIp ()) ?
127
- Flux .error (new RuntimeException ("route still found" )) :
128
- Flux .just (e )
129
- )
130
- .retryWhen (Retry .indefinitely ().filter (e -> "route still found" .equals (e .getMessage ())))
131
- )
113
+ .build ()))
114
+ .thenMany (
115
+ requestListTcpRoutes (this .routingClient )
116
+ .flatMapIterable (ListTcpRoutesResponse ::getTcpRoutes )
117
+ .filter (route -> backendIp .equals (route .getBackendIp ()))
118
+ .filter (route -> backendPort .equals (route .getBackendPort ()))
119
+ .filter (route -> port .equals (route .getPort ()))
120
+ .flatMap (
121
+ e ->
122
+ !"" .equals (e .getBackendIp ())
123
+ ? Flux .error (
124
+ new RuntimeException (
125
+ "route still found" ))
126
+ : Flux .just (e ))
127
+ .retryWhen (
128
+ Retry .indefinitely ()
129
+ .filter (
130
+ e ->
131
+ "route still found"
132
+ .equals (e .getMessage ()))))
132
133
.as (StepVerifier ::create )
133
134
.expectComplete ()
134
135
.verify (Duration .ofMinutes (5 ));
0 commit comments