Fix compiling in Eclipse

This commit is contained in:
Rob Winch 2014-09-16 09:54:45 -05:00
parent 39d544b901
commit 02c3565e22
18 changed files with 11 additions and 41 deletions

View File

@ -1,12 +1,12 @@
/*
* Copyright 2011 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.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -108,7 +108,6 @@ public class ServiceAuthenticationDetailsSource implements AuthenticationDetails
}
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if(serviceProperties == null) {
serviceProperties = applicationContext.getBean(ServiceProperties.class);

View File

@ -204,7 +204,7 @@ class LdapAuthenticationProviderBuilderSecurityBuilderTests extends BaseSpringSp
auth.build()
}
abstract protected void configure(AuthenticationManagerBuilder auth)
abstract protected void configure(AuthenticationManagerBuilder auth) throws Exception
}
static Integer port;

View File

@ -62,7 +62,7 @@ public class MessageSecurityMetadataSourceRegistry {
* from. Uses {@link MessageSecurityMetadataSourceRegistry#pathMatcher(PathMatcher)}.
*
* @return the {@link Constraint} that is associated to the {@link MessageMatcher}
* @see {@link MessageSecurityMetadataSourceRegistry#pathMatcher(PathMatcher)}
* @see {@link MessageSecurityMetadataSourceRegistry#pathMatcher(PathMatcher)}
*/
public Constraint destinationMatchers(String... patterns) {
List<MatcherBuilder> matchers = new ArrayList<MatcherBuilder>(patterns.length);
@ -278,7 +278,6 @@ public class MessageSecurityMetadataSourceRegistry {
this.matcher = matcher;
}
@Override
public MessageMatcher<?> build() {
return matcher;
}
@ -291,7 +290,6 @@ public class MessageSecurityMetadataSourceRegistry {
this.pattern = pattern;
}
@Override
public MessageMatcher<?> build() {
return new SimpDestinationMessageMatcher(pattern, pathMatcher);
}

View File

@ -62,7 +62,6 @@ import java.util.List;
@Order(Ordered.HIGHEST_PRECEDENCE + 100)
public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {}
@Override

View File

@ -465,7 +465,6 @@ public abstract class AbstractSecurityInterceptor implements InitializingBean, A
private static class NoOpAuthenticationManager implements AuthenticationManager {
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
throw new AuthenticationServiceException("Cannot authenticate " + authentication);
}

View File

@ -95,7 +95,6 @@ public class SecurityEvaluationContextExtension extends EvaluationContextExtensi
this.authentication = authentication;
}
@Override
public String getExtensionId() {
return "security";
}

View File

@ -102,6 +102,12 @@ task integrationTest(type: Test, dependsOn: jar) {
junitXml.destination = project.file("$project.buildDir/integration-test-results/")
}
}
eclipse {
classpath {
plusConfigurations += [ configurations.integrationTestCompile ]
}
}
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 1, project.configurations.getByName("integrationTestCompile"), Conf2ScopeMappingContainer.TEST)
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 2, project.configurations.getByName("integrationTestRuntime"), Conf2ScopeMappingContainer.TEST)
check.dependsOn integrationTest

View File

@ -114,7 +114,6 @@ public class LdapAuthority implements GrantedAuthority {
/**
* {@inheritDoc}
*/
@Override
public String getAuthority() {
return role;
}

View File

@ -65,13 +65,11 @@ public final class ChannelSecurityInterceptor extends AbstractSecurityIntercepto
return metadataSource;
}
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
InterceptorStatusToken token = beforeInvocation(message);
return token == null ? message : new TokenMessage(message,token);
}
@Override
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
if(!(message instanceof TokenMessage)) {
// TODO What if other classes return another instance too?
@ -81,7 +79,6 @@ public final class ChannelSecurityInterceptor extends AbstractSecurityIntercepto
afterInvocation(token, null);
}
@Override
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex) {
if(!(message instanceof TokenMessage)) {
// TODO What if other classes return another instance too?
@ -95,12 +92,10 @@ public final class ChannelSecurityInterceptor extends AbstractSecurityIntercepto
return true;
}
@Override
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
return message;
}
@Override
public void afterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex) {
}
@ -117,12 +112,10 @@ public final class ChannelSecurityInterceptor extends AbstractSecurityIntercepto
return token;
}
@Override
public MessageHeaders getHeaders() {
return delegate.getHeaders();
}
@Override
public Object getPayload() {
return delegate.getPayload();
}

