diff --git a/src/main/java/de/thm/arsnova/config/SecurityConfig.java b/src/main/java/de/thm/arsnova/config/SecurityConfig.java index 6ec165f11479db52ae6eab785a6a6a050083f82a..72392bea6c21334d0be5a9c71ba22aec409a3ba3 100644 --- a/src/main/java/de/thm/arsnova/config/SecurityConfig.java +++ b/src/main/java/de/thm/arsnova/config/SecurityConfig.java @@ -1,13 +1,18 @@ package de.thm.arsnova.config; +import javax.servlet.ServletContext; + import org.jasig.cas.client.validation.Cas20ProxyTicketValidator; import org.scribe.up.provider.impl.FacebookProvider; import org.scribe.up.provider.impl.Google2Provider; import org.scribe.up.provider.impl.Google2Provider.Google2Scope; import org.scribe.up.provider.impl.TwitterProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.FileSystemResource; @@ -40,6 +45,7 @@ import org.springframework.security.web.authentication.logout.LogoutFilter; import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; +import org.springframework.web.context.ServletContextAware; import com.github.leleuj.ss.oauth.client.authentication.OAuthAuthenticationProvider; import com.github.leleuj.ss.oauth.client.web.OAuthAuthenticationEntryPoint; @@ -54,9 +60,10 @@ import de.thm.arsnova.security.DbUserDetailsService; @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) @EnableWebSecurity -public class SecurityConfig extends WebSecurityConfigurerAdapter { +public class SecurityConfig extends WebSecurityConfigurerAdapter implements ServletContextAware { + private ServletContext servletContext; + @Value("${root-url}") private String rootUrl; - @Value("#{servletContext.contextPath}") private String contextPath; @Value("${security.user-db.enabled}") private boolean dbAuthEnabled; @@ -194,11 +201,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // LDAP Authentication Configuration + @Profile("!test") @Bean public LdapAuthenticationProvider ldapAuthenticationProvider() throws Exception { return new LdapAuthenticationProvider(ldapAuthenticator(), ldapAuthoritiesPopulator()); } + @Profile("!test") @Bean public LdapContextSource ldapContextSource() throws Exception { DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource(ldapUrl); @@ -209,6 +218,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return contextSource; } + @Profile("!test") @Bean public LdapAuthenticator ldapAuthenticator() throws Exception { BindAuthenticator authenticator = new BindAuthenticator(ldapContextSource()); @@ -217,6 +227,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return authenticator; } + @Profile("!test") @Bean public LdapAuthoritiesPopulator ldapAuthoritiesPopulator() throws Exception { return new DefaultLdapAuthoritiesPopulator(ldapContextSource(), null); @@ -224,6 +235,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // CAS Authentication Configuration + @Profile("!test") @Bean public CasAuthenticationProvider casAuthenticationProvider() { CasAuthenticationProvider authProvider = new CasAuthenticationProvider(); @@ -235,25 +247,29 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return authProvider; } + @Profile("!test") @Bean public CasUserDetailsService casUserDetailsService() { return new CasUserDetailsService(); } + @Profile("!test") @Bean public ServiceProperties casServiceProperties() { ServiceProperties properties = new ServiceProperties(); - properties.setService(rootUrl + contextPath + "/j_spring_cas_security_check"); + properties.setService(rootUrl + servletContext.getContextPath() + "/j_spring_cas_security_check"); properties.setSendRenew(false); return properties; } + @Profile("!test") @Bean public Cas20ProxyTicketValidator casTicketValidator() { return new Cas20ProxyTicketValidator(casUrl); } + @Profile("!test") @Bean public CasAuthenticationEntryPoint casAuthenticationEntryPoint() { CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint(); @@ -263,6 +279,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return entryPoint; } + @Profile("!test") @Bean public CasAuthenticationFilter casAuthenticationFilter() throws Exception { CasAuthenticationFilter filter = new CasAuthenticationFilter(); @@ -273,6 +290,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return filter; } + @Profile("!test") @Bean public LogoutFilter casLogoutFilter() { LogoutFilter filter = new LogoutFilter(casLogoutSuccessHandler(), logoutHandler()); @@ -281,6 +299,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return filter; } + @Profile("!test") @Bean public LogoutSuccessHandler casLogoutSuccessHandler() { CASLogoutSuccessHandler handler = new CASLogoutSuccessHandler(); @@ -292,6 +311,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // Facebook Authentication Configuration + @Profile("!test") @Bean public OAuthAuthenticationEntryPoint facebookEntryPoint() { final OAuthAuthenticationEntryPoint entryPoint = new OAuthAuthenticationEntryPoint(); @@ -300,16 +320,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return entryPoint; } + @Profile("!test") @Bean public FacebookProvider facebookProvider() { final FacebookProvider provider = new FacebookProvider(); provider.setKey(facebookKey); provider.setSecret(facebookSecret); - provider.setCallbackUrl(rootUrl + contextPath + "/j_spring_facebook_security_check"); + provider.setCallbackUrl(rootUrl + servletContext.getContextPath() + "/j_spring_facebook_security_check"); return provider; } + @Profile("!test") @Bean public OAuthAuthenticationFilter facebookFilter() throws Exception { final OAuthAuthenticationFilter filter = new OAuthAuthenticationFilter("/j_spring_facebook_security_check"); @@ -321,6 +343,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return filter; } + @Profile("!test") @Bean public OAuthAuthenticationProvider facebookAuthProvider() { final OAuthAuthenticationProvider authProvider = new OAuthAuthenticationProvider(); @@ -331,16 +354,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // Twitter Authentication Configuration + @Profile("!test") @Bean public TwitterProvider twitterProvider() { final TwitterProvider provider = new TwitterProvider(); provider.setKey(twitterKey); provider.setSecret(twitterSecret); - provider.setCallbackUrl(rootUrl + contextPath + "/j_spring_twitter_security_check"); + provider.setCallbackUrl(rootUrl + servletContext.getContextPath() + "/j_spring_twitter_security_check"); return provider; } + @Profile("!test") @Bean public OAuthAuthenticationFilter twitterFilter() throws Exception { final OAuthAuthenticationFilter filter = new OAuthAuthenticationFilter("/j_spring_twitter_security_check"); @@ -351,6 +376,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return filter; } + @Profile("!test") @Bean public OAuthAuthenticationProvider twitterAuthProvider() { final OAuthAuthenticationProvider authProvider = new OAuthAuthenticationProvider(); @@ -361,17 +387,19 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // Google Authentication Configuration + @Profile("!test") @Bean public Google2Provider googleProvider() { final Google2Provider provider = new Google2Provider(); provider.setKey(googleKey); provider.setSecret(googleSecret); - provider.setCallbackUrl(rootUrl + contextPath + "/j_spring_google_security_check"); + provider.setCallbackUrl(rootUrl + servletContext.getContextPath() + "/j_spring_google_security_check"); provider.setScope(Google2Scope.EMAIL); return provider; } + @Profile("!test") @Bean public OAuthAuthenticationFilter googleFilter() throws Exception { final OAuthAuthenticationFilter filter = new OAuthAuthenticationFilter("/j_spring_google_security_check"); @@ -383,6 +411,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return filter; } + @Profile("!test") @Bean public OAuthAuthenticationProvider googleAuthProvider() { final OAuthAuthenticationProvider authProvider = new OAuthAuthenticationProvider(); @@ -390,4 +419,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { return authProvider; } + + @Override + public void setServletContext(ServletContext servletContext) { + this.servletContext = servletContext; + } } diff --git a/src/main/java/de/thm/arsnova/controller/LoginController.java b/src/main/java/de/thm/arsnova/controller/LoginController.java index 52e973c903d9e8fe30bcc751d1ad7f7e6da85a64..4236fdfeda69c08a29ffed2068991ba7a8a79fd3 100644 --- a/src/main/java/de/thm/arsnova/controller/LoginController.java +++ b/src/main/java/de/thm/arsnova/controller/LoginController.java @@ -147,7 +147,7 @@ public class LoginController extends AbstractController { @Autowired(required = false) private FacebookProvider facebookProvider; - + @Autowired(required = false) private LdapAuthenticationProvider ldapAuthenticationProvider; diff --git a/src/main/webapp/WEB-INF/spring/arsnova-servlet.xml b/src/main/webapp/WEB-INF/spring/arsnova-servlet.xml index 1dc289bf8d65a31be351a0f1609a250039b5ae22..00855bf450ab80ded1182d39d7ec28ba5f4d9b97 100644 --- a/src/main/webapp/WEB-INF/spring/arsnova-servlet.xml +++ b/src/main/webapp/WEB-INF/spring/arsnova-servlet.xml @@ -15,14 +15,14 @@ <context:component-scan base-package="de.thm.arsnova.controller,de.thm.arsnova.web" /> <context:property-placeholder location="file:///etc/arsnova/arsnova.properties" file-encoding="UTF-8" /> <mvc:annotation-driven - content-negotiation-manager="contentNegotiationManager" /> + content-negotiation-manager="mvcContentNegotiationManager" /> <mvc:interceptors> <bean class="de.thm.arsnova.web.CacheControlInterceptorHandler" /> <bean class="de.thm.arsnova.web.DeprecatedApiInterceptorHandler" /> </mvc:interceptors> - <bean id="contentNegotiationManager" + <bean id="mvcContentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"> <property name="favorPathExtension" value="false" /> <property name="favorParameter" value="true" /> diff --git a/src/test/java/de/thm/arsnova/config/ExtraConfigTest.java b/src/test/java/de/thm/arsnova/config/ExtraConfigTest.java index 8b9ede4ef0bbf60e7e62235b3d78e98e6859a7e0..ee37027f0305a545d8c0e5a2c9d32c32bc062f1f 100644 --- a/src/test/java/de/thm/arsnova/config/ExtraConfigTest.java +++ b/src/test/java/de/thm/arsnova/config/ExtraConfigTest.java @@ -5,6 +5,7 @@ import static org.junit.Assert.assertNull; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -16,10 +17,10 @@ import de.thm.arsnova.connector.client.ConnectorClient; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class ExtraConfigTest { @Autowired(required = false) diff --git a/src/test/java/de/thm/arsnova/controller/CourseControllerTest.java b/src/test/java/de/thm/arsnova/controller/CourseControllerTest.java index 7b122982ca65b02e078cdf85140ceea5efca3dcc..5a2a79081352c81c6bfe993280e01c6172b45fa3 100644 --- a/src/test/java/de/thm/arsnova/controller/CourseControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/CourseControllerTest.java @@ -16,6 +16,7 @@ import org.springframework.http.MediaType; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -31,10 +32,11 @@ import de.thm.arsnova.services.StubUserService; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) + +@ActiveProfiles("test") public class CourseControllerTest { private MockMvc mockMvc; diff --git a/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java b/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java index a9fc7a1613f52ad71b6d74eabc4bd2b9a54354e1..610fbca29dfdbab59f496f96d3cc23761925616e 100644 --- a/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/FeedbackControllerTest.java @@ -11,6 +11,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -25,10 +26,10 @@ import de.thm.arsnova.services.StubUserService; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class FeedbackControllerTest { @Autowired diff --git a/src/test/java/de/thm/arsnova/controller/LecturerQuestionControllerTest.java b/src/test/java/de/thm/arsnova/controller/LecturerQuestionControllerTest.java index bccdc773ce1462219c49fa00ce6cd54dcae27076..d6477d7e0739a3c75b62ecb2a9b535415f1330ec 100644 --- a/src/test/java/de/thm/arsnova/controller/LecturerQuestionControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/LecturerQuestionControllerTest.java @@ -17,6 +17,7 @@ import org.springframework.http.MediaType; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -31,10 +32,10 @@ import de.thm.arsnova.services.StubUserService; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class LecturerQuestionControllerTest { @Autowired diff --git a/src/test/java/de/thm/arsnova/controller/LoginControllerTest.java b/src/test/java/de/thm/arsnova/controller/LoginControllerTest.java index c2e27a6bbd119c6b1700e5467f2898319b5e96ac..20a8e595b56628550e5f6d9934c0960f8024b5cb 100644 --- a/src/test/java/de/thm/arsnova/controller/LoginControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/LoginControllerTest.java @@ -33,6 +33,7 @@ import org.springframework.http.MediaType; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -47,10 +48,10 @@ import de.thm.arsnova.services.StubUserService; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class LoginControllerTest { @Autowired diff --git a/src/test/java/de/thm/arsnova/controller/SessionControllerTest.java b/src/test/java/de/thm/arsnova/controller/SessionControllerTest.java index 9918233f24ddcfa745d0b39e8df8718a4d082e22..0f0bb8f08424b57f199ea371b4a1f0e6d10029a0 100644 --- a/src/test/java/de/thm/arsnova/controller/SessionControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/SessionControllerTest.java @@ -18,6 +18,7 @@ import org.springframework.http.MediaType; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -32,10 +33,10 @@ import de.thm.arsnova.services.StubUserService; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class SessionControllerTest { @Autowired diff --git a/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java b/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java index a23f9132519aa94643d059d841ea7fff2c673a46..0c61f78f6a0b9de5715df12b25505513195f4a4e 100644 --- a/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java +++ b/src/test/java/de/thm/arsnova/controller/StatisticsControllerTest.java @@ -11,6 +11,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -23,10 +24,10 @@ import org.springframework.web.context.WebApplicationContext; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml", "file:src/test/resources/test-socketioconfig.xml" }) +@ActiveProfiles("test") public class StatisticsControllerTest { @Autowired diff --git a/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java b/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java index 671a7898c8ec41cb51ebfaef8e636db592d24e22..e399e8417c74988c7b346e94591c12c79566094b 100644 --- a/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java +++ b/src/test/java/de/thm/arsnova/services/FeedbackServiceTest.java @@ -40,7 +40,6 @@ import de.thm.arsnova.exceptions.NotFoundException; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml" }) @ActiveProfiles("test") diff --git a/src/test/java/de/thm/arsnova/services/QuestionServiceTest.java b/src/test/java/de/thm/arsnova/services/QuestionServiceTest.java index 1e94d025dafa1ba483568856ce1aad9e00a87895..e26dd7effd15c59db16167414ea31b0a1e6a1be2 100644 --- a/src/test/java/de/thm/arsnova/services/QuestionServiceTest.java +++ b/src/test/java/de/thm/arsnova/services/QuestionServiceTest.java @@ -48,7 +48,6 @@ import de.thm.arsnova.exceptions.NotFoundException; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml" }) @ActiveProfiles("test") diff --git a/src/test/java/de/thm/arsnova/services/SessionServiceTest.java b/src/test/java/de/thm/arsnova/services/SessionServiceTest.java index 9a2694032da8a431971f3bf5a34933037cbe4e94..bf365e01f424eaa720394ffe9077aa2d919f37f6 100644 --- a/src/test/java/de/thm/arsnova/services/SessionServiceTest.java +++ b/src/test/java/de/thm/arsnova/services/SessionServiceTest.java @@ -58,7 +58,6 @@ import de.thm.arsnova.exceptions.NotFoundException; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml" }) @ActiveProfiles("test") diff --git a/src/test/java/de/thm/arsnova/services/StatisticsServiceTest.java b/src/test/java/de/thm/arsnova/services/StatisticsServiceTest.java index 0ed3179fb0f020b38c6a4e281532efc0a8a84f0f..7affc751c2856c5bdb4430fd7a84f3edc8fb3a20 100644 --- a/src/test/java/de/thm/arsnova/services/StatisticsServiceTest.java +++ b/src/test/java/de/thm/arsnova/services/StatisticsServiceTest.java @@ -22,7 +22,6 @@ import de.thm.arsnova.entities.Statistics; @ContextConfiguration(locations = { "file:src/main/webapp/WEB-INF/spring/arsnova-servlet.xml", "file:src/main/webapp/WEB-INF/spring/spring-main.xml", - "file:src/main/webapp/WEB-INF/spring/spring-security.xml", "file:src/test/resources/test-config.xml" }) @ActiveProfiles("test") diff --git a/src/test/resources/test-config.xml b/src/test/resources/test-config.xml index 1da5cc9d310d3894a29db0740ee8842e93a2d000..dcef7e9a14d88a8f861b62060d97bf030e7c5c84 100644 --- a/src/test/resources/test-config.xml +++ b/src/test/resources/test-config.xml @@ -1,12 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" - xmlns:websocket="http://www.springframework.org/schema/websocket" - xmlns:security="http://www.springframework.org/schema/security" - xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd - http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket-4.0.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="servletContext" class="org.springframework.mock.web.MockServletContext"> <property name="contextPath" value="/" /> @@ -31,6 +26,7 @@ </property> </bean> + <!-- <security:authentication-manager> <security:authentication-provider> <security:user-service> @@ -39,4 +35,5 @@ </security:user-service> </security:authentication-provider> </security:authentication-manager> + --> </beans> diff --git a/src/test/resources/test-socketioconfig.xml b/src/test/resources/test-socketioconfig.xml index 844695c967c031e2b3900ce737c2ea0a5811944c..27d9112451ecdf6050c019e1e8d77cac279c2715 100644 --- a/src/test/resources/test-socketioconfig.xml +++ b/src/test/resources/test-socketioconfig.xml @@ -1,10 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="socketServer" class="de.thm.arsnova.socket.ARSnovaSocketIOServer" init-method="startServer" destroy-method="stopServer" scope="singleton"