DATAREST-1386 - Tweak redirect setup for HAL explorer.

We now prepare the redirect to the HAL explorer as it expects it.
This commit is contained in:
Oliver Drotbohm
2019-06-05 23:34:06 +02:00
parent 71728be3ba
commit 0401a5924d
3 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ class HalExplorer {
}
builder.path(INDEX);
builder.fragment(explorerRelative ? path.substring(0, path.lastIndexOf(EXPLORER)) : path);
builder.fragment(String.format("uri=%s", explorerRelative ? path.substring(0, path.lastIndexOf(EXPLORER)) : path));
return new RedirectView(builder.build().toUriString());
}

View File

@@ -54,7 +54,7 @@ public class HalExplorerIntegrationTests {
static final String BASE_PATH = "/api";
static final String EXPLORER_INDEX = "/explorer/index.html";
static final String TARGET = BASE_PATH.concat(EXPLORER_INDEX).concat("#").concat(BASE_PATH);
static final String TARGET = BASE_PATH.concat(EXPLORER_INDEX).concat("#uri=").concat(BASE_PATH);
@Configuration
@EnableWebMvc

View File

@@ -62,7 +62,7 @@ public class HalExplorerUnitTests {
UriComponents components = UriComponentsBuilder.fromUriString(response.getHeader(HttpHeaders.LOCATION)).build();
assertThat(components.getPath(), startsWith("/context"));
assertThat(components.getFragment()).isEqualTo("/context");
assertThat(components.getFragment()).isEqualTo("uri=/context");
}
@Test // DATAREST-1264