Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / so-bpmn-infrastructure-flows / src / test / java / org / onap / so / BaseBPMNTest.java
1 /*
2  * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
3  * Foundation. ================================================================================ Licensed under the
4  * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
5  * obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
8  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
9  * either express or implied. See the License for the specific language governing permissions and limitations under the
10  * License.
11  *
12  * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
13  */
14 package org.onap.so;
15
16 import com.github.tomakehurst.wiremock.WireMockServer;
17 import java.util.HashMap;
18 import java.util.Map;
19 import org.camunda.bpm.engine.HistoryService;
20 import org.camunda.bpm.engine.RepositoryService;
21 import org.camunda.bpm.engine.RuntimeService;
22 import org.junit.After;
23 import org.junit.runner.RunWith;
24 import org.springframework.beans.factory.annotation.Autowired;
25 import org.springframework.beans.factory.annotation.Value;
26 import org.springframework.boot.test.context.SpringBootTest;
27 import org.springframework.boot.web.server.LocalServerPort;
28 import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
29 import org.springframework.test.context.ActiveProfiles;
30 import org.springframework.test.context.ContextConfiguration;
31 import org.springframework.test.context.junit4.SpringRunner;
32
33 @RunWith(SpringRunner.class)
34 @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
35 @ActiveProfiles("test")
36 @ContextConfiguration
37 @AutoConfigureWireMock(port = 0)
38 public abstract class BaseBPMNTest {
39
40     @Autowired
41     protected RuntimeService runtimeService;
42
43     @Autowired
44     protected RepositoryService repositoryService;
45
46     @Autowired
47     protected HistoryService historyService;
48
49     protected Map<String, Object> variables = new HashMap<>();
50
51     @LocalServerPort
52     protected int port;
53
54     @Autowired
55     protected WireMockServer wireMockServer;
56
57     @Value("${wiremock.server.port}")
58     protected int wireMockPort;
59
60     @After
61     public void shutDown() {
62         wireMockServer.resetAll();
63     }
64 }