aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README.md2
-rw-r--r--pom.xml55
-rw-r--r--src/main/java/org/onap/aai/event/AbstractEventBusEndpoint.java4
-rw-r--r--src/main/java/org/onap/aai/event/EventBusComponent.java4
-rw-r--r--src/main/java/org/onap/aai/event/EventBusConsumer.java6
-rw-r--r--src/main/java/org/onap/aai/event/EventBusEndPoint.java36
-rw-r--r--src/main/java/org/onap/aai/event/EventBusProducer.java2
-rw-r--r--src/main/java/org/onap/aai/rest/RestClientComponent.java10
-rw-r--r--src/main/java/org/onap/aai/rest/RestClientConsumer.java2
-rw-r--r--src/main/java/org/onap/aai/rest/RestClientEndpoint.java29
-rw-r--r--src/main/java/org/onap/aai/rest/RestClientProducer.java3
-rw-r--r--src/main/resources/META-INF/services/org/apache/camel/component/event-bus1
-rw-r--r--src/main/resources/META-INF/services/org/apache/camel/component/rest-client1
-rw-r--r--src/test/java/org/onap/aai/event/EventBusTest.java19
-rw-r--r--src/test/java/org/onap/aai/event/TestCamelContext.java1022
-rw-r--r--src/test/java/org/onap/aai/rest/RestClientTest.java17
17 files changed, 298 insertions, 916 deletions
diff --git a/.gitignore b/.gitignore
index af81fcf..c0bcb0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ logs/
debug-logs/
.idea
*.iml
+src/generated
diff --git a/README.md b/README.md
index 97fe808..e773a2f 100644
--- a/README.md
+++ b/README.md
@@ -99,7 +99,7 @@ console as the content body for the REST request.
<!-- Invoke the REST client, using our console input as the content body of our request. -->
<!-- Note that we provide the paths to the client certificate and keystore, as well as -->
<!-- the obfuscated password for the keystore. -->
- <to uri="rest-client:put?ecompClientCert=c:/dev/dl_microservice/target/swm/package/nix/dist_files/opt/app/ajsc-aai-data-layer-microservice/bundleconfig/etc/auth/aai-client-cert.p12&amp;ecompKeystore=c:/dev/dl_microservice/target/swm/package/nix/dist_files/opt/app/ajsc-aai-data-layer-microservice/bundleconfig/etc/auth/tomcat_keystore&amp;ecompKeystorePassword=70c87528c88dcd9f9c2558d30e817868"/>
+ <to uri="ecomp-rest:put?ecompClientCert=c:/dev/dl_microservice/target/swm/package/nix/dist_files/opt/app/ajsc-aai-data-layer-microservice/bundleconfig/etc/auth/aai-client-cert.p12&amp;ecompKeystore=c:/dev/dl_microservice/target/swm/package/nix/dist_files/opt/app/ajsc-aai-data-layer-microservice/bundleconfig/etc/auth/tomcat_keystore&amp;ecompKeystorePassword=70c87528c88dcd9f9c2558d30e817868"/>
<to uri="stream:out" />
</route>
diff --git a/pom.xml b/pom.xml
index c9fadce..b02fc5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@ limitations under the License.
<event.client.version>1.6.4</event.client.version>
<!-- Sonar Properties -->
<jacoco.line.coverage.limit>0.70</jacoco.line.coverage.limit>
- <camel-spring-boot.version>2.22.1</camel-spring-boot.version>
+ <camel-spring-boot.version>3.4.0</camel-spring-boot.version>
</properties>
<dependencies>
@@ -48,11 +48,6 @@ limitations under the License.
<version>${camel-spring-boot.version}</version>
</dependency>
<!-- support camel documentation -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>apt</artifactId>
- <version>${camel-spring-boot.version}</version>
- </dependency>
<!-- logging -->
<dependency>
<groupId>org.onap.aai.logging-service</groupId>
@@ -143,9 +138,55 @@ limitations under the License.
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <configuration combine.self="append">
+ <excludes>
+ <exclude>**/*Configurer.class</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-package-maven-plugin</artifactId>
+ <version>${camel-spring-boot.version}</version>
+ <executions>
+ <execution>
+ <id>generate</id>
+ <goals>
+ <goal>generate-component</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>add-source</goal>
+ <goal>add-resource</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/generated/java</source>
+ </sources>
+ <resources>
+ <resource>
+ <directory>src/generated/resources</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.5.1</version>
+ <version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/src/main/java/org/onap/aai/event/AbstractEventBusEndpoint.java b/src/main/java/org/onap/aai/event/AbstractEventBusEndpoint.java
index 9a5abee..7295a9a 100644
--- a/src/main/java/org/onap/aai/event/AbstractEventBusEndpoint.java
+++ b/src/main/java/org/onap/aai/event/AbstractEventBusEndpoint.java
@@ -21,7 +21,7 @@
package org.onap.aai.event;
import org.apache.camel.Component;
-import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.support.DefaultEndpoint;
public abstract class AbstractEventBusEndpoint extends DefaultEndpoint {
@@ -29,7 +29,7 @@ public abstract class AbstractEventBusEndpoint extends DefaultEndpoint {
super(endpointUri, component);
}
- abstract void close() throws Exception;
+ abstract void end() throws Exception;
abstract int getPollingDelay();
abstract int getPoolSize();
abstract String getEventTopic();
diff --git a/src/main/java/org/onap/aai/event/EventBusComponent.java b/src/main/java/org/onap/aai/event/EventBusComponent.java
index 766382b..cbe4605 100644
--- a/src/main/java/org/onap/aai/event/EventBusComponent.java
+++ b/src/main/java/org/onap/aai/event/EventBusComponent.java
@@ -24,8 +24,10 @@ import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
+import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.spi.annotations.Component;
+@Component("event-bus")
public class EventBusComponent extends DefaultComponent {
public EventBusComponent() {
super();
diff --git a/src/main/java/org/onap/aai/event/EventBusConsumer.java b/src/main/java/org/onap/aai/event/EventBusConsumer.java
index b189cfd..bc698df 100644
--- a/src/main/java/org/onap/aai/event/EventBusConsumer.java
+++ b/src/main/java/org/onap/aai/event/EventBusConsumer.java
@@ -25,7 +25,7 @@ import org.onap.aai.event.api.EventConsumer;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
-import org.apache.camel.impl.ScheduledPollConsumer;
+import org.apache.camel.support.ScheduledPollConsumer;
import org.onap.aai.logging.RouterCoreMsgs;
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
@@ -96,14 +96,14 @@ public class EventBusConsumer extends ScheduledPollConsumer {
protected void doStop() throws Exception {
super.doStop();
if (endpoint != null) {
- endpoint.close();
+ endpoint.end();
}
}
@Override
protected void doShutdown() throws Exception {
super.doShutdown();
if (endpoint != null) {
- endpoint.close();
+ endpoint.end();
}
}
diff --git a/src/main/java/org/onap/aai/event/EventBusEndPoint.java b/src/main/java/org/onap/aai/event/EventBusEndPoint.java
index 621b30f..5ea6a67 100644
--- a/src/main/java/org/onap/aai/event/EventBusEndPoint.java
+++ b/src/main/java/org/onap/aai/event/EventBusEndPoint.java
@@ -20,34 +20,40 @@
*/
package org.onap.aai.event;
+import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.aai.event.api.EventConsumer;
import org.onap.aai.event.api.EventPublisher;
@UriEndpoint(scheme = "event-bus", syntax = "event-bus:name",
-consumerClass = EventBusConsumer.class, title = "event-bus")
+consumerClass = EventBusConsumer.class, title = "event-bus",
+firstVersion = "1.0.0", category = {Category.CORE})
public class EventBusEndPoint extends AbstractEventBusEndpoint {
- @UriParam(label = "eventTopic")
- @Metadata(required = "true")
+
+ @UriPath(description = "client name")
+ private String name;
+ @UriParam(label = "eventTopic", description = "event topic")
+ @Metadata(required = true)
private String eventTopic;
- @UriParam(label = "poolSize")
- @Metadata(required = "true", defaultValue="20")
+ @UriParam(label = "poolSize", description = "pool size")
+ @Metadata(required = true, defaultValue="20")
private int poolSize = 20;
- @UriParam(label = "pollingDelay")
- @Metadata(required = "true", defaultValue="30000")
+ @UriParam(label = "pollingDelay", description = "polling delay")
+ @Metadata(required = true, defaultValue="30000")
private int pollingDelay = 30000;
-
+
EventConsumer consumer; //This would be injected via bean through camel route when passed with #
-
+
EventPublisher publisher; //This would be injected via bean through camel route when passed with #
-
+
private Logger logger = LoggerFactory.getInstance().getLogger(EventBusEndPoint.class);
public EventBusEndPoint(String uri, EventBusComponent component) {
@@ -69,7 +75,7 @@ public class EventBusEndPoint extends AbstractEventBusEndpoint {
return false;
}
- void close() throws Exception {
+ void end() throws Exception {
if(consumer != null)
consumer.close();
if(publisher != null)
@@ -94,6 +100,14 @@ public class EventBusEndPoint extends AbstractEventBusEndpoint {
return eventTopic;
}
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
public void setEventTopic(String eventTopic) {
this.eventTopic = eventTopic;
}
diff --git a/src/main/java/org/onap/aai/event/EventBusProducer.java b/src/main/java/org/onap/aai/event/EventBusProducer.java
index dfd1bfe..86118ce 100644
--- a/src/main/java/org/onap/aai/event/EventBusProducer.java
+++ b/src/main/java/org/onap/aai/event/EventBusProducer.java
@@ -21,7 +21,7 @@
package org.onap.aai.event;
import org.apache.camel.Exchange;
-import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.support.DefaultProducer;
import org.onap.aai.event.api.EventPublisher;
/**
diff --git a/src/main/java/org/onap/aai/rest/RestClientComponent.java b/src/main/java/org/onap/aai/rest/RestClientComponent.java
index ec39829..13023fe 100644
--- a/src/main/java/org/onap/aai/rest/RestClientComponent.java
+++ b/src/main/java/org/onap/aai/rest/RestClientComponent.java
@@ -22,7 +22,8 @@ package org.onap.aai.rest;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
-import org.apache.camel.impl.UriEndpointComponent;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
import java.util.Map;
@@ -30,14 +31,15 @@ import java.util.Map;
/**
* Represents the component that manages {@link RestClientEndpoint}.
*/
-public class RestClientComponent extends UriEndpointComponent {
+@Component("ecomp-rest")
+public class RestClientComponent extends DefaultComponent {
public RestClientComponent() {
- super(RestClientEndpoint.class);
+ super();
}
public RestClientComponent(CamelContext context) {
- super(context, RestClientEndpoint.class);
+ super(context);
}
@Override
diff --git a/src/main/java/org/onap/aai/rest/RestClientConsumer.java b/src/main/java/org/onap/aai/rest/RestClientConsumer.java
index 0c733a6..41373e2 100644
--- a/src/main/java/org/onap/aai/rest/RestClientConsumer.java
+++ b/src/main/java/org/onap/aai/rest/RestClientConsumer.java
@@ -21,7 +21,7 @@
package org.onap.aai.rest;
import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultConsumer;
+import org.apache.camel.support.DefaultConsumer;
/**
diff --git a/src/main/java/org/onap/aai/rest/RestClientEndpoint.java b/src/main/java/org/onap/aai/rest/RestClientEndpoint.java
index 06c9e0b..e39a9ca 100644
--- a/src/main/java/org/onap/aai/rest/RestClientEndpoint.java
+++ b/src/main/java/org/onap/aai/rest/RestClientEndpoint.java
@@ -20,10 +20,11 @@
*/
package org.onap.aai.rest;
+import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
-import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.support.DefaultEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
@@ -32,11 +33,9 @@ import org.apache.camel.spi.UriPath;
import java.util.Map;
-/**
- * Represents a RestClient endpoint.
- */
@UriEndpoint(scheme = "ecomp-rest", syntax = "ecomp-rest:op",
- consumerClass = RestClientConsumer.class, label = "RestClient2", title = "")
+ consumerClass = RestClientConsumer.class, label = "RestClient2", title = "ecomp-rest",
+ firstVersion = "1.0.0", category = {Category.CORE})
public class RestClientEndpoint extends DefaultEndpoint {
public static final String CONTEXT_PARAM_CLIENT_CERT = "ecomp-client-cert";
@@ -48,32 +47,24 @@ public class RestClientEndpoint extends DefaultEndpoint {
public static final String OUT_HEADER_RESPONSE_CODE = "ecomp-response-code";
public static final String OUT_HEADER_RESPONSE_MSG = "ecomp-response-message";
- @UriPath
- @Metadata(required = "true")
+ @UriPath(description = "op")
+ @Metadata(required = true)
private String op;
-
- @UriParam
+ @UriParam(description = "ecomp client cert")
private String ecompClientCert;
-
- @UriParam
+ @UriParam(description = "ecomp key store")
private String ecompKeystore;
-
- @UriParam
+ @UriParam(description = "ecomp key store passwd")
private String ecompKeystorePassword;
-
public RestClientEndpoint() {}
public RestClientEndpoint(String uri, RestClientComponent component) {
super(uri, component);
}
- public RestClientEndpoint(String endpointUri) {
- super(endpointUri);
- }
-
@Override
- protected void setProperties(Object bean, Map<String, Object> parameters) throws Exception {
+ public void setProperties(Object bean, Map<String, Object> parameters) {
super.setProperties(bean, parameters);
}
diff --git a/src/main/java/org/onap/aai/rest/RestClientProducer.java b/src/main/java/org/onap/aai/rest/RestClientProducer.java
index 5062018..ccb8b89 100644
--- a/src/main/java/org/onap/aai/rest/RestClientProducer.java
+++ b/src/main/java/org/onap/aai/rest/RestClientProducer.java
@@ -21,9 +21,8 @@
package org.onap.aai.rest;
import org.apache.camel.Exchange;
-import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.support.DefaultProducer;
import org.eclipse.jetty.util.security.Password;
-import org.onap.aai.event.EventBusConsumer;
import org.onap.aai.restclient.client.Headers;
import org.onap.aai.restclient.client.OperationResult;
import org.onap.aai.restclient.client.RestClient;
diff --git a/src/main/resources/META-INF/services/org/apache/camel/component/event-bus b/src/main/resources/META-INF/services/org/apache/camel/component/event-bus
deleted file mode 100644
index f795067..0000000
--- a/src/main/resources/META-INF/services/org/apache/camel/component/event-bus
+++ /dev/null
@@ -1 +0,0 @@
-class=org.onap.aai.event.EventBusComponent
diff --git a/src/main/resources/META-INF/services/org/apache/camel/component/rest-client b/src/main/resources/META-INF/services/org/apache/camel/component/rest-client
deleted file mode 100644
index 375dcd7..0000000
--- a/src/main/resources/META-INF/services/org/apache/camel/component/rest-client
+++ /dev/null
@@ -1 +0,0 @@
-class=org.onap.aai.rest.RestClientComponent
diff --git a/src/test/java/org/onap/aai/event/EventBusTest.java b/src/test/java/org/onap/aai/event/EventBusTest.java
index e535bf3..4fa9e91 100644
--- a/src/test/java/org/onap/aai/event/EventBusTest.java
+++ b/src/test/java/org/onap/aai/event/EventBusTest.java
@@ -20,6 +20,7 @@
*/
package org.onap.aai.event;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -27,13 +28,12 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
+import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.Processor;
-import org.apache.camel.impl.DefaultMessage;
-import org.apache.camel.impl.MessageSupport;
-import org.apache.kafka.clients.consumer.ConsumerRecords;
+import org.apache.camel.support.DefaultMessage;
+import org.apache.camel.support.MessageSupport;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,7 +52,7 @@ public class EventBusTest {
public EventPublisher publisher;
@Mock
- public CamelContext context;
+ public ExtendedCamelContext context;
@Mock
public Processor processor;
@@ -74,20 +74,23 @@ public class EventBusTest {
@Test
public void validateProducer() throws Exception {
- EventBusComponent rc = new EventBusComponent();
+ String clientName = "client name";
+ EventBusComponent rc = new EventBusComponent();
EventBusEndPoint endpoint = new EventBusEndPoint("http://host.com:8443/endpoint", rc);
+ endpoint.setName(clientName);
endpoint.setEventTopic("eventTopic");
endpoint.setPublisher(publisher);
endpoint.setPoolSize(45);
endpoint.setPollingDelay(10);
-
+
+ assertEquals(clientName, endpoint.getName());
assertTrue(endpoint.getEventTopic().compareTo("eventTopic") == 0);
assertTrue(endpoint.getPoolSize() == 45);
assertTrue(endpoint.getPollingDelay() == 10);
assertFalse(endpoint.isSingleton());
EventBusProducer producer = (EventBusProducer)endpoint.createProducer();
assertTrue(producer.getEndpoint() != null);
- endpoint.close();
+ endpoint.end();
}
@Test
diff --git a/src/test/java/org/onap/aai/event/TestCamelContext.java b/src/test/java/org/onap/aai/event/TestCamelContext.java
index 1315bd9..718e599 100644
--- a/src/test/java/org/onap/aai/event/TestCamelContext.java
+++ b/src/test/java/org/onap/aai/event/TestCamelContext.java
@@ -21,26 +21,20 @@
package org.onap.aai.event;
-import java.io.IOException;
-import java.io.InputStream;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.ConsumerTemplate;
import org.apache.camel.Endpoint;
-import org.apache.camel.ErrorHandlerFactory;
import org.apache.camel.FluentProducerTemplate;
-import org.apache.camel.NoFactoryAvailableException;
-import org.apache.camel.PollingConsumer;
+import org.apache.camel.GlobalEndpointConfiguration;
+import org.apache.camel.NoSuchLanguageException;
import org.apache.camel.Processor;
-import org.apache.camel.Producer;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.Route;
import org.apache.camel.RoutesBuilder;
@@ -49,312 +43,188 @@ import org.apache.camel.ShutdownRoute;
import org.apache.camel.ShutdownRunningTask;
import org.apache.camel.StartupListener;
import org.apache.camel.TypeConverter;
-import org.apache.camel.api.management.mbean.ManagedCamelContextMBean;
-import org.apache.camel.api.management.mbean.ManagedProcessorMBean;
-import org.apache.camel.api.management.mbean.ManagedRouteMBean;
-import org.apache.camel.builder.ErrorHandlerBuilder;
-import org.apache.camel.health.HealthCheckRegistry;
-import org.apache.camel.impl.DefaultHeadersMapFactory;
-import org.apache.camel.model.DataFormatDefinition;
-import org.apache.camel.model.HystrixConfigurationDefinition;
-import org.apache.camel.model.ProcessorDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.model.RoutesDefinition;
-import org.apache.camel.model.cloud.ServiceCallConfigurationDefinition;
-import org.apache.camel.model.rest.RestDefinition;
-import org.apache.camel.model.rest.RestsDefinition;
-import org.apache.camel.model.transformer.TransformerDefinition;
-import org.apache.camel.model.validator.ValidatorDefinition;
-import org.apache.camel.runtimecatalog.RuntimeCamelCatalog;
-import org.apache.camel.spi.AsyncProcessorAwaitManager;
+import org.apache.camel.ValueHolder;
import org.apache.camel.spi.CamelContextNameStrategy;
import org.apache.camel.spi.ClassResolver;
import org.apache.camel.spi.DataFormat;
-import org.apache.camel.spi.DataFormatResolver;
import org.apache.camel.spi.DataType;
import org.apache.camel.spi.Debugger;
import org.apache.camel.spi.EndpointRegistry;
-import org.apache.camel.spi.EndpointStrategy;
import org.apache.camel.spi.ExecutorServiceManager;
-import org.apache.camel.spi.ExecutorServiceStrategy;
-import org.apache.camel.spi.FactoryFinder;
-import org.apache.camel.spi.FactoryFinderResolver;
-import org.apache.camel.spi.HeadersMapFactory;
import org.apache.camel.spi.InflightRepository;
import org.apache.camel.spi.Injector;
-import org.apache.camel.spi.InterceptStrategy;
import org.apache.camel.spi.Language;
import org.apache.camel.spi.LifecycleStrategy;
-import org.apache.camel.spi.LogListener;
-import org.apache.camel.spi.ManagementMBeanAssembler;
import org.apache.camel.spi.ManagementNameStrategy;
import org.apache.camel.spi.ManagementStrategy;
import org.apache.camel.spi.MessageHistoryFactory;
-import org.apache.camel.spi.ModelJAXBContextFactory;
-import org.apache.camel.spi.NodeIdFactory;
-import org.apache.camel.spi.PackageScanClassResolver;
-import org.apache.camel.spi.ProcessorFactory;
+import org.apache.camel.spi.PropertiesComponent;
import org.apache.camel.spi.Registry;
-import org.apache.camel.spi.ReloadStrategy;
import org.apache.camel.spi.RestConfiguration;
import org.apache.camel.spi.RestRegistry;
import org.apache.camel.spi.RouteController;
import org.apache.camel.spi.RoutePolicyFactory;
-import org.apache.camel.spi.RouteStartupOrder;
+
import org.apache.camel.spi.RuntimeEndpointRegistry;
-import org.apache.camel.spi.ServicePool;
+
import org.apache.camel.spi.ShutdownStrategy;
import org.apache.camel.spi.StreamCachingStrategy;
+import org.apache.camel.spi.Tracer;
import org.apache.camel.spi.Transformer;
import org.apache.camel.spi.TransformerRegistry;
import org.apache.camel.spi.TypeConverterRegistry;
-import org.apache.camel.spi.UnitOfWorkFactory;
import org.apache.camel.spi.UuidGenerator;
import org.apache.camel.spi.Validator;
import org.apache.camel.spi.ValidatorRegistry;
-import org.apache.camel.util.LoadPropertiesException;
-import org.apache.camel.util.jsse.SSLContextParameters;
-
-public class TestCamelContext implements CamelContext {
-
- @Override
- public void suspend() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void resume() throws Exception {
- // TODO Auto-generated method stub
+import org.apache.camel.support.jsse.SSLContextParameters;
- }
-
- @Override
- public boolean isSuspended() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void setStreamCaching(Boolean cache) {
- // TODO Auto-generated method stub
- }
-
- @Override
- public Boolean isStreamCaching() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setTracing(Boolean tracing) {
- // TODO Auto-generated method stub
+public class TestCamelContext implements CamelContext {
- }
@Override
- public Boolean isTracing() {
+ public <T extends CamelContext> T adapt(Class<T> type) {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setMessageHistory(Boolean messageHistory) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Boolean isMessageHistory() {
+ public <T> T getExtension(Class<T> type) {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setHandleFault(Boolean handleFault) {
+ public <T> void setExtension(Class<T> type, T module) {
// TODO Auto-generated method stub
-
}
@Override
- public Boolean isHandleFault() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setDelayer(Long delay) {
+ public boolean isVetoStarted() {
// TODO Auto-generated method stub
-
+ return false;
}
@Override
- public Long getDelayer() {
+ public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setAutoStartup(Boolean autoStartup) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Boolean isAutoStartup() {
+ public CamelContextNameStrategy getNameStrategy() {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setShutdownRoute(ShutdownRoute shutdownRoute) {
+ public void setNameStrategy(CamelContextNameStrategy nameStrategy) {
// TODO Auto-generated method stub
-
}
@Override
- public ShutdownRoute getShutdownRoute() {
+ public ManagementNameStrategy getManagementNameStrategy() {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
+ public void setManagementNameStrategy(ManagementNameStrategy nameStrategy) {
// TODO Auto-generated method stub
-
}
@Override
- public ShutdownRunningTask getShutdownRunningTask() {
+ public String getManagementName() {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setAllowUseOriginalMessage(Boolean allowUseOriginalMessage) {
+ public void setManagementName(String name) {
// TODO Auto-generated method stub
-
}
@Override
- public Boolean isAllowUseOriginalMessage() {
+ public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
- public <T extends CamelContext> T adapt(Class<T> type) {
+ public String getUptime() {
// TODO Auto-generated method stub
return null;
}
@Override
- public void start() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stop() throws Exception {
+ public long getUptimeMillis() {
// TODO Auto-generated method stub
-
+ return 0;
}
@Override
- public String getName() {
+ public Date getStartDate() {
// TODO Auto-generated method stub
return null;
}
@Override
- public CamelContextNameStrategy getNameStrategy() {
+ public void addService(Object object) throws Exception {
// TODO Auto-generated method stub
- return null;
}
@Override
- public void setNameStrategy(CamelContextNameStrategy nameStrategy) {
+ public void addService(Object object, boolean stopOnShutdown) throws Exception {
// TODO Auto-generated method stub
-
}
@Override
- public ManagementNameStrategy getManagementNameStrategy() {
+ public void addService(Object object, boolean stopOnShutdown, boolean forceStart) throws Exception {
// TODO Auto-generated method stub
- return null;
}
@Override
- public void setManagementNameStrategy(ManagementNameStrategy nameStrategy) {
+ public void addPrototypeService(Object object) throws Exception {
// TODO Auto-generated method stub
-
}
@Override
- public String getManagementName() {
+ public boolean removeService(Object object) throws Exception {
// TODO Auto-generated method stub
- return null;
+ return false;
}
@Override
- public String getVersion() {
+ public boolean hasService(Object object) {
// TODO Auto-generated method stub
- return null;
+ return false;
}
@Override
- public ServiceStatus getStatus() {
+ public <T> T hasService(Class<T> type) {
// TODO Auto-generated method stub
return null;
}
@Override
- public String getUptime() {
+ public <T> Set<T> hasServices(Class<T> type) {
// TODO Auto-generated method stub
return null;
}
@Override
- public void addService(Object object) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addService(Object object, boolean closeOnShutdown) throws Exception {
+ public void deferStartService(Object object, boolean stopOnShutdown) throws Exception {
// TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean removeService(Object object) throws Exception {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean hasService(Object object) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public <T> T hasService(Class<T> type) {
- // TODO Auto-generated method stub
- return null;
}
@Override
public void addStartupListener(StartupListener listener) throws Exception {
// TODO Auto-generated method stub
-
}
@Override
public void addComponent(String componentName, Component component) {
// TODO Auto-generated method stub
-
}
@Override
@@ -376,6 +246,12 @@ public class TestCamelContext implements CamelContext {
}
@Override
+ public Component getComponent(String name, boolean autoCreateComponents, boolean autoStart) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
public <T extends Component> T getComponent(String name, Class<T> componentType) {
// TODO Auto-generated method stub
return null;
@@ -394,7 +270,7 @@ public class TestCamelContext implements CamelContext {
}
@Override
- public EndpointRegistry<String> getEndpointRegistry() {
+ public EndpointRegistry<? extends ValueHolder<String>> getEndpointRegistry() {
// TODO Auto-generated method stub
return null;
}
@@ -406,6 +282,12 @@ public class TestCamelContext implements CamelContext {
}
@Override
+ public Endpoint getEndpoint(String uri, Map<String, Object> parameters) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
public <T extends Endpoint> T getEndpoint(String name, Class<T> endpointType) {
// TODO Auto-generated method stub
return null;
@@ -438,1213 +320,655 @@ public class TestCamelContext implements CamelContext {
@Override
public void removeEndpoint(Endpoint endpoint) throws Exception {
// TODO Auto-generated method stub
-
}
@Override
public Collection<Endpoint> removeEndpoints(String pattern) throws Exception {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void addRegisterEndpointCallback(EndpointStrategy strategy) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setupRoutes(boolean done) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public List<RouteDefinition> getRouteDefinitions() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public RouteDefinition getRouteDefinition(String id) {
- // TODO Auto-generated method stub
return null;
}
@Override
- public List<RestDefinition> getRestDefinitions() {
- // TODO Auto-generated method stub
+ public GlobalEndpointConfiguration getGlobalEndpointConfiguration() {
return null;
}
@Override
- public void addRestDefinitions(Collection<RestDefinition> restDefinitions) throws Exception {
- // TODO Auto-generated method stub
+ public void setRouteController(RouteController routeController) {
}
@Override
- public void setRestConfiguration(RestConfiguration restConfiguration) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public RestConfiguration getRestConfiguration() {
- // TODO Auto-generated method stub
+ public RouteController getRouteController() {
return null;
}
@Override
- public List<RouteStartupOrder> getRouteStartupOrder() {
- // TODO Auto-generated method stub
+ public List<Route> getRoutes() {
return null;
}
@Override
- public List<Route> getRoutes() {
- // TODO Auto-generated method stub
- return null;
+ public int getRoutesSize() {
+ return 0;
}
@Override
public Route getRoute(String id) {
- // TODO Auto-generated method stub
return null;
}
@Override
- public void addRoutes(RoutesBuilder builder) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public RoutesDefinition loadRoutesDefinition(InputStream is) throws Exception {
- // TODO Auto-generated method stub
+ public Processor getProcessor(String id) {
return null;
}
@Override
- public void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addRouteDefinition(RouteDefinition routeDefinition) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void startRoute(RouteDefinition route) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void startAllRoutes() throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void startRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stopRoute(RouteDefinition route) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stopRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout)
- throws Exception {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void shutdownRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
-
+ public <T extends Processor> T getProcessor(String id, Class<T> type) {
+ return null;
}
@Override
- public void shutdownRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception {
- // TODO Auto-generated method stub
+ public void addRoutes(RoutesBuilder builder) throws Exception {
}
@Override
public boolean removeRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
return false;
}
@Override
- public void resumeRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
+ public void addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory) {
}
@Override
- public void suspendRoute(String routeId) throws Exception {
- // TODO Auto-generated method stub
-
+ public List<RoutePolicyFactory> getRoutePolicyFactories() {
+ return null;
}
@Override
- public void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception {
- // TODO Auto-generated method stub
+ public void setRestConfiguration(RestConfiguration restConfiguration) {
}
@Override
- public ServiceStatus getRouteStatus(String routeId) {
- // TODO Auto-generated method stub
+ public RestConfiguration getRestConfiguration() {
return null;
}
@Override
- public boolean isStartingRoutes() {
- // TODO Auto-generated method stub
- return false;
+ public RestRegistry getRestRegistry() {
+ return null;
}
@Override
- public boolean isSetupRoutes() {
- // TODO Auto-generated method stub
- return false;
+ public void setRestRegistry(RestRegistry restRegistry) {
+
}
@Override
public TypeConverter getTypeConverter() {
- // TODO Auto-generated method stub
return null;
}
@Override
public TypeConverterRegistry getTypeConverterRegistry() {
- // TODO Auto-generated method stub
return null;
}
@Override
+ public void setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry) {
+
+ }
+
+ @Override
public Registry getRegistry() {
- // TODO Auto-generated method stub
return null;
}
@Override
public <T> T getRegistry(Class<T> type) {
- // TODO Auto-generated method stub
return null;
}
@Override
public Injector getInjector() {
- // TODO Auto-generated method stub
return null;
}
@Override
- public ManagementMBeanAssembler getManagementMBeanAssembler() {
- // TODO Auto-generated method stub
- return null;
+ public void setInjector(Injector injector) {
+
}
@Override
public List<LifecycleStrategy> getLifecycleStrategies() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void addLifecycleStrategy(LifecycleStrategy lifecycleStrategy) {
- // TODO Auto-generated method stub
}
@Override
- public Language resolveLanguage(String language) {
- // TODO Auto-generated method stub
+ public Language resolveLanguage(String language) throws NoSuchLanguageException {
return null;
}
@Override
- public String resolvePropertyPlaceholders(String text) throws Exception {
- // TODO Auto-generated method stub
+ public String resolvePropertyPlaceholders(String text) {
return null;
}
@Override
- public String getPropertyPrefixToken() {
- // TODO Auto-generated method stub
+ public PropertiesComponent getPropertiesComponent() {
return null;
}
@Override
- public String getPropertySuffixToken() {
- // TODO Auto-generated method stub
- return null;
+ public void setPropertiesComponent(PropertiesComponent propertiesComponent) {
+
}
@Override
public List<String> getLanguageNames() {
- // TODO Auto-generated method stub
return null;
}
@Override
public ProducerTemplate createProducerTemplate() {
- // TODO Auto-generated method stub
return null;
}
@Override
public ProducerTemplate createProducerTemplate(int maximumCacheSize) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ConsumerTemplate createConsumerTemplate() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ConsumerTemplate createConsumerTemplate(int maximumCacheSize) {
- // TODO Auto-generated method stub
return null;
}
@Override
- public void addInterceptStrategy(InterceptStrategy interceptStrategy) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public List<InterceptStrategy> getInterceptStrategies() {
- // TODO Auto-generated method stub
+ public FluentProducerTemplate createFluentProducerTemplate() {
return null;
}
@Override
- public ErrorHandlerBuilder getErrorHandlerBuilder() {
- // TODO Auto-generated method stub
+ public FluentProducerTemplate createFluentProducerTemplate(int maximumCacheSize) {
return null;
}
@Override
- public void setErrorHandlerBuilder(ErrorHandlerFactory errorHandlerBuilder) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public ScheduledExecutorService getErrorHandlerExecutorService() {
- // TODO Auto-generated method stub
+ public ConsumerTemplate createConsumerTemplate() {
return null;
}
@Override
- public void setDataFormats(Map<String, DataFormatDefinition> dataFormats) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Map<String, DataFormatDefinition> getDataFormats() {
- // TODO Auto-generated method stub
+ public ConsumerTemplate createConsumerTemplate(int maximumCacheSize) {
return null;
}
@Override
public DataFormat resolveDataFormat(String name) {
- // TODO Auto-generated method stub
return null;
}
@Override
- public DataFormatDefinition resolveDataFormatDefinition(String name) {
- // TODO Auto-generated method stub
+ public DataFormat createDataFormat(String name) {
return null;
}
@Override
- public DataFormatResolver getDataFormatResolver() {
- // TODO Auto-generated method stub
+ public Transformer resolveTransformer(String model) {
return null;
}
@Override
- public void setDataFormatResolver(DataFormatResolver dataFormatResolver) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setProperties(Map<String, String> properties) {
- // TODO Auto-generated method stub
-
+ public Transformer resolveTransformer(DataType from, DataType to) {
+ return null;
}
@Override
- public Map<String, String> getProperties() {
- // TODO Auto-generated method stub
+ public TransformerRegistry getTransformerRegistry() {
return null;
}
@Override
- public String getProperty(String name) {
- // TODO Auto-generated method stub
+ public Validator resolveValidator(DataType type) {
return null;
}
@Override
- public FactoryFinder getDefaultFactoryFinder() {
- // TODO Auto-generated method stub
+ public ValidatorRegistry getValidatorRegistry() {
return null;
}
@Override
- public void setFactoryFinderResolver(FactoryFinderResolver resolver) {
- // TODO Auto-generated method stub
+ public void setGlobalOptions(Map<String, String> globalOptions) {
}
@Override
- public FactoryFinder getFactoryFinder(String path) throws NoFactoryAvailableException {
- // TODO Auto-generated method stub
+ public Map<String, String> getGlobalOptions() {
return null;
}
@Override
- public ClassResolver getClassResolver() {
- // TODO Auto-generated method stub
+ public String getGlobalOption(String key) {
return null;
}
@Override
- public PackageScanClassResolver getPackageScanClassResolver() {
- // TODO Auto-generated method stub
+ public ClassResolver getClassResolver() {
return null;
}
@Override
public void setClassResolver(ClassResolver resolver) {
- // TODO Auto-generated method stub
-
- }
- @Override
- public void setPackageScanClassResolver(PackageScanClassResolver resolver) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setProducerServicePool(ServicePool<Endpoint, Producer> servicePool) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public ServicePool<Endpoint, Producer> getProducerServicePool() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setPollingConsumerServicePool(ServicePool<Endpoint, PollingConsumer> servicePool) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public ServicePool<Endpoint, PollingConsumer> getPollingConsumerServicePool() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setNodeIdFactory(NodeIdFactory factory) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public NodeIdFactory getNodeIdFactory() {
- // TODO Auto-generated method stub
- return null;
}
@Override
public ManagementStrategy getManagementStrategy() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setManagementStrategy(ManagementStrategy strategy) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public InterceptStrategy getDefaultTracer() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setDefaultTracer(InterceptStrategy tracer) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public InterceptStrategy getDefaultBacklogTracer() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setDefaultBacklogTracer(InterceptStrategy backlogTracer) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public InterceptStrategy getDefaultBacklogDebugger() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setDefaultBacklogDebugger(InterceptStrategy backlogDebugger) {
- // TODO Auto-generated method stub
}
@Override
public void disableJMX() throws IllegalStateException {
- // TODO Auto-generated method stub
}
@Override
public InflightRepository getInflightRepository() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setInflightRepository(InflightRepository repository) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public AsyncProcessorAwaitManager getAsyncProcessorAwaitManager() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setAsyncProcessorAwaitManager(AsyncProcessorAwaitManager manager) {
- // TODO Auto-generated method stub
}
@Override
public ClassLoader getApplicationContextClassLoader() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setApplicationContextClassLoader(ClassLoader classLoader) {
- // TODO Auto-generated method stub
}
@Override
public ShutdownStrategy getShutdownStrategy() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setShutdownStrategy(ShutdownStrategy shutdownStrategy) {
- // TODO Auto-generated method stub
}
@Override
public ExecutorServiceManager getExecutorServiceManager() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ExecutorServiceStrategy getExecutorServiceStrategy() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setExecutorServiceManager(ExecutorServiceManager executorServiceManager) {
- // TODO Auto-generated method stub
}
@Override
- public ProcessorFactory getProcessorFactory() {
- // TODO Auto-generated method stub
+ public MessageHistoryFactory getMessageHistoryFactory() {
return null;
}
@Override
- public void setProcessorFactory(ProcessorFactory processorFactory) {
- // TODO Auto-generated method stub
+ public void setMessageHistoryFactory(MessageHistoryFactory messageHistoryFactory) {
}
@Override
public Debugger getDebugger() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setDebugger(Debugger debugger) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public UuidGenerator getUuidGenerator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setUuidGenerator(UuidGenerator uuidGenerator) {
- // TODO Auto-generated method stub
}
@Override
- public Boolean isLazyLoadTypeConverters() {
- // TODO Auto-generated method stub
+ public Tracer getTracer() {
return null;
}
@Override
- public void setLazyLoadTypeConverters(Boolean lazyLoadTypeConverters) {
- // TODO Auto-generated method stub
+ public void setTracer(Tracer tracer) {
}
@Override
- public Boolean isTypeConverterStatisticsEnabled() {
- // TODO Auto-generated method stub
+ public UuidGenerator getUuidGenerator() {
return null;
}
@Override
- public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
- // TODO Auto-generated method stub
+ public void setUuidGenerator(UuidGenerator uuidGenerator) {
}
@Override
- public Boolean isUseMDCLogging() {
- // TODO Auto-generated method stub
+ public Boolean isLoadTypeConverters() {
return null;
}
@Override
- public void setUseMDCLogging(Boolean useMDCLogging) {
- // TODO Auto-generated method stub
+ public void setLoadTypeConverters(Boolean loadTypeConverters) {
}
@Override
- public Boolean isUseBreadcrumb() {
- // TODO Auto-generated method stub
+ public Boolean isTypeConverterStatisticsEnabled() {
return null;
}
@Override
- public void setUseBreadcrumb(Boolean useBreadcrumb) {
- // TODO Auto-generated method stub
-
- }
+ public void setTypeConverterStatisticsEnabled(Boolean typeConverterStatisticsEnabled) {
- @Override
- public String resolveComponentDefaultName(String javaType) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public Map<String, Properties> findComponents() throws LoadPropertiesException, IOException {
- // TODO Auto-generated method stub
+ public Boolean isUseMDCLogging() {
return null;
}
@Override
- public Map<String, Properties> findEips() throws LoadPropertiesException, IOException {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setUseMDCLogging(Boolean useMDCLogging) {
- @Override
- public String getComponentDocumentation(String componentName) throws IOException {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public String getComponentParameterJsonSchema(String componentName) throws IOException {
- // TODO Auto-generated method stub
+ public String getMDCLoggingKeysPattern() {
return null;
}
@Override
- public String getDataFormatParameterJsonSchema(String dataFormatName) throws IOException {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setMDCLoggingKeysPattern(String pattern) {
- @Override
- public String getLanguageParameterJsonSchema(String languageName) throws IOException {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public String getEipParameterJsonSchema(String eipName) throws IOException {
- // TODO Auto-generated method stub
+ public Boolean isUseDataType() {
return null;
}
@Override
- public String explainEipJson(String nameOrId, boolean includeAllOptions) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setUseDataType(Boolean useDataType) {
- @Override
- public String explainComponentJson(String componentName, boolean includeAllOptions) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public String explainEndpointJson(String uri, boolean includeAllOptions) {
- // TODO Auto-generated method stub
+ public Boolean isUseBreadcrumb() {
return null;
}
@Override
- public String createRouteStaticEndpointJson(String routeId) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setUseBreadcrumb(Boolean useBreadcrumb) {
- @Override
- public String createRouteStaticEndpointJson(String routeId, boolean includeDynamic) {
- // TODO Auto-generated method stub
- return null;
}
@Override
public StreamCachingStrategy getStreamCachingStrategy() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public UnitOfWorkFactory getUnitOfWorkFactory() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setUnitOfWorkFactory(UnitOfWorkFactory unitOfWorkFactory) {
- // TODO Auto-generated method stub
}
@Override
public RuntimeEndpointRegistry getRuntimeEndpointRegistry() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void setRuntimeEndpointRegistry(RuntimeEndpointRegistry runtimeEndpointRegistry) {
- // TODO Auto-generated method stub
}
@Override
- public RestRegistry getRestRegistry() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setRestRegistry(RestRegistry restRegistry) {
- // TODO Auto-generated method stub
+ public void setSSLContextParameters(SSLContextParameters sslContextParameters) {
}
@Override
- public void addRoutePolicyFactory(RoutePolicyFactory routePolicyFactory) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public List<RoutePolicyFactory> getRoutePolicyFactories() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public ModelJAXBContextFactory getModelJAXBContextFactory() {
- // TODO Auto-generated method stub
+ public SSLContextParameters getSSLContextParameters() {
return null;
}
@Override
- public void setModelJAXBContextFactory(ModelJAXBContextFactory modelJAXBContextFactory) {
- // TODO Auto-generated method stub
+ public void start() {
}
@Override
- public Boolean isLogExhaustedMessageBody() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void stop() {
- @Override
- public Boolean isLogMask() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public void setLogExhaustedMessageBody(Boolean arg0) {
- // TODO Auto-generated method stub
-
+ public boolean isStarted() {
+ return false;
}
@Override
- public void setLogMask(Boolean arg0) {
- // TODO Auto-generated method stub
-
+ public boolean isStarting() {
+ return false;
}
@Override
- public void addHystrixConfiguration(String arg0, HystrixConfigurationDefinition arg1) {
- // TODO Auto-generated method stub
-
+ public boolean isStopping() {
+ return false;
}
@Override
- public void addLogListener(LogListener arg0) {
- // TODO Auto-generated method stub
-
+ public boolean isStopped() {
+ return false;
}
@Override
- public void addRestConfiguration(RestConfiguration arg0) {
- // TODO Auto-generated method stub
-
+ public boolean isSuspending() {
+ return false;
}
@Override
- public void addService(Object arg0, boolean arg1, boolean arg2) throws Exception {
- // TODO Auto-generated method stub
-
+ public boolean isSuspended() {
+ return false;
}
@Override
- public void addServiceCallConfiguration(String arg0, ServiceCallConfigurationDefinition arg1) {
- // TODO Auto-generated method stub
-
+ public boolean isRunAllowed() {
+ return false;
}
@Override
- public DataFormat createDataFormat(String arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void build() {
- @Override
- public FluentProducerTemplate createFluentProducerTemplate() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public FluentProducerTemplate createFluentProducerTemplate(int arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void init() {
- @Override
- public void deferStartService(Object arg0, boolean arg1) throws Exception {
- // TODO Auto-generated method stub
-
}
@Override
- public String explainDataFormatJson(String arg0, DataFormat arg1, boolean arg2) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void suspend() {
- @Override
- public Component getComponent(String arg0, boolean arg1, boolean arg2) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public String getGlobalOption(String arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void resume() {
- @Override
- public Map<String, String> getGlobalOptions() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public HeadersMapFactory getHeadersMapFactory() {
- return new DefaultHeadersMapFactory();
- }
+ public void shutdown() {
- @Override
- public HealthCheckRegistry getHealthCheckRegistry() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public HystrixConfigurationDefinition getHystrixConfiguration(String arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void close() throws Exception {
- @Override
- public Set<LogListener> getLogListeners() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public ManagedCamelContextMBean getManagedCamelContext() {
- // TODO Auto-generated method stub
+ public ServiceStatus getStatus() {
return null;
}
@Override
- public <T extends ManagedProcessorMBean> T getManagedProcessor(String arg0, Class<T> arg1) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setStreamCaching(Boolean cache) {
- @Override
- public <T extends ManagedRouteMBean> T getManagedRoute(String arg0, Class<T> arg1) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public MessageHistoryFactory getMessageHistoryFactory() {
- // TODO Auto-generated method stub
+ public Boolean isStreamCaching() {
return null;
}
@Override
- public Processor getProcessor(String arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setTracing(Boolean tracing) {
- @Override
- public <T extends Processor> T getProcessor(String arg0, Class<T> arg1) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public ProcessorDefinition getProcessorDefinition(String arg0) {
- // TODO Auto-generated method stub
+ public Boolean isTracing() {
return null;
}
@Override
- public <T extends ProcessorDefinition> T getProcessorDefinition(String arg0, Class<T> arg1) {
- // TODO Auto-generated method stub
+ public String getTracingPattern() {
return null;
}
@Override
- public ReloadStrategy getReloadStrategy() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setTracingPattern(String tracePattern) {
- @Override
- public RestConfiguration getRestConfiguration(String arg0, boolean arg1) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public Collection<RestConfiguration> getRestConfigurations() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setBacklogTracing(Boolean backlogTrace) {
- @Override
- public RouteController getRouteController() {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public RuntimeCamelCatalog getRuntimeCamelCatalog() {
- // TODO Auto-generated method stub
+ public Boolean isBacklogTracing() {
return null;
}
@Override
- public SSLContextParameters getSSLContextParameters() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setDebugging(Boolean debugging) {
- @Override
- public ServiceCallConfigurationDefinition getServiceCallConfiguration(String arg0) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public TransformerRegistry getTransformerRegistry() {
- // TODO Auto-generated method stub
+ public Boolean isDebugging() {
return null;
}
@Override
- public List<TransformerDefinition> getTransformers() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setMessageHistory(Boolean messageHistory) {
- @Override
- public long getUptimeMillis() {
- // TODO Auto-generated method stub
- return 0;
}
@Override
- public ValidatorRegistry getValidatorRegistry() {
- // TODO Auto-generated method stub
+ public Boolean isMessageHistory() {
return null;
}
@Override
- public List<ValidatorDefinition> getValidators() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setLogMask(Boolean logMask) {
- @Override
- public <T> Set<T> hasServices(Class<T> arg0) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public Boolean isLoadTypeConverters() {
- // TODO Auto-generated method stub
+ public Boolean isLogMask() {
return null;
}
@Override
- public Boolean isUseDataType() {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setLogExhaustedMessageBody(Boolean logExhaustedMessageBody) {
- @Override
- public boolean isVetoStarted() {
- // TODO Auto-generated method stub
- return false;
}
@Override
- public RestsDefinition loadRestsDefinition(InputStream arg0) throws Exception {
- // TODO Auto-generated method stub
+ public Boolean isLogExhaustedMessageBody() {
return null;
}
@Override
- public Transformer resolveTransformer(String arg0) {
- // TODO Auto-generated method stub
- return null;
- }
+ public void setDelayer(Long delay) {
- @Override
- public Transformer resolveTransformer(DataType arg0, DataType arg1) {
- // TODO Auto-generated method stub
- return null;
}
@Override
- public Validator resolveValidator(DataType arg0) {
- // TODO Auto-generated method stub
+ public Long getDelayer() {
return null;
}
@Override
- public void setGlobalOptions(Map<String, String> arg0) {
- // TODO Auto-generated method stub
-
- }
+ public void setAutoStartup(Boolean autoStartup) {
- @Override
- public void setHeadersMapFactory(HeadersMapFactory arg0) {
- // TODO Auto-generated method stub
-
}
@Override
- public void setHealthCheckRegistry(HealthCheckRegistry arg0) {
- // TODO Auto-generated method stub
-
+ public Boolean isAutoStartup() {
+ return null;
}
@Override
- public void setHystrixConfiguration(HystrixConfigurationDefinition arg0) {
- // TODO Auto-generated method stub
-
- }
+ public void setShutdownRoute(ShutdownRoute shutdownRoute) {
- @Override
- public void setHystrixConfigurations(List<HystrixConfigurationDefinition> arg0) {
- // TODO Auto-generated method stub
-
}
@Override
- public void setLoadTypeConverters(Boolean arg0) {
- // TODO Auto-generated method stub
-
+ public ShutdownRoute getShutdownRoute() {
+ return null;
}
@Override
- public void setMessageHistoryFactory(MessageHistoryFactory arg0) {
- // TODO Auto-generated method stub
-
- }
+ public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
- @Override
- public void setReloadStrategy(ReloadStrategy arg0) {
- // TODO Auto-generated method stub
-
}
@Override
- public void setRouteController(RouteController arg0) {
- // TODO Auto-generated method stub
-
+ public ShutdownRunningTask getShutdownRunningTask() {
+ return null;
}
@Override
- public void setSSLContextParameters(SSLContextParameters arg0) {
- // TODO Auto-generated method stub
-
- }
+ public void setAllowUseOriginalMessage(Boolean allowUseOriginalMessage) {
- @Override
- public void setServiceCallConfiguration(ServiceCallConfigurationDefinition arg0) {
- // TODO Auto-generated method stub
-
}
@Override
- public void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> arg0) {
- // TODO Auto-generated method stub
-
+ public Boolean isAllowUseOriginalMessage() {
+ return null;
}
@Override
- public void setTransformers(List<TransformerDefinition> arg0) {
- // TODO Auto-generated method stub
-
+ public Boolean isCaseInsensitiveHeaders() {
+ return null;
}
@Override
- public void setUseDataType(Boolean arg0) {
- // TODO Auto-generated method stub
-
- }
+ public void setCaseInsensitiveHeaders(Boolean caseInsensitiveHeaders) {
- @Override
- public void setValidators(List<ValidatorDefinition> arg0) {
- // TODO Auto-generated method stub
-
}
-
}
diff --git a/src/test/java/org/onap/aai/rest/RestClientTest.java b/src/test/java/org/onap/aai/rest/RestClientTest.java
index 66e7365..6c176d6 100644
--- a/src/test/java/org/onap/aai/rest/RestClientTest.java
+++ b/src/test/java/org/onap/aai/rest/RestClientTest.java
@@ -29,16 +29,23 @@ import java.util.List;
import java.util.Map;
import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.impl.DefaultMessage;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.support.DefaultMessage;
import org.junit.Before;
import org.junit.Test;
-import org.onap.aai.event.TestCamelContext;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.logging.RouterCoreMsgs;
import org.onap.aai.restclient.client.Headers;
+@RunWith(MockitoJUnitRunner.class)
public class RestClientTest {
+
+ @Mock
+ public ExtendedCamelContext context;
+
/**
* Test case initialization
*
@@ -52,7 +59,7 @@ public class RestClientTest {
public void validate() throws Exception {
try {
- RestClientComponent rc = new RestClientComponent();
+ RestClientComponent rc = new RestClientComponent(context);
RestClientEndpoint endpoint = new RestClientEndpoint("http://host.com:8443/endpoint", rc);
endpoint.setEcompClientCert("client-cert");
@@ -60,6 +67,7 @@ public class RestClientTest {
endpoint.setEcompKeystorePassword("OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10");
endpoint.setOp("GET");
+
assertTrue(endpoint.getEcompClientCert().compareTo("client-cert") == 0);
assertTrue(endpoint.getEcompKeystore().compareTo("keystore") == 0);
assertTrue(endpoint.getEcompKeystorePassword().compareTo("OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10") == 0);
@@ -75,7 +83,6 @@ public class RestClientTest {
Exchange exchange = endpoint.createExchange();
exchange.setProperty(Exchange.TO_ENDPOINT, "mock://get");
DefaultMessage in = (DefaultMessage)exchange.getIn();
- in.setCamelContext(new TestCamelContext());
in.setHeader(RestClientEndpoint.IN_HEADER_URL, "svc/endpoint");
in.setHeader(Headers.FROM_APP_ID, "val1");