- --
- "/app/start-app.sh"
################################################################################
- VNFM-adapter:
+ vnfm-adapter:
image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/vnfm-adapter:${TAG}
ports:
- "9092:9092"
- ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates
- ${TEST_LAB_DIR}/volumes/so/config/vnfm-adapter/onapheat:/app/config
environment:
- - APP=VNFM-adapter
+ - APP=vnfm-adapter
- JVM_ARGS=-Xms64m -Xmx512m
hostname:
vnfm-adapter-test
sdc-simulator
depends_on:
- mariadb
- - VNFM-adapter
+ - vnfm-adapter
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "30m"
+ max-file: "5"
+################################################################################
+ aai-simulator:
+ image: simulators/aai-simulator:latest
+ ports:
+ - "9993:9993"
+ environment:
+ - APP=AAI-SIMULATOR
+ - JVM_ARGS=-Xms64m -Xmx512m
+ hostname:
+ aai-simulator
+ depends_on:
+ - mariadb
+ - vnfm-adapter
logging:
driver: "json-file"
options:
- CATALOG_DB=catalogdb
depends_on:
- mariadb
- - VNFM-adapter
+ - vnfm-adapter
command:
- "/config/apply-workarounds.sh"
################################################################################
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.so.simulators</groupId>
+ <artifactId>so-simulators</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>aai-simulator</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>org.onap.so.aai.simulator.AaiSimulatorApplication</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.aai.simulator;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+ * @author waqas.ikram@ericsson.com
+ *
+ */
+@SpringBootApplication(scanBasePackages = {"org.onap"})
+public class AaiSimulatorApplication extends SpringBootServletInitializer {
+
+ public static void main(final String[] args) {
+ SpringApplication.run(AaiSimulatorApplication.class, args);
+ }
+
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.aai.simulator;
+
+import javax.ws.rs.core.MediaType;
+import org.onap.so.aai.simulator.utils.Constant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author waqas.ikram@ericsson.com
+ *
+ */
+@RestController
+@RequestMapping(path = Constant.BASE_URL)
+public class AaiSimulatorController {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AaiSimulatorController.class);
+
+ @GetMapping(value = "/healthcheck", produces = MediaType.TEXT_PLAIN)
+ @ResponseStatus(code = HttpStatus.OK)
+ public String healthCheck() {
+ LOGGER.info("Running health check ...");
+ return Constant.HEALTHY;
+ }
+
+}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.aai.simulator.utils;
+
+/**
+ * @author waqas.ikram@ericsson.com
+ *
+ */
+public class Constant {
+
+ public static final String BASE_URL = "/simulator/aai";
+
+ public static final String HEALTHY = "healthy";
+
+ private Constant() {}
+
+}
--- /dev/null
+server:
+ port: 9993
+ tomcat:
+ max-threads: 4
+ssl-enable: false
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.aai.simulator;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.aai.simulator.utils.Constant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+/**
+ * @author waqas.ikram@ericsson.com
+ *
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@ActiveProfiles("test")
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@Configuration
+public class AaiSimulatorControllerTest {
+
+ @LocalServerPort
+ private int port;
+
+ @Autowired
+ private TestRestTemplate restTemplate;
+
+ @Test
+ public void test_healthCheck_matchContent() {
+ final String url = getBaseUrl() + "/healthcheck";
+ final ResponseEntity<String> object = restTemplate.getForEntity(url, String.class);
+
+ assertEquals(Constant.HEALTHY, object.getBody());
+
+ }
+
+ private String getBaseUrl() {
+ return "http://localhost:" + port + Constant.BASE_URL;
+ }
+
+
+
+}
</assembly>
</build>
</image>
+ <image>
+ <name>simulators/aai-simulator</name>
+ <build>
+ <cleanup>try</cleanup>
+ <dockerFileDir>docker-files</dockerFileDir>
+ <dockerFile>Dockerfile.so-simulator-base-image</dockerFile>
+ <tags>
+ <tag>${project.version}</tag>
+ </tags>
+ <assembly>
+ <inline>
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>org.onap.so.simulators:aai-simulator</include>
+ </includes>
+ <outputFileNameMapping>app.jar</outputFileNameMapping>
+ </dependencySet>
+ </dependencySets>
+ </inline>
+ </assembly>
+ </build>
+ </image>
</images>
</configuration>
<goal>build</goal>
</goals>
</execution>
-
-
</executions>
</plugin>
<artifactId>sdc-simulator</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.so.simulators</groupId>
+ <artifactId>aai-simulator</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<modules>
<module>sdc-simulator</module>
+ <module>aai-simulator</module>
<module>package</module>
</modules>
import java.util.Optional;
import javax.ws.rs.core.MediaType;
import org.onap.so.sdc.simulator.providers.ResourceProvider;
+import org.onap.so.sdc.simulator.utils.Constant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@RestController
@RequestMapping(path = Constant.BASE_URL)
public class SdcSimulatorController {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SdcSimulatorController.class);
private ResourceProvider resourceProvider;
this.resourceProvider = resourceProvider;
}
- private static final Logger LOGGER = LoggerFactory.getLogger(SdcSimulatorController.class);
-
@GetMapping(value = "/healthcheck", produces = MediaType.APPLICATION_JSON)
@ResponseStatus(code = HttpStatus.OK)
public String healthCheck() {
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
-import org.onap.so.sdc.simulator.Constant;
+import org.onap.so.sdc.simulator.utils.Constant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
* SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
-package org.onap.so.sdc.simulator;
+package org.onap.so.sdc.simulator.utils;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
server:
port: 9991
tomcat:
- max-threads: 50
+ max-threads: 4
ssl-enable: false
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-
import java.util.Optional;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.onap.so.sdc.simulator.providers.ResourceProvider;
+import org.onap.so.sdc.simulator.utils.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@Configuration
public class SdcSimulatorControllerTest {
- private static final String MOCKER_SDC_CONTROLLER_BEAN = "mockResourceProvider";
-
@LocalServerPort
private int port;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-import org.onap.so.sdc.simulator.Constant;
+import org.onap.so.sdc.simulator.utils.Constant;
import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StreamUtils;