View File

@ -44,7 +44,6 @@ public final class DefaultMessageSecurityMetadataSource implements MessageSecuri
this.messageMap = messageMap;
}
@Override
public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
final Message message = (Message) object;
for (Map.Entry<MessageMatcher<?>, Collection<ConfigAttribute>> entry : messageMap.entrySet()) {
@ -55,7 +54,6 @@ public final class DefaultMessageSecurityMetadataSource implements MessageSecuri
return null;
}
@Override
public Collection<ConfigAttribute> getAllConfigAttributes() {
Set<ConfigAttribute> allAttributes = new HashSet<ConfigAttribute>();
@ -66,7 +64,6 @@ public final class DefaultMessageSecurityMetadataSource implements MessageSecuri
return allAttributes;
}
@Override
public boolean supports(Class<?> clazz) {
return Message.class.isAssignableFrom(clazz);
}

View File

@ -65,13 +65,11 @@ public final class SecurityContextChannelInterceptor extends ChannelInterceptorA
cleanup();
}
@Override
public Message<?> beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler) {
setup(message);
return message;
}
@Override
public void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex) {
cleanup();
}

View File

@ -78,7 +78,6 @@ public final class SimpDestinationMessageMatcher implements MessageMatcher<Objec
this(pattern, new AntPathMatcher());
}
@Override
public boolean matches(Message<? extends Object> message) {
String destination = SimpMessageHeaderAccessor.getDestination(message.getHeaders());
return destination != null && matcher.match(pattern, destination);

View File

@ -26,7 +26,6 @@ import java.util.List;
*/
@Repository
public interface SecurityMessageRepository extends MessageRepository {
@Override
@Query("select m from Message m where m.to.id = ?#{ principal?.id }")
List<Message> findAll();
}

View File

@ -207,7 +207,6 @@ public final class SecurityMockMvcRequestPostProcessors {
this.certificates = certificates;
}
@Override
public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) {
request.setAttribute("javax.servlet.request.X509Certificate", certificates);
return request;
@ -340,7 +339,6 @@ public final class SecurityMockMvcRequestPostProcessors {
+ "\", response=\"" + responseDigest + "\", qop=" + qop + ", nc=" + nc + ", cnonce=\"" + cnonce + "\"";
}
@Override
public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) {
request.addHeader("Authorization",
@ -465,7 +463,6 @@ public final class SecurityMockMvcRequestPostProcessors {
this.delegate = delegate;
}
@Override
public SecurityContext loadContext(HttpRequestResponseHolder requestResponseHolder) {
SecurityContext result = getContext(requestResponseHolder.getRequest());
// always load from the delegate to ensure the request/response in the holder are updated
@ -474,13 +471,11 @@ public final class SecurityMockMvcRequestPostProcessors {
return result == null ? delegateResult : result;
}
@Override
public void saveContext(SecurityContext context, HttpServletRequest request, HttpServletResponse response) {
request.setAttribute(ATTR_NAME, context);
delegate.saveContext(context, request, response);
}
@Override
public boolean containsContext(HttpServletRequest request) {
return getContext(request) != null || delegate.containsContext(request);
}

View File

@ -35,37 +35,30 @@ public class CustomUserDetails implements UserDetails {
this.authorities = AuthorityUtils.createAuthorityList("ROLE_USER");
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public String getPassword() {
return null;
}
@Override
public String getUsername() {
return username;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}

View File

@ -31,7 +31,6 @@ import java.util.List;
* @author Rob Winch
*/
public class WithMockCustomUserSecurityContextFactory implements WithSecurityContextFactory<WithMockCustomUser> {
@Override
public SecurityContext createSecurityContext(WithMockCustomUser customUser) {
SecurityContext context = SecurityContextHolder.createEmptyContext();

View File

@ -89,7 +89,6 @@ public class WithUserDetailsTests {
static class CustomUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {
return new CustomUserDetails("name", username);
}

View File

@ -60,7 +60,6 @@ public class SecurityMockMvcRequestPostProcessorsDigestTests {
entryPoint.setRealmName("Spring Security");
filter = new DigestAuthenticationFilter();
filter.setUserDetailsService(new UserDetailsService() {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return new User(username,password, AuthorityUtils.createAuthorityList("ROLE_USER"));
}