Java config 수정

master
mjkhan21 1 year ago
parent 92e8668188
commit ed839dde63

@ -19,22 +19,12 @@ import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import com.fasterxml.jackson.core.JsonParser.Feature; import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import cokr.xit.foundation.ApplicationContainer;
/** xit foundation Bean . /** xit foundation Bean .
* @author mjkhan * @author mjkhan
*/ */
@Configuration @Configuration
@ComponentScan(basePackages = "cokr.xit") @ComponentScan(basePackages = "cokr.xit")
public class CommonConfig { public class CommonConfig {
/**ApplicationContainer .
* @return ApplicationContainer
*/
@Bean
public ApplicationContainer applicationContainer() {
return new ApplicationContainer();
}
/**AntPathMatcher . /**AntPathMatcher .
* @return AntPathMatcher * @return AntPathMatcher
*/ */

@ -13,7 +13,6 @@ import org.springframework.test.context.ContextConfiguration;
* @author mjkhan * @author mjkhan
*/ */
@SpringBootApplication @SpringBootApplication
@ContextConfiguration("classpath:spring/context-*.xml")
@ImportAutoConfiguration({ @ImportAutoConfiguration({
CommonConfig.class, CommonConfig.class,
ServletConfig.class, ServletConfig.class,
@ -21,4 +20,5 @@ import org.springframework.test.context.ContextConfiguration;
DatasourceConfig.class, DatasourceConfig.class,
TransactionConfig.class, TransactionConfig.class,
}) })
@ContextConfiguration("classpath:spring/context-*.xml")
public class FoundationApplication {} public class FoundationApplication {}

@ -6,6 +6,7 @@ import java.util.stream.Stream;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTestContextBootstrapper; import org.springframework.boot.test.context.SpringBootTestContextBootstrapper;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.BootstrapWith; import org.springframework.test.context.BootstrapWith;
@ -24,6 +25,7 @@ import cokr.xit.foundation.test.TestMapper;
* </ul> * </ul>
* @author mjkhan * @author mjkhan
*/ */
@SpringBootTest
@ExtendWith(SpringExtension.class) @ExtendWith(SpringExtension.class)
@BootstrapWith(SpringBootTestContextBootstrapper.class) @BootstrapWith(SpringBootTestContextBootstrapper.class)
@ActiveProfiles("test") @ActiveProfiles("test")

Loading…
Cancel
Save