1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Cleanup Code Style Issues

Cleanup Code Style Issues
This commit is contained in:
Rob Winch
2019-08-12 13:06:49 -05:00
committed by GitHub
172 changed files with 288 additions and 306 deletions
@@ -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;
}
@@ -49,7 +49,7 @@ final class WithUserDetailsSecurityContextFactory implements
private BeanFactory beans;
@Autowired
public WithUserDetailsSecurityContextFactory(BeanFactory beans) {
WithUserDetailsSecurityContextFactory(BeanFactory beans) {
this.beans = beans;
}
@@ -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));
}