Disable hypermedia in actuator endpoints by default
This change permanently removes links from the endpoints that return arrays or collections, and also disables them in the rest of the endpoints (except /actuator) by default. Fixes gh-4616
This commit is contained in:
@@ -37,7 +37,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(SampleHypermediaGsonApplication.class)
|
||||
@WebAppConfiguration
|
||||
@TestPropertySource(properties = "endpoints.health.sensitive: false")
|
||||
@TestPropertySource(properties = "endpoints.hypermedia.enabled: true")
|
||||
public class SampleHypermediaGsonApplicationTests {
|
||||
|
||||
@Autowired
|
||||
@@ -61,9 +61,8 @@ public class SampleHypermediaGsonApplicationTests {
|
||||
@Test
|
||||
public void trace() throws Exception {
|
||||
this.mockMvc.perform(get("/trace").accept(MediaType.APPLICATION_JSON))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$.links[0].href").value("http://localhost/trace"))
|
||||
.andExpect(jsonPath("$.content").isArray());
|
||||
.andExpect(status().isOk()).andExpect(jsonPath("$.links").doesNotExist())
|
||||
.andExpect(jsonPath("$").isArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user