Class CamelContextTestHelper
java.lang.Object
org.apache.camel.test.junit6.util.CamelContextTestHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJVM system property which can be set to true to turn on dumping route coverage statistics.static final StringJVM system property which can set the output directorystatic final StringJVM system property which can be set to true to turn on dumping routes as xml or yaml -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigureIncludeExcludePatterns(org.apache.camel.CamelContext context, String include, String exclude) Configure route filtering patternsstatic voidconfigurePropertiesComponent(org.apache.camel.CamelContext context, Properties extra, org.apache.camel.spi.PropertiesSource propertiesSource, Boolean ignore) Configure the PropertiesComponent from the given contextstatic org.apache.camel.CamelContextcreateCamelContext(org.apache.camel.spi.Registry registry) static voidenableAutoMocking(org.apache.camel.CamelContext context, String pattern, String mockAndSkipPattern) Enables auto mockingstatic voidenableAutoStub(org.apache.camel.CamelContext context, String pattern) Enables auto stubstatic StringgetRouteDump(String legacyDumpRoute) static Stringstatic booleanisRouteCoverageEnabled(boolean legacyDumpCoverage) static booleanisSkipAutoStartContext(TestExecutionConfiguration configuration) static org.apache.camel.component.mock.MockEndpointlookupEndpoint(org.apache.camel.CamelContext context, String uri, boolean create, String target) Lookup endpoint with the given URI on the contextstatic voidreplaceFromEndpoints(org.apache.camel.model.ModelCamelContext context, Map<String, String> fromEndpoints) Replaces the 'from' endpoints of the given context with the ones from the provided mapstatic voidsetupDebugger(org.apache.camel.CamelContext context, org.apache.camel.spi.Breakpoint breakpoint) static voidsetupRoutes(org.apache.camel.CamelContext context, org.apache.camel.RoutesBuilder[] builders) Configures routes on the given contextstatic voidstartCamelContext(org.apache.camel.CamelContext context) Start the given contextstatic voidstartCamelContextOrService(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService) Starts a CamelContext or a service managing the CamelContext.
-
Field Details
-
ROUTE_COVERAGE_ENABLED
JVM system property which can be set to true to turn on dumping route coverage statistics.- See Also:
-
ROUTE_DUMP_ENABLED
JVM system property which can be set to true to turn on dumping routes as xml or yaml- See Also:
-
ROUTE_DUMP_DIR
JVM system property which can set the output directory- See Also:
-
-
Method Details
-
createCamelContext
-
setupDebugger
public static void setupDebugger(org.apache.camel.CamelContext context, org.apache.camel.spi.Breakpoint breakpoint) -
setupRoutes
-
lookupEndpoint
public static org.apache.camel.component.mock.MockEndpoint lookupEndpoint(org.apache.camel.CamelContext context, String uri, boolean create, String target) Lookup endpoint with the given URI on the context- Parameters:
context- the context to lookup endpointsuri- the endpoint URIcreate- whether to create the endpoint if it does not existtarget- the query-stripped normalized URI- Returns:
- the MockEndpoint instance associated with the normalized URI (aka target)
-
enableAutoMocking
-
enableAutoStub
Enables auto stub -
configurePropertiesComponent
public static void configurePropertiesComponent(org.apache.camel.CamelContext context, Properties extra, org.apache.camel.spi.PropertiesSource propertiesSource, Boolean ignore) Configure the PropertiesComponent from the given context- Parameters:
context- the context with the PropertiesComponent to configureextra- override properties to use (if any)propertiesSource- custom properties source to use to load/lookup propertiesignore- whether to ignore missing properties locations
-
configureIncludeExcludePatterns
-
startCamelContext
-
startCamelContextOrService
public static void startCamelContextOrService(org.apache.camel.CamelContext context, org.apache.camel.Service camelContextService) throws Exception Starts a CamelContext or a service managing the CamelContext. The service takes priority if provided.- Parameters:
context- the context to startcamelContextService- the service managing the CamelContext- Throws:
Exception
-
replaceFromEndpoints
public static void replaceFromEndpoints(org.apache.camel.model.ModelCamelContext context, Map<String, String> fromEndpoints) throws ExceptionReplaces the 'from' endpoints of the given context with the ones from the provided map- Parameters:
context- the context to have the 'from' endpoints replacedfromEndpoints- the map with the new endpoint Uris- Throws:
Exception
-
isSkipAutoStartContext
-
isRouteCoverageEnabled
public static boolean isRouteCoverageEnabled(boolean legacyDumpCoverage) -
getRouteDump
-
getRouteDumpDir
-