@SpringBootTest(classes=TestConfig.class, webEnvironment=NONE) @ActiveProfiles(profiles="test") @DirtiesContext(classMode=AFTER_EACH_TEST_METHOD) @TestExecutionListeners(listeners=org.apache.camel.test.spring.CamelSpringTestContextLoaderTestExecutionListener.class, mergeMode=MERGE_WITH_DEFAULTS) public abstract class AbstractTest extends Object
Modifier and Type | Field and Description |
---|---|
static Locale |
DEFAULT_LOCALE |
Constructor and Description |
---|
AbstractTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertErrorCode(ErrorExtEnum error,
ErrorExtEnum expError)
Asserts
error codes . |
void |
configureXmlUnit() |
protected org.springframework.context.ApplicationContext |
getApplContext()
Gets Spring context.
|
protected org.apache.camel.model.ModelCamelContext |
getCamelContext()
Gets Camel context.
|
protected org.apache.camel.component.mock.MockEndpoint |
mockDirect(String uri)
Mocks a hand-over-type endpoint (direct, direct-vm, seda or vm)
by simply providing the other (consumer=From) side connected to a mock.
|
protected org.apache.camel.component.mock.MockEndpoint |
mockDirect(String uri,
String routeId)
Same as
mockDirect(String) , except with route ID to be able to override an existing route with the mock. |
void |
setDefaultLocale() |
static void |
setPrivateField(Object target,
String name,
Object value)
Sets value of private field.
|
void |
validateMockito() |
public static final Locale DEFAULT_LOCALE
public void setDefaultLocale()
public void configureXmlUnit()
public void validateMockito()
protected final org.apache.camel.model.ModelCamelContext getCamelContext()
protected final org.springframework.context.ApplicationContext getApplContext()
public static void setPrivateField(Object target, String name, Object value)
target
- the target objectname
- the field namevalue
- the value for setting to the fieldprotected org.apache.camel.component.mock.MockEndpoint mockDirect(String uri) throws Exception
There should be no consumer existing, i.e., the consumer route should not be started.
uri
- the URI a new mock should consume fromException
- if error occurs during mocking required routeprotected org.apache.camel.component.mock.MockEndpoint mockDirect(String uri, String routeId) throws Exception
mockDirect(String)
, except with route ID to be able to override an existing route with the mock.uri
- the URI a new mock should consume fromrouteId
- the route ID for the new mock route
(existing route with this ID will be overridden by this new route)Exception
- if error occurs during mocking required routeprotected void assertErrorCode(ErrorExtEnum error, ErrorExtEnum expError)
error codes
.error
- the actual error codeexpError
- the expected error codeCopyright © 2018 Pivotal Software, Inc.. All rights reserved.