Skip to content

Commit 10b8c0d

Browse files
committed
minor fixes
1 parent 6a00730 commit 10b8c0d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/logcache/v1/_ReactorLogCacheClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.cloudfoundry.logcache.v1.ReadRequest;
2525
import org.cloudfoundry.logcache.v1.ReadResponse;
2626
import org.cloudfoundry.reactor.ConnectionContext;
27-
import org.cloudfoundry.reactor.RootProvider;
2827
import org.cloudfoundry.reactor.TokenProvider;
2928
import org.immutables.value.Value;
3029
import reactor.core.publisher.Mono;
@@ -86,7 +85,7 @@ Mono<String> getRoot() {
8685

8786
private Mono<String> deriveLogCacheUrl() {
8887
return getConnectionContext().getRootProvider().getRoot(getConnectionContext())
89-
.map(root -> root.replace("api", "log-cache"))
88+
.map(root -> root.replaceFirst("://api", "://log-cache"))
9089
.map(URI::create)
9190
.delayUntil(uri -> getConnectionContext().trust(uri.getHost(), uri.getPort()))
9291
.map(URI::toString);

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/logcache/v1/ReactorLogCacheClientTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static org.mockito.Mockito.mock;
2525
import static org.mockito.Mockito.when;
2626

27-
import java.io.IOException;
2827
import java.net.URI;
2928
import java.time.Duration;
3029
import java.util.Collections;
@@ -52,15 +51,16 @@
5251
import reactor.test.StepVerifier;
5352

5453
class ReactorLogCacheClientTest extends AbstractLogCacheApiTest {
55-
private static final String API_ROOT = "http://api.my.rapid.server.com";
56-
private static final String LOGCACHE = "http://log-cache.my.rlog-cached.server.com";
54+
private static final String API_ROOT = "http://api.my.rapid.server.com"; // the ".rAPId." part also contains the string "api".
55+
private static final String LOGCACHE = "http://log-cache.my.rapid.server.com"; // only the "api" at the start of
56+
// the url should be replaced.
5757

5858
private final ReactorLogCacheEndpoints logCacheEndpoints =
5959
new ReactorLogCacheEndpoints(
6060
CONNECTION_CONTEXT, this.root, TOKEN_PROVIDER, Collections.emptyMap());
6161

6262
@Test
63-
void getRootFromFallback() throws IOException {
63+
void getRootFromFallback() {
6464
URI webServerUri = URI.create(this.root.block(Duration.ofSeconds(5)));
6565
Mono<String> apiRoot = Mono.just(API_ROOT);
6666
RootProvider rootProvider = mock(RootProvider.class);
@@ -111,7 +111,7 @@ void getRootFromEndpoint() {
111111
String rootString = logCacheRoot.block(Duration.ofSeconds(5));
112112
assertThat(rootString)
113113
.isEqualTo(
114-
"http://cache-for-logging.cf.lod-cfcli3.cfrt-sof.sapcloud.io:"
114+
"http://cache-for-logging.run.pivotal.io:"
115115
+ webServerUri.getPort());
116116
}
117117

cloudfoundry-client-reactor/src/test/resources/fixtures/GET_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"href": "https://uaa.run.pivotal.io"
2727
},
2828
"log_cache": {
29-
"href": "https://cache-for-logging.cf.lod-cfcli3.cfrt-sof.sapcloud.io"
29+
"href": "https://cache-for-logging.run.pivotal.io"
3030
},
3131
"logging": {
3232
"href": "wss://doppler.run.pivotal.io:443"

0 commit comments

Comments
 (0)