<onap-logging-version>1.6.9</onap-logging-version>
<jackson.version>2.14.3</jackson.version>
<grpc.version>1.25.0</grpc.version>
- <logback.version>1.2.7</logback.version>
+ <logback.version>1.2.11</logback.version>
</properties>
<distributionManagement>
<repository>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<citrus.simulator.version>1.1.0</citrus.simulator.version>
- <spring.boot.version>2.0.9.RELEASE</spring.boot.version>
+ <springboot.version>2.0.9.RELEASE</springboot.version>
+ <spring-cloud.version>Finchley.RC2</spring-cloud.version>
+ <junit-jupiter.version>5.6.0</junit-jupiter.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
- <version>${spring.boot.version}</version>
+ <version>${springboot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-dependencies</artifactId>
+ <version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
+ <!-- TODO: Update spring-boot > 2.0.9, then remove this
+ This is a transitive dependency of hibernate that
+ in it's original version is not compatibel with Java 11 -->
+ <dependency>
+ <groupId>org.javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.25.0-GA</version>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.4.200</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>${junit-jupiter.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-commons</artifactId>
+ <version>1.6.0</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <version>6.14.3</version>
+ </dependency>
<!-- Citrus Simulator -->
<dependency>
<groupId>com.consol.citrus</groupId>
<artifactId>aai-client</artifactId>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>3.1.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
+ <artifactId>surefire-testng</artifactId>
+ <version>3.1.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2025 Deutsche Telekom.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.simulator;
+
+import static org.junit.Assert.assertTrue;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.SpringApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpStatus;
+import org.springframework.test.context.ContextConfiguration;
+import org.testng.annotations.Test;
+import com.consol.citrus.annotations.CitrusTest;
+import com.consol.citrus.dsl.runner.TestRunner;
+import com.consol.citrus.dsl.runner.TestRunnerBeforeSuiteSupport;
+import com.consol.citrus.dsl.testng.TestNGCitrusTestDesigner;
+import com.consol.citrus.http.client.HttpClient;
+
+@Test
+@ContextConfiguration(classes = org.onap.so.simulator.SimulatorIntegrationTest.EndpointConfig.class)
+public class SimulatorIntegrationTest extends TestNGCitrusTestDesigner {
+
+ @Autowired
+ @Qualifier("simulatorClient")
+ private HttpClient apiClient;
+
+ @CitrusTest
+ public void thatRequestCanBeMade() {
+ http().client(apiClient).send().get("/sim/v1/tenantOne/stacks/network_dummy_id/stackId");
+ http().client(apiClient).receive().response(HttpStatus.OK);
+ assertTrue(true);
+ }
+
+ @Configuration
+ public static class EndpointConfig {
+ @Bean
+ public TestRunnerBeforeSuiteSupport startEmbeddedSimulator() {
+ return new TestRunnerBeforeSuiteSupport() {
+ @Override
+ public void beforeSuite(TestRunner runner) {
+ SpringApplication.run(Simulator.class);
+ }
+ };
+ }
+ }
+}
http://www.citrusframework.org/schema/http/config http://www.citrusframework.org/schema/http/config/citrus-http-config.xsd
http://www.citrusframework.org/schema/config http://www.citrusframework.org/schema/config/citrus-config.xsd">
- <citrus:schema-repository id="schemaRepository">
- <citrus:locations>
- <citrus:location path="classpath:xsd/HelloService.xsd"/>
- </citrus:locations>
- </citrus:schema-repository>
-
<!-- Test Http REST client -->
<citrus-http:client
id="simulatorClient"
- request-url="http://localhost:8080/services/rest/simulator"
+ request-url="http://localhost:10000"
timeout="5000"/>
-</beans>
\ No newline at end of file
+</beans>
--- /dev/null
+<configuration scan="true" debug="false">
+ <include resource="org/springframework/boot/logging/logback/base.xml" />
+
+ <property name="queueSize" value="256" />
+ <property name="maxFileSize" value="20MB" />
+ <property name="maxHistory" value="30" />
+ <property name="totalSizeCap" value="20MB" />
+
+ <!-- log file names -->
+ <property name="debugLogName" value="debug" />
+
+ <property name="currentTimeStamp" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX",UTC}"/>
+
+ <property name="debugPattern"
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%thread|%X{RequestID}| %logger{50} - %msg%n" />
+
+ <appender name="Debug"
+ class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="Debug" />
+ <includeCallerData>true</includeCallerData>
+ </appender>
+
+ <!-- Sim Logs go here-->
+ <logger name="com.consol.citrus" level="DEBUG" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+
+ <logger name="com.consol.citrus.simulator.http.HttpRequestAnnotationMatcher" level="WARN" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+ <logger name="org.onap.so" level="DEBUG" additivity="false">
+ <appender-ref ref="asyncDebug" />
+ </logger>
+
+
+ <root level="INFO">
+ <appender-ref ref="asyncDebug" />
+ </root>
+
+</configuration>