refactor: 💡 Code inspection by IDEA

pull/1580/head
Dominik Frantisek Bucik 2021-11-15 10:10:46 +01:00
parent 1056d6acdc
commit 2b94aff58e
No known key found for this signature in database
GPG Key ID: 25014C8DB2E7E62D
64 changed files with 216 additions and 274 deletions

View File

@ -48,10 +48,10 @@ import org.springframework.util.StringUtils;
@Slf4j
public class ClientKeyCacheService {
private JWKSetCacheService jwksUriCache;
private SymmetricKeyJWTValidatorCacheService symmetricCache;
private LoadingCache<JWKSet, JWTSigningAndValidationService> jwksValidators;
private LoadingCache<JWKSet, JWTEncryptionAndDecryptionService> jwksEncrypters;
private final JWKSetCacheService jwksUriCache;
private final SymmetricKeyJWTValidatorCacheService symmetricCache;
private final LoadingCache<JWKSet, JWTSigningAndValidationService> jwksValidators;
private final LoadingCache<JWKSet, JWTEncryptionAndDecryptionService> jwksEncrypters;
@Autowired
public ClientKeyCacheService(JWKSetCacheService jwksUriCache, SymmetricKeyJWTValidatorCacheService symmetricCache) {

View File

@ -28,7 +28,7 @@ import org.springframework.util.StringUtils;
@Converter
public class JsonElementStringConverter implements AttributeConverter<JsonElement, String> {
private JsonParser parser = new JsonParser();
private final JsonParser parser = new JsonParser();
@Override
public String convertToDatabaseColumn(JsonElement attribute) {

View File

@ -24,21 +24,21 @@ import org.springframework.security.oauth2.provider.ClientDetailsService;
public interface ClientDetailsEntityService extends ClientDetailsService {
public ClientDetailsEntity saveNewClient(ClientDetailsEntity client);
ClientDetailsEntity saveNewClient(ClientDetailsEntity client);
public ClientDetailsEntity getClientById(Long id);
ClientDetailsEntity getClientById(Long id);
@Override
public ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception;
ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception;
public void deleteClient(ClientDetailsEntity client);
void deleteClient(ClientDetailsEntity client);
public ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient);
ClientDetailsEntity updateClient(ClientDetailsEntity oldClient, ClientDetailsEntity newClient);
public Collection<ClientDetailsEntity> getAllClients();
Collection<ClientDetailsEntity> getAllClients();
public ClientDetailsEntity generateClientId(ClientDetailsEntity client);
ClientDetailsEntity generateClientId(ClientDetailsEntity client);
public ClientDetailsEntity generateClientSecret(ClientDetailsEntity client);
ClientDetailsEntity generateClientSecret(ClientDetailsEntity client);
}

View File

@ -38,7 +38,7 @@ import org.springframework.stereotype.Service;
@Service("clientUserDetailsService")
public class DefaultClientUserDetailsService implements UserDetailsService {
private static GrantedAuthority ROLE_CLIENT = new SimpleGrantedAuthority("ROLE_CLIENT");
private static final GrantedAuthority ROLE_CLIENT = new SimpleGrantedAuthority("ROLE_CLIENT");
private ClientDetailsEntityService clientDetailsService;
private final ConfigurationPropertiesBean config;

View File

@ -44,7 +44,7 @@ public class DefaultDeviceCodeService implements DeviceCodeService {
@Autowired
private DeviceCodeRepository repository;
private RandomValueStringGenerator randomGenerator = new RandomValueStringGenerator();
private final RandomValueStringGenerator randomGenerator = new RandomValueStringGenerator();
/* (non-Javadoc)
* @see cz.muni.ics.oauth2.service.DeviceCodeService#save(cz.muni.ics.oauth2.model.DeviceCode)

View File

@ -54,7 +54,7 @@ public class DefaultOAuth2AuthorizationCodeService implements AuthorizationCodeS
private int authCodeExpirationSeconds = 60 * 5; // expire in 5 minutes by default
private RandomValueStringGenerator generator = new RandomValueStringGenerator(22);
private final RandomValueStringGenerator generator = new RandomValueStringGenerator(22);
/**
* Generate a random authorization code and create an AuthorizationCodeEntity,

View File

@ -90,7 +90,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
private ConfigurationPropertiesBean config;
// map of sector URI -> list of redirect URIs
private LoadingCache<String, List<String>> sectorRedirects = CacheBuilder.newBuilder()
private final LoadingCache<String, List<String>> sectorRedirects = CacheBuilder.newBuilder()
.expireAfterAccess(1, TimeUnit.HOURS)
.maximumSize(100)
.build(new SectorIdentifierLoader(HttpClientBuilder.create().useSystemProperties().build()));
@ -318,7 +318,7 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
* Get the client for the given ClientID
*/
@Override
public ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception, InvalidClientException, IllegalArgumentException {
public ClientDetailsEntity loadClientByClientId(String clientId) throws OAuth2Exception, IllegalArgumentException {
if (!Strings.isNullOrEmpty(clientId)) {
ClientDetailsEntity client = clientRepository.getClientByClientId(clientId);
if (client == null) {
@ -446,9 +446,9 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
*
*/
private class SectorIdentifierLoader extends CacheLoader<String, List<String>> {
private HttpComponentsClientHttpRequestFactory httpFactory;
private RestTemplate restTemplate;
private JsonParser parser = new JsonParser();
private final HttpComponentsClientHttpRequestFactory httpFactory;
private final RestTemplate restTemplate;
private final JsonParser parser = new JsonParser();
SectorIdentifierLoader(HttpClient httpClient) {
this.httpFactory = new HttpComponentsClientHttpRequestFactory(httpClient);

View File

@ -44,28 +44,28 @@ public class DefaultSystemScopeService implements SystemScopeService {
@Autowired
private SystemScopeRepository repository;
private Predicate<SystemScope> isDefault = new Predicate<SystemScope>() {
private final Predicate<SystemScope> isDefault = new Predicate<SystemScope>() {
@Override
public boolean apply(SystemScope input) {
return (input != null && input.isDefaultScope());
}
};
private Predicate<SystemScope> isRestricted = new Predicate<SystemScope>() {
private final Predicate<SystemScope> isRestricted = new Predicate<SystemScope>() {
@Override
public boolean apply(SystemScope input) {
return (input != null && input.isRestricted());
}
};
private Predicate<SystemScope> isReserved = new Predicate<SystemScope>() {
private final Predicate<SystemScope> isReserved = new Predicate<SystemScope>() {
@Override
public boolean apply(SystemScope input) {
return (input != null && getReserved().contains(input));
}
};
private Function<String, SystemScope> stringToSystemScope = new Function<String, SystemScope>() {
private final Function<String, SystemScope> stringToSystemScope = new Function<String, SystemScope>() {
@Override
public SystemScope apply(String input) {
if (Strings.isNullOrEmpty(input)) {
@ -83,7 +83,7 @@ public class DefaultSystemScopeService implements SystemScopeService {
}
};
private Function<SystemScope, String> systemScopeToString = new Function<SystemScope, String>() {
private final Function<SystemScope, String> systemScopeToString = new Function<SystemScope, String>() {
@Override
public String apply(SystemScope input) {
if (input == null) {

View File

@ -40,7 +40,7 @@ import org.springframework.web.util.UriUtils;
@Service("uriEncodedClientUserDetailsService")
public class UriEncodedClientUserDetailsService implements UserDetailsService {
private static GrantedAuthority ROLE_CLIENT = new SimpleGrantedAuthority("ROLE_CLIENT");
private static final GrantedAuthority ROLE_CLIENT = new SimpleGrantedAuthority("ROLE_CLIENT");
private ClientDetailsEntityService clientDetailsService;
private final ConfigurationPropertiesBean config;

View File

@ -47,7 +47,7 @@ public class ChainedTokenGranter extends AbstractTokenGranter {
public static final String GRANT_TYPE = "urn:ietf:params:oauth:grant_type:redelegate";
// keep down-cast versions so we can get to the right queries
private OAuth2TokenEntityService tokenServices;
private final OAuth2TokenEntityService tokenServices;
/**
* @param tokenServices

View File

@ -46,7 +46,7 @@ public class TokenApiView extends AbstractView {
public static final String VIEWNAME = "tokenApiView";
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
@ -57,10 +57,7 @@ public class TokenApiView extends AbstractView {
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
})

View File

@ -127,7 +127,7 @@ public class OAuthConfirmationController {
uriBuilder.addParameter("state", authRequest.getState()); // copy the state parameter if one was given
}
return "redirect:" + uriBuilder.toString();
return "redirect:" + uriBuilder;
} catch (URISyntaxException e) {
log.error("Can't build redirect URI for prompt=none, sending error instead", e);

View File

@ -55,7 +55,7 @@ public class ScopeAPI {
@Autowired
private SystemScopeService scopeService;
private Gson gson = new Gson();
private final Gson gson = new Gson();
@RequestMapping(value = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public String getAll(ModelMap m) {

View File

@ -158,7 +158,7 @@ public abstract class PerunAttributeValueAwareModel {
private InconvertibleValueException inconvertible(String clazzName) {
return new InconvertibleValueException("Cannot convert value of attribute to " + clazzName +
" for object: " + this.toString());
" for object: " + this);
}
}

View File

@ -49,7 +49,7 @@ public class PerunSamlAuthenticationSuccessHandler extends SavedRequestAwareAuth
.map(AuthnContext::getAuthnContextClassRef)
.map(AuthnContextClassRef::getAuthnContextClassRef)
.collect(Collectors.joining());
request.getSession(true).setAttribute(PerunOIDCTokenService.SESSION_PARAM_ACR, acrs);;
request.getSession(true).setAttribute(PerunOIDCTokenService.SESSION_PARAM_ACR, acrs);
}
}

View File

@ -565,9 +565,9 @@ public class GA4GHClaimSource extends ClaimSource {
}
public static class ClaimRepository {
private String name;
private RestTemplate restTemplate;
private String actionURL;
private final String name;
private final RestTemplate restTemplate;
private final String actionURL;
public ClaimRepository(String name, RestTemplate restTemplate, String actionURL) {
this.name = name;

View File

@ -27,9 +27,9 @@ public class PerunFiltersContext {
private static final String FILTER_CLASS = ".class";
private static final String PREFIX = "filter.";
private List<PerunRequestFilter> filters;
private Properties properties;
private BeanUtil beanUtil;
private final List<PerunRequestFilter> filters;
private final Properties properties;
private final BeanUtil beanUtil;
public PerunFiltersContext(Properties properties, BeanUtil beanUtil) {
this.properties = properties;

View File

@ -10,11 +10,11 @@ import java.util.Properties;
*/
public class PerunRequestFilterParams {
private String filterName;
private final String filterName;
private String propertyPrefix;
private Properties properties;
private BeanUtil beanUtil;
private final String propertyPrefix;
private final Properties properties;
private final BeanUtil beanUtil;
public PerunRequestFilterParams(String filterName, String propertyPrefix, Properties properties, BeanUtil beanUtil) {
this.filterName = filterName;

View File

@ -18,7 +18,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class WebHtmlClasses {
private String classesFilePath;
private final String classesFilePath;
private Properties webHtmlClassesProperties;
public WebHtmlClasses(PerunOidcConfig perunOidcConfig) {

View File

@ -90,7 +90,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ClientDetailsEntityJsonProcessor {
private static JsonParser parser = new JsonParser();
private static final JsonParser parser = new JsonParser();
public static ClientDetailsEntity parse(String jsonString) {
JsonElement jsonEl = parser.parse(jsonString);

View File

@ -59,7 +59,7 @@ public class JWTBearerAuthenticationProvider implements AuthenticationProvider {
private ClientKeyCacheService validators;
// Allow for time sync issues by having a window of X seconds.
private int timeSkewAllowance = 300;
private final int timeSkewAllowance = 300;
// to load clients
@Autowired

View File

@ -48,7 +48,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
*/
public class JWTBearerClientAssertionTokenEndpointFilter extends AbstractAuthenticationProcessingFilter {
private AuthenticationEntryPoint authenticationEntryPoint = new OAuth2AuthenticationEntryPoint();
private final AuthenticationEntryPoint authenticationEntryPoint = new OAuth2AuthenticationEntryPoint();
public JWTBearerClientAssertionTokenEndpointFilter(RequestMatcher additionalMatcher) {
super(new ClientAssertionRequestMatcher(additionalMatcher));
@ -110,7 +110,7 @@ public class JWTBearerClientAssertionTokenEndpointFilter extends AbstractAuthent
private static class ClientAssertionRequestMatcher implements RequestMatcher {
private RequestMatcher additionalMatcher;
private final RequestMatcher additionalMatcher;
public ClientAssertionRequestMatcher(RequestMatcher additionalMatcher) {
this.additionalMatcher = additionalMatcher;

View File

@ -34,7 +34,7 @@ import org.springframework.web.servlet.i18n.AbstractLocaleContextResolver;
*/
public class ConfigurationBeanLocaleResolver extends AbstractLocaleContextResolver {
private ConfigurationPropertiesBean config;
private final ConfigurationPropertiesBean config;
@Autowired
public ConfigurationBeanLocaleResolver(ConfigurationPropertiesBean config) {

View File

@ -26,6 +26,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
@ -46,9 +47,9 @@ public class JsonMessageSource extends AbstractMessageSource {
private Resource baseDirectory;
private Locale fallbackLocale = new Locale("en"); // US English is the fallback language
private final Locale fallbackLocale = new Locale("en"); // US English is the fallback language
private Map<Locale, List<JsonObject>> languageMaps = new HashMap<>();
private final Map<Locale, List<JsonObject>> languageMaps = new HashMap<>();
@Autowired
private ConfigurationPropertiesBean config;
@ -170,7 +171,7 @@ public class JsonMessageSource extends AbstractMessageSource {
log.info("No locale loaded, trying to load from {}", r);
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(new InputStreamReader(r.getInputStream(), "UTF-8"));
JsonObject obj = (JsonObject) parser.parse(new InputStreamReader(r.getInputStream(), StandardCharsets.UTF_8));
set.add(obj);
}

View File

@ -203,7 +203,7 @@ public class ServerConfiguration {
public enum UserInfoTokenMethod {
HEADER,
FORM,
QUERY;
QUERY
}
public String getAuthorizationEndpointUri() {
@ -949,14 +949,9 @@ public class ServerConfiguration {
return false;
}
if (userinfoSigningAlgValuesSupported == null) {
if (other.userinfoSigningAlgValuesSupported != null) {
return false;
}
} else if (!userinfoSigningAlgValuesSupported
.equals(other.userinfoSigningAlgValuesSupported)) {
return false;
}
return true;
return other.userinfoSigningAlgValuesSupported == null;
} else return userinfoSigningAlgValuesSupported
.equals(other.userinfoSigningAlgValuesSupported);
}
}

View File

@ -205,13 +205,8 @@ public class DefaultAddress implements Address {
return false;
}
if (streetAddress == null) {
if (other.streetAddress != null) {
return false;
}
} else if (!streetAddress.equals(other.streetAddress)) {
return false;
}
return true;
return other.streetAddress == null;
} else return streetAddress.equals(other.streetAddress);
}
}

View File

@ -617,13 +617,8 @@ public class DefaultUserInfo implements UserInfo {
return false;
}
if (zoneinfo == null) {
if (other.zoneinfo != null) {
return false;
}
} else if (!zoneinfo.equals(other.zoneinfo)) {
return false;
}
return true;
return other.zoneinfo == null;
} else return zoneinfo.equals(other.zoneinfo);
}
private void writeObject(ObjectOutputStream out) throws IOException {

View File

@ -28,7 +28,7 @@ import org.springframework.util.StringUtils;
@Converter
public class JsonObjectStringConverter implements AttributeConverter<JsonObject, String> {
private JsonParser parser = new JsonParser();
private final JsonParser parser = new JsonParser();
@Override
public String convertToDatabaseColumn(JsonObject attribute) {

View File

@ -55,7 +55,7 @@ import org.springframework.stereotype.Component;
@Slf4j
public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
private ClientDetailsEntityService clientDetailsService;
private final ClientDetailsEntityService clientDetailsService;
@Autowired
private ClientKeyCacheService validators;
@ -63,7 +63,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
@Autowired
private JWTEncryptionAndDecryptionService encryptionService;
private JsonParser parser = new JsonParser();
private final JsonParser parser = new JsonParser();
/**
* Constructor with arguments
@ -80,7 +80,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
public AuthorizationRequest createAuthorizationRequest(Map<String, String> inputParams) {
AuthorizationRequest request = new AuthorizationRequest(inputParams, Collections.<String, String> emptyMap(),
AuthorizationRequest request = new AuthorizationRequest(inputParams, Collections.emptyMap(),
inputParams.get(OAuth2Utils.CLIENT_ID),
OAuth2Utils.parseParameterList(inputParams.get(OAuth2Utils.SCOPE)), null,
null, false, inputParams.get(OAuth2Utils.STATE),

View File

@ -17,38 +17,38 @@ package cz.muni.ics.openid.connect.request;
public interface ConnectRequestParameters {
public String CLIENT_ID = "client_id";
public String RESPONSE_TYPE = "response_type";
public String REDIRECT_URI = "redirect_uri";
public String STATE = "state";
public String DISPLAY = "display";
public String REQUEST = "request";
public String LOGIN_HINT = "login_hint";
public String MAX_AGE = "max_age";
public String CLAIMS = "claims";
public String SCOPE = "scope";
public String NONCE = "nonce";
public String PROMPT = "prompt";
String CLIENT_ID = "client_id";
String RESPONSE_TYPE = "response_type";
String REDIRECT_URI = "redirect_uri";
String STATE = "state";
String DISPLAY = "display";
String REQUEST = "request";
String LOGIN_HINT = "login_hint";
String MAX_AGE = "max_age";
String CLAIMS = "claims";
String SCOPE = "scope";
String NONCE = "nonce";
String PROMPT = "prompt";
// prompt values
public String PROMPT_LOGIN = "login";
public String PROMPT_NONE = "none";
public String PROMPT_CONSENT = "consent";
public String PROMPT_SEPARATOR = " ";
String PROMPT_LOGIN = "login";
String PROMPT_NONE = "none";
String PROMPT_CONSENT = "consent";
String PROMPT_SEPARATOR = " ";
// extensions
public String APPROVED_SITE = "approved_site";
String APPROVED_SITE = "approved_site";
// responses
public String ERROR = "error";
public String LOGIN_REQUIRED = "login_required";
String ERROR = "error";
String LOGIN_REQUIRED = "login_required";
// audience
public String AUD = "aud";
String AUD = "aud";
// PKCE
public String CODE_CHALLENGE = "code_challenge";
public String CODE_CHALLENGE_METHOD = "code_challenge_method";
public String CODE_VERIFIER = "code_verifier";
String CODE_CHALLENGE = "code_challenge";
String CODE_CHALLENGE_METHOD = "code_challenge_method";
String CODE_VERIFIER = "code_verifier";
}

View File

@ -156,7 +156,7 @@ public class DefaultApprovedSiteService implements ApprovedSiteService {
}
private Predicate<ApprovedSite> isExpired = new Predicate<ApprovedSite>() {
private final Predicate<ApprovedSite> isExpired = new Predicate<ApprovedSite>() {
@Override
public boolean apply(ApprovedSite input) {
return (input != null && input.isExpired());

View File

@ -33,7 +33,7 @@ import org.springframework.stereotype.Service;
@Service("scopeClaimTranslator")
public class DefaultScopeClaimTranslationService implements ScopeClaimTranslationService {
private SetMultimap<String, String> scopesToClaims = HashMultimap.create();
private final SetMultimap<String, String> scopesToClaims = HashMultimap.create();
/**
* Default constructor; initializes scopesToClaims map

View File

@ -58,9 +58,9 @@ import org.springframework.web.servlet.view.AbstractView;
@Slf4j
public abstract class AbstractClientEntityView extends AbstractView {
private JsonParser parser = new JsonParser();
private final JsonParser parser = new JsonParser();
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.setExclusionStrategies(getExclusionStrategy())
.registerTypeAdapter(JWSAlgorithm.class, new JsonSerializer<JWSAlgorithm>() {
@Override

View File

@ -39,7 +39,7 @@ import org.springframework.validation.BeanPropertyBindingResult;
public class ClientEntityViewForAdmins extends AbstractClientEntityView {
public static final String VIEWNAME = "clientEntityViewAdmins";
private Set<String> blacklistedFields = ImmutableSet.of("additionalInformation");
private final Set<String> blacklistedFields = ImmutableSet.of("additionalInformation");
/**
* @return
@ -50,20 +50,13 @@ public class ClientEntityViewForAdmins extends AbstractClientEntityView {
@Override
public boolean shouldSkipField(FieldAttributes f) {
if (blacklistedFields.contains(f.getName())) {
return true;
} else {
return false;
}
return blacklistedFields.contains(f.getName());
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
};

View File

@ -39,7 +39,7 @@ import org.springframework.validation.BeanPropertyBindingResult;
@Component(ClientEntityViewForUsers.VIEWNAME)
public class ClientEntityViewForUsers extends AbstractClientEntityView {
private Set<String> whitelistedFields = ImmutableSet.of("clientName", "clientId", "id", "clientDescription", "scope", "logoUri");
private final Set<String> whitelistedFields = ImmutableSet.of("clientName", "clientId", "id", "clientDescription", "scope", "logoUri");
public static final String VIEWNAME = "clientEntityViewUsers";
@ -53,20 +53,13 @@ public class ClientEntityViewForUsers extends AbstractClientEntityView {
@Override
public boolean shouldSkipField(FieldAttributes f) {
// whitelist the handful of fields that are good
if (whitelistedFields.contains(f.getName())) {
return false;
} else {
return true;
}
return !whitelistedFields.contains(f.getName());
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
};

View File

@ -51,7 +51,7 @@ public class ClientInformationResponseView extends AbstractView {
public static final String VIEWNAME = "clientInformationResponseView";
// note that this won't serialize nulls by default
private Gson gson = new Gson();
private final Gson gson = new Gson();
/* (non-Javadoc)
* @see org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

View File

@ -53,7 +53,7 @@ public class JsonApprovedSiteView extends AbstractView {
public static final String VIEWNAME = "jsonApprovedSiteView";
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
@ -65,10 +65,7 @@ public class JsonApprovedSiteView extends AbstractView {
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
})

View File

@ -48,7 +48,7 @@ public class JsonEntityView extends AbstractView {
public static final String VIEWNAME = "jsonEntityView";
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
@ -60,10 +60,7 @@ public class JsonEntityView extends AbstractView {
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
})

View File

@ -55,7 +55,7 @@ public class JsonErrorView extends AbstractView {
public static final String VIEWNAME = "jsonErrorView";
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
@ -67,10 +67,7 @@ public class JsonErrorView extends AbstractView {
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
})

View File

@ -52,7 +52,7 @@ public class UserInfoView extends AbstractView {
public static final String VIEWNAME = "userInfoView";
private static JsonParser jsonParser = new JsonParser();
private static final JsonParser jsonParser = new JsonParser();
@Autowired
private ScopeClaimTranslationService translator;
@ -68,10 +68,7 @@ public class UserInfoView extends AbstractView {
@Override
public boolean shouldSkipClass(Class<?> clazz) {
// skip the JPA binding wrapper
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
return clazz.equals(BeanPropertyBindingResult.class);
}
}).create();

View File

@ -64,7 +64,7 @@ public class AuthenticationTimeStamper extends SavedRequestAwareAuthenticationSu
session.removeAttribute(AuthorizationRequestFilter.PROMPT_REQUESTED);
}
log.info("Successful Authentication of " + authentication.getName() + " at " + authTimestamp.toString());
log.info("Successful Authentication of " + authentication.getName() + " at " + authTimestamp);
super.onAuthenticationSuccess(request, response, authentication);

View File

@ -58,8 +58,8 @@ public class BlacklistAPI {
@Autowired
private BlacklistedSiteService blacklistService;
private Gson gson = new Gson();
private JsonParser parser = new JsonParser();
private final Gson gson = new Gson();
private final JsonParser parser = new JsonParser();
/**
* Get a list of all blacklisted sites

View File

@ -129,9 +129,9 @@ public class ClientAPI {
@Qualifier("clientAssertionValidator")
private AssertionValidator assertionValidator;
private JsonParser parser = new JsonParser();
private final JsonParser parser = new JsonParser();
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.serializeNulls()
.registerTypeAdapter(JWSAlgorithm.class, new JsonDeserializer<Algorithm>() {
@Override

View File

@ -45,7 +45,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
*/
public class UserInfoInterceptor extends HandlerInterceptorAdapter {
private Gson gson = new GsonBuilder()
private final Gson gson = new GsonBuilder()
.registerTypeHierarchyAdapter(GrantedAuthority.class,
(JsonSerializer<GrantedAuthority>) (src, typeOfSrc, context) -> new JsonPrimitive(src.getAuthority()))
.create();
@ -53,7 +53,7 @@ public class UserInfoInterceptor extends HandlerInterceptorAdapter {
@Autowired(required = false)
private UserInfoService userInfoService;
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
private final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

View File

@ -58,8 +58,8 @@ public class WhitelistAPI {
@Autowired
private WhitelistedSiteService whitelistService;
private Gson gson = new Gson();
private JsonParser parser = new JsonParser();
private final Gson gson = new Gson();
private final JsonParser parser = new JsonParser();
/**
* Get a list of all whitelisted sites

View File

@ -196,13 +196,8 @@ public class Claim {
return false;
}
if (value == null) {
if (other.value != null) {
return false;
}
} else if (!value.equals(other.value)) {
return false;
}
return true;
return other.value == null;
} else return value.equals(other.value);
}
}

View File

@ -140,13 +140,8 @@ public class Policy {
return false;
}
if (scopes == null) {
if (other.scopes != null) {
return false;
}
} else if (!scopes.equals(other.scopes)) {
return false;
}
return true;
return other.scopes == null;
} else return scopes.equals(other.scopes);
}
}

View File

@ -248,13 +248,8 @@ public class ResourceSet {
return false;
}
if (uri == null) {
if (other.uri != null) {
return false;
}
} else if (!uri.equals(other.uri)) {
return false;
}
return true;
return other.uri == null;
} else return uri.equals(other.uri);
}
}

View File

@ -53,7 +53,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class JsonUtils {
private static Gson gson = new Gson();
private static final Gson gson = new Gson();
/**
* Translate a set of strings to a JSON array, empty array returned as null

View File

@ -145,9 +145,9 @@ public class AbstractPageOperationTemplateTest {
private static class CountingPageOperation extends AbstractPageOperationTemplate<String>{
private int currentPageFetch;
private int pageSize = 10;
private final int pageSize = 10;
private long counter = 0L;
private long startTime;
private final long startTime;
private long timeToLastFetch;
private long timeToPreviousFetch;

View File

@ -31,7 +31,7 @@ public class TestWebfingerURLNormalizer {
// Test fixture:
private ImmutableMap<String, String> inputToNormalized = new ImmutableMap.Builder<String, String>()
private final ImmutableMap<String, String> inputToNormalized = new ImmutableMap.Builder<String, String>()
.put("example.com", "https://example.com")
.put("example.com:8080", "https://example.com:8080")
.put("example.com/path", "https://example.com/path")

View File

@ -45,8 +45,8 @@ import org.springframework.core.io.Resource;
public class TestJWKSetKeyStore {
private String RSAkid = "rsa_1";
private JWK RSAjwk = new RSAKey(
private final String RSAkid = "rsa_1";
private final JWK RSAjwk = new RSAKey(
new Base64URL("oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW" +
"cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S" +
"psk_ZkoFnilakGygTwpZ3uesH-PFABNIUYpOiN15dsQRkgr0vEhxN92i2a" +
@ -62,8 +62,8 @@ public class TestJWKSetKeyStore {
"VTIznSxfyrj8ILL6MG_Uv8YAu7VILSB3lOW085-4qE3DzgrTjgyQ"), // d
KeyUse.ENCRYPTION, null, JWEAlgorithm.RSA_OAEP, RSAkid, null, null, null, null, null);
private String RSAkid_rsa2 = "rsa_2";
private JWK RSAjwk_rsa2 = new RSAKey(
private final String RSAkid_rsa2 = "rsa_2";
private final JWK RSAjwk_rsa2 = new RSAKey(
new Base64URL("oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW" +
"cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S" +
"psk_ZkoFnilakGygTwpZ3uesH-PFABNIUYpOiN15dsQRkgr0vEhxN92i2a" +
@ -82,8 +82,8 @@ public class TestJWKSetKeyStore {
List<JWK> keys_list = new LinkedList<>();
private JWKSet jwkSet;
private String ks_file = "ks.txt";
private String ks_file_badJWK = "ks_badJWK.txt";
private final String ks_file = "ks.txt";
private final String ks_file_badJWK = "ks_badJWK.txt";
@Before
public void prepare() throws IOException {
@ -93,7 +93,7 @@ public class TestJWKSetKeyStore {
jwkSet = new JWKSet(keys_list);
jwkSet.getKeys();
byte jwtbyte[] = jwkSet.toString().getBytes();
byte[] jwtbyte = jwkSet.toString().getBytes();
FileOutputStream out = new FileOutputStream(ks_file);
out.write(jwtbyte);
out.close();
@ -135,7 +135,7 @@ public class TestJWKSetKeyStore {
@Test(expected=IllegalArgumentException.class)
public void ksBadJWKinput() throws IOException {
byte jwtbyte[] = RSAjwk.toString().getBytes();
byte[] jwtbyte = RSAjwk.toString().getBytes();
FileOutputStream out = new FileOutputStream(ks_file_badJWK);
out.write(jwtbyte);
out.close();
@ -180,7 +180,7 @@ public class TestJWKSetKeyStore {
}
assertTrue(thrown);
ks.setJwkSet(jwkSet);;
assertEquals(ks.getJwkSet(), jwkSet);
ks.setJwkSet(jwkSet);
assertEquals(ks.getJwkSet(), jwkSet);
}
}

View File

@ -63,17 +63,17 @@ import org.junit.rules.ExpectedException;
@Slf4j
public class TestDefaultJWTEncryptionAndDecryptionService {
private String plainText = "The true sign of intelligence is not knowledge but imagination.";
private final String plainText = "The true sign of intelligence is not knowledge but imagination.";
private String issuer = "www.example.net";
private String subject = "example_user";
private final String issuer = "www.example.net";
private final String subject = "example_user";
private JWTClaimsSet claimsSet = null;
@Rule
public ExpectedException exception = ExpectedException.none();
// Example data taken from rfc7516 appendix A
private String compactSerializedJwe = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ." +
private final String compactSerializedJwe = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ." +
"OKOawDo13gRp2ojaHV7LFpZcgV7T6DVZKTyKOMTYUmKoTCVJRgckCL9kiMT03JGe" +
"ipsEdY3mx_etLbbWSrFr05kLzcSr4qKAq7YN7e9jwQRb23nfa6c9d-StnImGyFDb" +
"Sv04uVuxIp5Zms1gNxKKK2Da14B8S4rzVRltdYwam_lDp5XnZAYpQdb76FdIKLaV" +
@ -85,8 +85,8 @@ public class TestDefaultJWTEncryptionAndDecryptionService {
"SdiwkIr3ajwQzaBtQD_A." +
"XFBoMYUZodetZdvTiFvSkQ";
private String RSAkid = "rsa321";
private JWK RSAjwk = new RSAKey(
private final String RSAkid = "rsa321";
private final JWK RSAjwk = new RSAKey(
new Base64URL("oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW" +
"cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S" +
"psk_ZkoFnilakGygTwpZ3uesH-PFABNIUYpOiN15dsQRkgr0vEhxN92i2a" +
@ -102,8 +102,8 @@ public class TestDefaultJWTEncryptionAndDecryptionService {
"VTIznSxfyrj8ILL6MG_Uv8YAu7VILSB3lOW085-4qE3DzgrTjgyQ"), // d
KeyUse.ENCRYPTION, null, JWEAlgorithm.RSA_OAEP, RSAkid, null, null, null, null, null);
private String RSAkid_2 = "rsa3210";
private JWK RSAjwk_2 = new RSAKey(
private final String RSAkid_2 = "rsa3210";
private final JWK RSAjwk_2 = new RSAKey(
new Base64URL("oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW" +
"cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S" +
"psk_ZkoFnilakGygTwpZ3uesH-PFABNIUYpOiN15dsQRkgr0vEhxN92i2a" +
@ -119,30 +119,30 @@ public class TestDefaultJWTEncryptionAndDecryptionService {
"VTIznSxfyrj8ILL6MG_Uv8YAu7VILSB3lOW085-4qE3DzgrTjgyQ"), // d
KeyUse.ENCRYPTION, null, JWEAlgorithm.RSA1_5, RSAkid_2, null, null, null, null, null);
private String AESkid = "aes123";
private JWK AESjwk = new OctetSequenceKey(new Base64URL("GawgguFyGrWKav7AX4VKUg"),
private final String AESkid = "aes123";
private final JWK AESjwk = new OctetSequenceKey(new Base64URL("GawgguFyGrWKav7AX4VKUg"),
KeyUse.ENCRYPTION, null, JWEAlgorithm.A128KW,
AESkid, null, null, null, null, null);
private Map<String, JWK> keys = new ImmutableMap.Builder<String, JWK>()
private final Map<String, JWK> keys = new ImmutableMap.Builder<String, JWK>()
.put(RSAkid, RSAjwk)
.build();
private Map<String, JWK> keys_2 = new ImmutableMap.Builder<String, JWK>()
private final Map<String, JWK> keys_2 = new ImmutableMap.Builder<String, JWK>()
.put(RSAkid, RSAjwk)
.put(RSAkid_2, RSAjwk_2)
.build();
private Map<String, JWK> keys_3 = new ImmutableMap.Builder<String, JWK>()
private final Map<String, JWK> keys_3 = new ImmutableMap.Builder<String, JWK>()
.put(AESkid, AESjwk)
.build();
private Map<String, JWK> keys_4= new ImmutableMap.Builder<String, JWK>()
private final Map<String, JWK> keys_4= new ImmutableMap.Builder<String, JWK>()
.put(RSAkid, RSAjwk)
.put(RSAkid_2, RSAjwk_2)
.put(AESkid, AESjwk)
.build();
private List<JWK> keys_list = new LinkedList<>();
private final List<JWK> keys_list = new LinkedList<>();
private DefaultJWTEncryptionAndDecryptionService service;
private DefaultJWTEncryptionAndDecryptionService service_2;

View File

@ -53,11 +53,11 @@ public class TestBlacklistAwareRedirectResolver {
@InjectMocks
private BlacklistAwareRedirectResolver resolver;
private String blacklistedUri = "https://evil.example.com/";
private final String blacklistedUri = "https://evil.example.com/";
private String goodUri = "https://good.example.com/";
private final String goodUri = "https://good.example.com/";
private String pathUri = "https://good.example.com/with/path";
private final String pathUri = "https://good.example.com/with/path";
/**
* @throws java.lang.Exception

View File

@ -44,9 +44,9 @@ import org.springframework.security.oauth2.provider.OAuth2Request;
public class TestDefaultIntrospectionResultAssembler {
private IntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();
private final IntrospectionResultAssembler assembler = new DefaultIntrospectionResultAssembler();
private static DateFormatter dateFormat = new DateFormatter(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
private static final DateFormatter dateFormat = new DateFormatter(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
@Test
public void shouldAssembleExpectedResultForAccessToken() throws ParseException {

View File

@ -86,13 +86,13 @@ public class TestDefaultOAuth2ProviderTokenService {
private OAuth2Authentication authentication;
private ClientDetailsEntity client;
private ClientDetailsEntity badClient;
private String clientId = "test_client";
private String badClientId = "bad_client";
private Set<String> scope = newHashSet("openid", "profile", "email", "offline_access");
private final String clientId = "test_client";
private final String badClientId = "bad_client";
private final Set<String> scope = newHashSet("openid", "profile", "email", "offline_access");
private OAuth2RefreshTokenEntity refreshToken;
private OAuth2AccessTokenEntity accessToken;
private String refreshTokenValue = "refresh_token_value";
private String userName = "6a50ac11786d402a9591d3e592ac770f";
private final String refreshTokenValue = "refresh_token_value";
private final String userName = "6a50ac11786d402a9591d3e592ac770f";
private final String issuer = "https://issuer.com/oidc/";
private TokenRequest tokenRequest;

View File

@ -49,12 +49,12 @@ public class TestDefaultSystemScopeService {
private SystemScope dynScope1;
private SystemScope restrictedScope1;
private String defaultDynScope1String = "defaultDynScope1";
private String defaultDynScope2String = "defaultDynScope2";
private String defaultScope1String = "defaultScope1";
private String defaultScope2String = "defaultScope2";
private String dynScope1String = "dynScope1";
private String restrictedScope1String = "restrictedScope1";
private final String defaultDynScope1String = "defaultDynScope1";
private final String defaultDynScope2String = "defaultDynScope2";
private final String defaultScope1String = "defaultScope1";
private final String defaultScope2String = "defaultScope2";
private final String dynScope1String = "dynScope1";
private final String restrictedScope1String = "restrictedScope1";
private Set<SystemScope> allScopes;
private Set<String> allScopeStrings;

View File

@ -67,9 +67,9 @@ public class TestJWTBearerAuthenticationProvider {
@Mock
private JWTSigningAndValidationService validator;
private GrantedAuthority authority1 = new SimpleGrantedAuthority("1");
private GrantedAuthority authority2 = new SimpleGrantedAuthority("2");
private GrantedAuthority authority3 = new SimpleGrantedAuthority("3");
private final GrantedAuthority authority1 = new SimpleGrantedAuthority("1");
private final GrantedAuthority authority2 = new SimpleGrantedAuthority("2");
private final GrantedAuthority authority3 = new SimpleGrantedAuthority("3");
@Before
public void setup() {

View File

@ -23,9 +23,9 @@ public class TestJsonMessageSource {
@Spy
private ConfigurationPropertiesBean config;
private Locale localeThatHasAFile = new Locale("en");
private final Locale localeThatHasAFile = new Locale("en");
private Locale localeThatDoesNotHaveAFile = new Locale("xx");
private final Locale localeThatDoesNotHaveAFile = new Locale("xx");
@Before
public void setup() {

View File

@ -43,9 +43,9 @@ public class TestDefaultBlacklistedSiteService {
private BlacklistedSite site1;
private BlacklistedSite site2;
private String uri1 = "black1";
private String uri2 = "black2";
private String uri3 = "not-black";
private final String uri1 = "black1";
private final String uri2 = "black2";
private final String uri3 = "not-black";
private Set<BlacklistedSite> blackListedSitesSet;

View File

@ -37,10 +37,10 @@ public class TestDefaultOIDCTokenService {
private static final String CLIENT_ID = "client";
private static final String KEY_ID = "key";
private ConfigurationPropertiesBean configBean = new ConfigurationPropertiesBean();
private ClientDetailsEntity client = new ClientDetailsEntity();
private OAuth2AccessTokenEntity accessToken = new OAuth2AccessTokenEntity();
private OAuth2Request request = new OAuth2Request(CLIENT_ID) { };
private final ConfigurationPropertiesBean configBean = new ConfigurationPropertiesBean();
private final ClientDetailsEntity client = new ClientDetailsEntity();
private final OAuth2AccessTokenEntity accessToken = new OAuth2AccessTokenEntity();
private final OAuth2Request request = new OAuth2Request(CLIENT_ID) { };
@Mock
private JWTSigningAndValidationService jwtService;

View File

@ -68,25 +68,25 @@ public class TestDefaultUserInfoService {
private ClientDetailsEntity pairwiseClient3;
private ClientDetailsEntity pairwiseClient4;
private String adminUsername = "username";
private String regularUsername = "regular";
private String adminSub = "adminSub12d3a1f34a2";
private String regularSub = "regularSub652ha23b";
private final String adminUsername = "username";
private final String regularUsername = "regular";
private final String adminSub = "adminSub12d3a1f34a2";
private final String regularSub = "regularSub652ha23b";
private String pairwiseSub12 = "regularPairwise-12-31ijoef";
private String pairwiseSub3 = "regularPairwise-3-1ojadsio";
private String pairwiseSub4 = "regularPairwise-4-1ojadsio";
private final String pairwiseSub12 = "regularPairwise-12-31ijoef";
private final String pairwiseSub3 = "regularPairwise-3-1ojadsio";
private final String pairwiseSub4 = "regularPairwise-4-1ojadsio";
private String publicClientId1 = "publicClient-1-313124";
private String publicClientId2 = "publicClient-2-4109312";
private String pairwiseClientId1 = "pairwiseClient-1-2312";
private String pairwiseClientId2 = "pairwiseClient-2-324416";
private String pairwiseClientId3 = "pairwiseClient-3-154157";
private String pairwiseClientId4 = "pairwiseClient-4-4589723";
private final String publicClientId1 = "publicClient-1-313124";
private final String publicClientId2 = "publicClient-2-4109312";
private final String pairwiseClientId1 = "pairwiseClient-1-2312";
private final String pairwiseClientId2 = "pairwiseClient-2-324416";
private final String pairwiseClientId3 = "pairwiseClient-3-154157";
private final String pairwiseClientId4 = "pairwiseClient-4-4589723";
private String sectorIdentifier1 = "https://sector-identifier-12/url";
private String sectorIdentifier2 = "https://sector-identifier-12/url2";
private String sectorIdentifier3 = "https://sector-identifier-3/url";
private final String sectorIdentifier1 = "https://sector-identifier-12/url";
private final String sectorIdentifier2 = "https://sector-identifier-12/url2";
private final String sectorIdentifier3 = "https://sector-identifier-3/url";

View File

@ -61,28 +61,28 @@ public class TestUUIDPairwiseIdentiferService {
private ClientDetailsEntity pairwiseClient4;
private ClientDetailsEntity pairwiseClient5;
private String regularUsername = "regular";
private String regularSub = "regularSub652ha23b";
private String pairwiseSub = "pairwise-12-regular-user";
private final String regularUsername = "regular";
private final String regularSub = "regularSub652ha23b";
private final String pairwiseSub = "pairwise-12-regular-user";
private String pairwiseClientId1 = "pairwiseClient-1-2312";
private String pairwiseClientId2 = "pairwiseClient-2-324416";
private String pairwiseClientId3 = "pairwiseClient-3-154157";
private String pairwiseClientId4 = "pairwiseClient-4-4589723";
private String pairwiseClientId5 = "pairwiseClient-5-34908713";
private final String pairwiseClientId1 = "pairwiseClient-1-2312";
private final String pairwiseClientId2 = "pairwiseClient-2-324416";
private final String pairwiseClientId3 = "pairwiseClient-3-154157";
private final String pairwiseClientId4 = "pairwiseClient-4-4589723";
private final String pairwiseClientId5 = "pairwiseClient-5-34908713";
private String sectorHost12 = "sector-identifier-12";
private String sectorHost3 = "sector-identifier-3";
private String clientHost4 = "client-redirect-4";
private String clientHost5 = "client-redirect-5";
private final String sectorHost12 = "sector-identifier-12";
private final String sectorHost3 = "sector-identifier-3";
private final String clientHost4 = "client-redirect-4";
private final String clientHost5 = "client-redirect-5";
private String sectorIdentifier1 = "https://" + sectorHost12 + "/url";
private String sectorIdentifier2 = "https://" + sectorHost12 + "/url2";
private String sectorIdentifier3 = "https://" + sectorHost3 + "/url";
private final String sectorIdentifier1 = "https://" + sectorHost12 + "/url";
private final String sectorIdentifier2 = "https://" + sectorHost12 + "/url2";
private final String sectorIdentifier3 = "https://" + sectorHost3 + "/url";
private Set<String> pairwiseClient3RedirectUris = ImmutableSet.of("https://" + sectorHost3 + "/oauth", "https://" + sectorHost3 + "/other");
private Set<String> pairwiseClient4RedirectUris = ImmutableSet.of("https://" + clientHost4 + "/oauth");
private Set<String> pairwiseClient5RedirectUris = ImmutableSet.of("https://" + clientHost5 + "/oauth", "https://" + clientHost5 + "/other");
private final Set<String> pairwiseClient3RedirectUris = ImmutableSet.of("https://" + sectorHost3 + "/oauth", "https://" + sectorHost3 + "/other");
private final Set<String> pairwiseClient4RedirectUris = ImmutableSet.of("https://" + clientHost4 + "/oauth");
private final Set<String> pairwiseClient5RedirectUris = ImmutableSet.of("https://" + clientHost5 + "/oauth", "https://" + clientHost5 + "/other");
private PairwiseIdentifier savedPairwiseIdentifier;

View File

@ -44,7 +44,7 @@ public class TestConnectTokenEnhancer {
private static final String CLIENT_ID = "client";
private static final String KEY_ID = "key";
private ConfigurationPropertiesBean configBean = new ConfigurationPropertiesBean();
private final ConfigurationPropertiesBean configBean = new ConfigurationPropertiesBean();
@Mock
private JWTSigningAndValidationService jwtService;
@ -61,7 +61,7 @@ public class TestConnectTokenEnhancer {
@Mock
private OAuth2Authentication authentication;
private OAuth2Request request = new OAuth2Request(CLIENT_ID) { };
private final OAuth2Request request = new OAuth2Request(CLIENT_ID) { };
@InjectMocks
private ConnectTokenEnhancer enhancer = new ConnectTokenEnhancer();