init
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.custom.stderrorcode;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
|
||||
import com.eactive.eai.common.lifecycle.LifecycleException;
|
||||
import com.eactive.eai.data.OnlineJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { OnlineJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.custom.stderrorcode" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.custom.stderrorcode" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.custom.stderrorcode" })
|
||||
@Sql({ "/com/eactive/eai/custom/stderrorcode/init_tseaimx06.sql" })
|
||||
class ChannelErrorCodeManagerTest {
|
||||
|
||||
@Autowired
|
||||
ChannelErrorCodeManager channelErrorCodeManager;
|
||||
|
||||
@Test
|
||||
void testStart() throws LifecycleException {
|
||||
// given
|
||||
|
||||
// when
|
||||
channelErrorCodeManager.start();
|
||||
|
||||
// then
|
||||
assertTrue(channelErrorCodeManager.getChannelErrorCode("BCIO00000_ITR") != null);
|
||||
assertTrue(channelErrorCodeManager.getChannelErrorCode("BCIO00009_MOB") == null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.custom.stderrorcode;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
|
||||
import com.eactive.eai.common.lifecycle.LifecycleException;
|
||||
import com.eactive.eai.data.OnlineJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { OnlineJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.custom.stderrorcode" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.custom.stderrorcode" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.custom.stderrorcode" })
|
||||
@Sql({ "/com/eactive/eai/custom/stderrorcode/init_tseaimx03.sql" })
|
||||
class StdErrorCodeManagerTest {
|
||||
|
||||
@Autowired
|
||||
StdErrorCodeManager stdErrorCodeManager;
|
||||
|
||||
@Test
|
||||
void testStart() throws LifecycleException {
|
||||
// given
|
||||
|
||||
// when
|
||||
stdErrorCodeManager.start();
|
||||
|
||||
// then
|
||||
assertTrue(stdErrorCodeManager.getSTDErrorCode("BCIO00000") != null);
|
||||
assertTrue(stdErrorCodeManager.getSTDErrorCode("BCIO00009") == null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.eactive.eai.data;
|
||||
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan({ "com.eactive.eai.data.property" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.data.property" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.property" })
|
||||
public class OnlineJPATestConfiguration {
|
||||
|
||||
@Bean
|
||||
ApplicationContextProvider applicationContextProvider() {
|
||||
return new ApplicationContextProvider();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user