[JAVA-961] Standardize packages in spring-security-modules: spring-security-rest

This commit is contained in:
dupirefr 2020-03-19 21:25:10 +01:00
parent a12f9e878a
commit b993d0762d
27 changed files with 45 additions and 46 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.errorhandling; package com.baeldung.errorhandling;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package org.baeldung.errorhandling; package com.baeldung.errorhandling;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.model; package com.baeldung.persistence.model;
import java.io.Serializable; import java.io.Serializable;

View File

@ -1,8 +1,8 @@
package org.baeldung.security; package com.baeldung.security;
import org.baeldung.security.web.MySavedRequestAwareAuthenticationSuccessHandler; import com.baeldung.security.web.MySavedRequestAwareAuthenticationSuccessHandler;
import org.baeldung.security.web.RestAuthenticationEntryPoint; import com.baeldung.security.web.RestAuthenticationEntryPoint;
import org.baeldung.web.error.CustomAccessDeniedHandler; import com.baeldung.web.error.CustomAccessDeniedHandler;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -20,7 +20,7 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationFa
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
@ComponentScan("org.baeldung.security") @ComponentScan("com.baeldung.security")
public class SecurityJavaConfig extends WebSecurityConfigurerAdapter { public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired

View File

@ -1,4 +1,4 @@
package org.baeldung.security; package com.baeldung.security;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring; package com.baeldung.spring;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;

View File

@ -1,10 +1,10 @@
package org.baeldung.spring; package com.baeldung.spring;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
// @Configuration // @Configuration
// @ImportResource({ "classpath:webSecurityConfig.xml" }) // @ImportResource({ "classpath:webSecurityConfig.xml" })
@ComponentScan("org.baeldung.security") @ComponentScan("com.baeldung.security")
public class SecurityXmlConfig { public class SecurityXmlConfig {
public SecurityXmlConfig() { public SecurityXmlConfig() {

View File

@ -1,4 +1,4 @@
package org.baeldung.spring; package com.baeldung.spring;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -12,7 +12,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration @Configuration
@ComponentScan("org.baeldung.web") @ComponentScan("com.baeldung.web")
@EnableWebMvc @EnableWebMvc
@EnableAsync @EnableAsync
public class WebConfig implements WebMvcConfigurer { public class WebConfig implements WebMvcConfigurer {

View File

@ -1,4 +1,4 @@
package org.baeldung.swagger2; package com.baeldung.swagger2;
import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Lists.newArrayList;
@ -25,7 +25,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket api() { public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).select() return new Docket(DocumentationType.SWAGGER_2).select()
.apis(RequestHandlerSelectors.basePackage("org.baeldung.web.controller")) .apis(RequestHandlerSelectors.basePackage("com.baeldung.web.controller"))
.paths(PathSelectors.ant("/foos/*")) .paths(PathSelectors.ant("/foos/*"))
.build() .build()
.apiInfo(apiInfo()) .apiInfo(apiInfo())

View File

@ -1,11 +1,11 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.baeldung.web.service.AsyncService; import com.baeldung.web.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
@ -6,7 +6,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.baeldung.persistence.model.Foo; import com.baeldung.persistence.model.Foo;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.controller; package com.baeldung.web.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.error; package com.baeldung.web.error;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DataIntegrityViolationException;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.exception; package com.baeldung.web.exception;
public final class MyResourceNotFoundException extends RuntimeException { public final class MyResourceNotFoundException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package org.baeldung.web.service; package com.baeldung.web.service;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.service; package com.baeldung.web.service;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;

View File

@ -30,7 +30,7 @@
</http> </http>
<beans:bean id="mySuccessHandler" <beans:bean id="mySuccessHandler"
class="org.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler" /> class="com.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler" />
<beans:bean id="myFailureHandler" <beans:bean id="myFailureHandler"
class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" /> class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" />

View File

@ -17,7 +17,7 @@
</context-param> </context-param>
<context-param> <context-param>
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.spring</param-value> <param-value>com.baeldung.spring</param-value>
</context-param> </context-param>
<listener> <listener>

View File

@ -1,8 +1,8 @@
package org.baeldung; package com.baeldung;
import org.baeldung.security.SecurityJavaConfig; import com.baeldung.security.SecurityJavaConfig;
import org.baeldung.spring.ClientWebConfig; import com.baeldung.spring.ClientWebConfig;
import org.baeldung.spring.WebConfig; import com.baeldung.spring.WebConfig;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;

View File

@ -1,10 +1,9 @@
package org.baeldung.errorhandling; package com.baeldung.errorhandling;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import org.baeldung.errorhandling.ApiError; import com.baeldung.web.TestConfig;
import org.baeldung.web.TestConfig;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -1,9 +1,9 @@
package org.baeldung.web; package com.baeldung.web;
import org.baeldung.security.SecurityJavaConfig; import com.baeldung.security.SecurityJavaConfig;
import org.baeldung.spring.ClientWebConfig; import com.baeldung.spring.ClientWebConfig;
import org.baeldung.spring.WebConfig; import com.baeldung.spring.WebConfig;
import org.baeldung.web.controller.AsyncController; import com.baeldung.web.controller.AsyncController;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.web; package com.baeldung.web;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;

View File

@ -1,4 +1,4 @@
package org.baeldung.web; package com.baeldung.web;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -7,7 +7,7 @@ import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@Configuration @Configuration
@ComponentScan({ "org.baeldung.web" }) @ComponentScan({ "com.baeldung.web" })
public class TestConfig { public class TestConfig {
@Bean @Bean