Fix WhitespaceAfterCheck Checkstyle check
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -81,7 +81,7 @@ public class ReactorContextTestExecutionListener
|
||||
@Override
|
||||
public Context currentContext() {
|
||||
Context context = delegate.currentContext();
|
||||
if(context.hasKey(CONTEXT_DEFAULTED_ATTR_NAME)) {
|
||||
if (context.hasKey(CONTEXT_DEFAULTED_ATTR_NAME)) {
|
||||
return context;
|
||||
}
|
||||
context = context.put(CONTEXT_DEFAULTED_ATTR_NAME, Boolean.TRUE);
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,7 +51,7 @@ final class WithMockUserSecurityContextFactory implements
|
||||
grantedAuthorities.add(new SimpleGrantedAuthority(authority));
|
||||
}
|
||||
|
||||
if(grantedAuthorities.isEmpty()) {
|
||||
if (grantedAuthorities.isEmpty()) {
|
||||
for (String role : withUser.roles()) {
|
||||
if (role.startsWith("ROLE_")) {
|
||||
throw new IllegalArgumentException("roles cannot start with ROLE_ Got "
|
||||
@@ -59,7 +59,7 @@ final class WithMockUserSecurityContextFactory implements
|
||||
}
|
||||
grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_" + role));
|
||||
}
|
||||
} else if(!(withUser.roles().length == 1 && "USER".equals(withUser.roles()[0]))) {
|
||||
} else if (!(withUser.roles().length == 1 && "USER".equals(withUser.roles()[0]))) {
|
||||
throw new IllegalStateException("You cannot define roles attribute "+ Arrays.asList(withUser.roles())+" with authorities attribute "+ Arrays.asList(withUser.authorities()));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -84,7 +84,7 @@ public class WithSecurityContextTestExecutionListener
|
||||
@Override
|
||||
public void beforeTestExecution(TestContext testContext) {
|
||||
SecurityContext securityContext = (SecurityContext) testContext.removeAttribute(SECURITY_CONTEXT_ATTR_NAME);
|
||||
if(securityContext != null) {
|
||||
if (securityContext != null) {
|
||||
TestSecurityContextHolder.setContext(securityContext);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ final class WithUserDetailsSecurityContextFactory implements
|
||||
}
|
||||
|
||||
private UserDetailsService findUserDetailsService(String beanName) {
|
||||
if(reactorPresent) {
|
||||
if (reactorPresent) {
|
||||
UserDetailsService reactive = findAndAdaptReactiveUserDetailsService(beanName);
|
||||
if (reactive != null) {
|
||||
return reactive;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -286,7 +286,7 @@ public class SecurityMockServerConfigurers {
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain webFilterChain) {
|
||||
Supplier<Mono<SecurityContext>> context = exchange.getAttribute(ATTRIBUTE_NAME);
|
||||
if(context != null) {
|
||||
if (context != null) {
|
||||
exchange.getAttributes().remove(ATTRIBUTE_NAME);
|
||||
return webFilterChain.filter(exchange)
|
||||
.subscriberContext(ReactiveSecurityContextHolder.withSecurityContext(context.get()));
|
||||
|
||||
Reference in New Issue
Block a user