Cleanup Code Style Issues
Cleanup Code Style Issues
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ class DelegatingTestExecutionListener
|
||||
|
||||
private final TestExecutionListener delegate;
|
||||
|
||||
public DelegatingTestExecutionListener(TestExecutionListener delegate) {
|
||||
DelegatingTestExecutionListener(TestExecutionListener delegate) {
|
||||
Assert.notNull(delegate, "delegate cannot be null");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ final class WithUserDetailsSecurityContextFactory implements
|
||||
private BeanFactory beans;
|
||||
|
||||
@Autowired
|
||||
public WithUserDetailsSecurityContextFactory(BeanFactory beans) {
|
||||
WithUserDetailsSecurityContextFactory(BeanFactory beans) {
|
||||
this.beans = beans;
|
||||
}
|
||||
|
||||
|
||||
+4
-14
@@ -17,7 +17,7 @@ package org.springframework.security.test.web.servlet.request;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
@@ -638,12 +638,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
}
|
||||
|
||||
private static String md5Hex(String a2) {
|
||||
try {
|
||||
return DigestUtils.md5DigestAsHex(a2.getBytes("UTF-8"));
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return DigestUtils.md5DigestAsHex(a2.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,7 +826,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
implements RequestPostProcessor {
|
||||
private final RequestPostProcessor delegate;
|
||||
|
||||
public UserDetailsRequestPostProcessor(UserDetails user) {
|
||||
UserDetailsRequestPostProcessor(UserDetails user) {
|
||||
Authentication token = new UsernamePasswordAuthenticationToken(user,
|
||||
user.getPassword(), user.getAuthorities());
|
||||
|
||||
@@ -985,12 +980,7 @@ public final class SecurityMockMvcRequestPostProcessors {
|
||||
|
||||
private HttpBasicRequestPostProcessor(String username, String password) {
|
||||
byte[] toEncode;
|
||||
try {
|
||||
toEncode = (username + ":" + password).getBytes("UTF-8");
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
toEncode = (username + ":" + password).getBytes(StandardCharsets.UTF_8);
|
||||
this.headerValue = "Basic " + new String(Base64.getEncoder().encode(toEncode));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user