@ContextConfiguration(locations="classpath:/META-INF/test_persistence.xml") public abstract class AbstractDbTest extends AbstractTest
AbstractTest
and adds support for test with database.Modifier and Type | Class and Description |
---|---|
static interface |
AbstractDbTest.MessageProcessor
Interface for defining processors that can affect
Message in one way or another. |
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
em |
protected org.springframework.orm.jpa.JpaTransactionManager |
jpaTransactionManager |
static String |
UNIT_NAME
Default database unit name of Hibernate.
|
Constructor and Description |
---|
AbstractDbTest() |
Modifier and Type | Method and Description |
---|---|
protected Message |
createAndSaveMessage(ExternalSystemExtEnum sourceSystem,
ServiceExtEnum service,
String operationName,
String payload) |
protected Message[] |
createAndSaveMessages(int messageCount,
AbstractDbTest.MessageProcessor initializer) |
protected Message[] |
createAndSaveMessages(int messageCount,
ExternalSystemExtEnum sourceSystem,
ServiceExtEnum service,
String operationName,
String payload) |
protected Message |
createMessage(ExternalSystemExtEnum sourceSystem,
ServiceExtEnum service,
String operationName,
String payload)
Creates new message.
|
protected org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate()
Gets
JdbcTemplate for test DB. |
void |
printEntities() |
assertErrorCode, assertXMLEqualWithInnerXML, configureXmlUnit, equalDateTime, getApplicationContext, getCamelContext, initRoutes, isDateTime, mockDirect, mockDirect, setInitAllRoutes, setPrivateField, throwException, validateMockito
public static final String UNIT_NAME
protected javax.persistence.EntityManager em
@Autowired @Qualifier(value="jpaTxManager") protected org.springframework.orm.jpa.JpaTransactionManager jpaTransactionManager
protected org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
JdbcTemplate
for test DB.public void printEntities()
protected Message createMessage(ExternalSystemExtEnum sourceSystem, ServiceExtEnum service, String operationName, String payload)
sourceSystem
- the source systemservice
- the serviceoperationName
- the operation namepayload
- the payloadprotected Message createAndSaveMessage(ExternalSystemExtEnum sourceSystem, ServiceExtEnum service, String operationName, String payload)
protected Message[] createAndSaveMessages(int messageCount, ExternalSystemExtEnum sourceSystem, ServiceExtEnum service, String operationName, String payload)
protected Message[] createAndSaveMessages(int messageCount, AbstractDbTest.MessageProcessor initializer)
Copyright © 2016. All rights reserved.