init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.eactive.eai.common.errorcode;
|
||||
|
||||
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.CoreJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CoreJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.common.errorcode" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.common.errorcode" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.errorcode" })
|
||||
@Sql({ "/com/eactive/eai/common/errorcode/init_tseaims01.sql" })
|
||||
class ErrorCodeManagerTest {
|
||||
|
||||
@Autowired
|
||||
ErrorCodeManager errorCodeManager;
|
||||
|
||||
@Test
|
||||
void testStart() throws LifecycleException {
|
||||
// given
|
||||
|
||||
// when
|
||||
errorCodeManager.start();
|
||||
|
||||
// then
|
||||
assertTrue(errorCodeManager.getAllCodeMessages().size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.common.server.loader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
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 com.eactive.eai.data.CoreJPATestConfiguration;
|
||||
import com.eactive.eai.data.entity.onl.server.EAIServer;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = CoreJPATestConfiguration.class)
|
||||
@ComponentScan("com.eactive.eai.common.server")
|
||||
@EntityScan("com.eactive.eai.data.entity.onl.server")
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.common.server" })
|
||||
class EAIServerEntityServiceTest {
|
||||
|
||||
@Autowired
|
||||
EAIServerLoader eaiServerEntityService;
|
||||
|
||||
@Test
|
||||
void testCheckConnection() {
|
||||
// given
|
||||
EAIServer eaiServer = new EAIServer();
|
||||
eaiServer.setEaisevrinstncname("test");
|
||||
eaiServer.setEaisevrip("test");
|
||||
eaiServerEntityService.save(eaiServer);
|
||||
|
||||
// when
|
||||
Boolean connected = eaiServerEntityService.checkConnection();
|
||||
// then
|
||||
assertThat(connected).isTrue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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 CoreJPATestConfiguration {
|
||||
|
||||
@Bean
|
||||
ApplicationContextProvider applicationContextProvider() {
|
||||
return new ApplicationContextProvider();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user