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:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user