diff options
Diffstat (limited to 'asdc-controller')
5 files changed, 58 insertions, 6 deletions
diff --git a/asdc-controller/pom.xml b/asdc-controller/pom.xml index 7b774a2cce..35fbf9108c 100644 --- a/asdc-controller/pom.xml +++ b/asdc-controller/pom.xml @@ -30,7 +30,6 @@ <version>0.7.7.201606060606</version> <configuration> <excludes> - + <exclude>**/resource-examples/**</exclude> </excludes> </configuration> @@ -143,6 +142,24 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>default-test</id> + <goals> + <goal>test</goal> + </goals> + <configuration> + <includes> + <include>**/AllTestsTestSuite.java</include> + </includes> + <parallel>suites</parallel> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies> @@ -232,7 +249,7 @@ <groupId>org.antlr</groupId> <artifactId>antlr4</artifactId> <version>${antlr.version}</version> - + <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/AllTestsTestSuite.java b/asdc-controller/src/test/java/org/onap/so/asdc/AllTestsTestSuite.java new file mode 100644 index 0000000000..a100f26d5a --- /dev/null +++ b/asdc-controller/src/test/java/org/onap/so/asdc/AllTestsTestSuite.java @@ -0,0 +1,32 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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.asdc; +import org.junit.runner.RunWith; + +import com.googlecode.junittoolbox.SuiteClasses; +import com.googlecode.junittoolbox.WildcardPatternSuite; + +@RunWith(WildcardPatternSuite.class) +@SuiteClasses("**/*Test.class") +public class AllTestsTestSuite { + // the class remains empty, + // used only as a holder for the above annotations +} diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java index 74f0d60596..83d60aefea 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/BaseTest.java @@ -29,6 +29,7 @@ import org.onap.so.asdc.installer.VfResourceStructure; import org.onap.so.asdc.installer.heat.ToscaResourceInstaller; import org.onap.so.asdc.tenantIsolation.WatchdogDistribution; import org.onap.so.spring.SpringContextHelper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; import org.springframework.boot.test.context.SpringBootTest; @@ -39,6 +40,8 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import com.github.tomakehurst.wiremock.WireMockServer; + @RunWith(SpringRunner.class) @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles("test") @@ -53,6 +56,8 @@ public abstract class BaseTest { protected WatchdogDistribution watchdogDistributionSpy; @SpyBean protected ToscaResourceInstaller toscaInstaller; + @Autowired + protected WireMockServer wireMockServer; @Value("${wiremock.server.port}") protected String wireMockPort; diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java index 85ecaaa3ea..03d0a0ff1e 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java @@ -21,7 +21,6 @@ package org.onap.so.asdc.client; import static com.github.tomakehurst.wiremock.client.WireMock.ok; import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -144,7 +143,7 @@ public class ASDCControllerITTest extends BaseTest { String modelEndpoint = "/aai/v15/service-design-and-creation/models/model/" + serviceInvariantUuid + "/model-vers/model-ver/" + serviceUuid + "?depth=0"; - stubFor(post(urlEqualTo(modelEndpoint)).willReturn(ok())); + wireMockServer.stubFor(post(urlEqualTo(modelEndpoint)).willReturn(ok())); } /** diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 546c4e2458..947da4f492 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -22,7 +22,6 @@ package org.onap.so.asdc.client.test.rest; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; @@ -98,7 +97,7 @@ public class ASDCRestInterfaceTest extends BaseTest { @Transactional public void testAllottedResourceService() throws Exception { - stubFor(post(urlPathMatching("/aai/.*")) + wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/json"))); |