Fix new line after @Test (#2486)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-06-20 17:42:55 +03:00
committed by GitHub
parent cb7f1107fe
commit ef25aa59f0
152 changed files with 2948 additions and 1474 deletions

View File

@@ -29,7 +29,8 @@ class AllowedHostNamesTest extends AbstractSecurityTest {
/**
* Tests whether a RequestRejectedException is thrown when not allowed host is used
*/
@Test void allowedHostNameWithNotAllowedHost() throws Exception {
@Test
void allowedHostNameWithNotAllowedHost() throws Exception {
mvc.perform(get("/").header(HttpHeaders.HOST, "www.google.com"))
.andExpect(status().isBadRequest());
}
@@ -37,7 +38,8 @@ class AllowedHostNamesTest extends AbstractSecurityTest {
/**
* Tests whether request is redirected when allowed host is used
*/
@Test void allowedHostNameWithAllowedHost() throws Exception {
@Test
void allowedHostNameWithAllowedHost() throws Exception {
mvc.perform(get("/").header(HttpHeaders.HOST, "localhost"))
.andExpect(status().is3xxRedirection());
}
@@ -45,7 +47,8 @@ class AllowedHostNamesTest extends AbstractSecurityTest {
/**
* Tests whether request without allowed host name and with ignored path end up with a client error
*/
@Test void notAllowedHostnameWithIgnoredPath() throws Exception {
@Test
void notAllowedHostnameWithIgnoredPath() throws Exception {
mvc.perform(get("/index.html").header(HttpHeaders.HOST, "www.google.com"))
.andExpect(status().is4xxClientError());
}

View File

@@ -28,7 +28,8 @@ class PreAuthorizeEnabledTest extends AbstractSecurityTest {
/**
* Tests whether request fail if a role is forbidden for the user
*/
@Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false)
@Test
@WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false)
void failIfNoRole() throws Exception {
mvc.perform(get("/DEFAULT/controller/v1/controllerId"))
.andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.FORBIDDEN.value()));
@@ -37,7 +38,8 @@ class PreAuthorizeEnabledTest extends AbstractSecurityTest {
/**
* Tests whether request succeed if a role is granted for the user
*/
@Test @WithUser(authorities = { SpPermission.SpringEvalExpressions.CONTROLLER_ROLE }, autoCreateTenant = false)
@Test
@WithUser(authorities = { SpPermission.SpringEvalExpressions.CONTROLLER_ROLE }, autoCreateTenant = false)
void successIfHasRole() throws Exception {
mvc.perform(get("/DEFAULT/controller/v1/controllerId"))
.andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value()));