Merge branch '6.2.x'

This commit is contained in:
Marcus Hert Da Coregio
2024-01-17 12:03:17 -03:00
38 changed files with 205 additions and 119 deletions

View File

@@ -114,7 +114,8 @@ public class MockWebServerPropertySource extends PropertySource<MockWebServer> i
private static MockResponse response(String body, int status) {
return new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.setResponseCode(status).setBody(body);
.setResponseCode(status)
.setBody(body);
}
}

View File

@@ -114,7 +114,8 @@ public class MockWebServerPropertySource extends PropertySource<MockWebServer> i
private static MockResponse response(String body, int status) {
return new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.setResponseCode(status).setBody(body);
.setResponseCode(status)
.setBody(body);
}
}

View File

@@ -87,9 +87,10 @@ public class OAuth2ResourceServerControllerTests {
@Test
void messageCanNotBeCreatedWithScopeMessageReadAuthority() throws Exception {
this.mvc.perform(post("/message").content("Hello message")
this.mvc
.perform(post("/message").content("Hello message")
.with(opaqueToken().authorities(new SimpleGrantedAuthority("SCOPE_message:read"))))
.andExpect(status().isForbidden());
.andExpect(status().isForbidden());
}
@Test