Skip to content

Commit 3b14f4f

Browse files
author
Vasile Baluta
committed
try to fix tests
1 parent fe6d40f commit 3b14f4f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ sudo: required
22

33
language: java
44

5-
services:
6-
- mongodb
7-
- rabbitmq
8-
95
jdk:
106
- oraclejdk8
117

128
before_install:
139
- chmod +x pom.xml
1410

1511
script:
16-
- mvn clean install
12+
- rm /home/travis/.embedmongo/extracted/Linux-B64--3.4.1/extractmongod
13+
- mvn clean install

src/test/java/com/ericsson/ei/subscription/SubscriptionServiceTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.springframework.boot.test.context.SpringBootTest;
3838
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
3939

40+
import com.ericsson.ei.App;
4041
import com.ericsson.ei.controller.model.Subscription;
4142
import com.ericsson.ei.exception.SubscriptionNotFoundException;
4243
import com.ericsson.ei.mongodbhandler.MongoDBHandler;
@@ -48,7 +49,7 @@
4849
import de.flapdoodle.embed.mongo.tests.MongodForTestsFactory;
4950

5051
@RunWith(SpringJUnit4ClassRunner.class)
51-
@SpringBootTest
52+
@SpringBootTest(classes = App.class)
5253
public class SubscriptionServiceTest {
5354

5455
String subscriptionName;
@@ -61,7 +62,7 @@ public class SubscriptionServiceTest {
6162

6263
private static MongodForTestsFactory testsFactory;
6364

64-
ObjectMapper mapper = new ObjectMapper();
65+
private ObjectMapper mapper = new ObjectMapper();
6566

6667
private static final String subscriptionJsonPath = "src/test/resources/subscription_single.json";
6768

@@ -84,7 +85,7 @@ public static void setMongoDB() throws IOException, JSONException {
8485
}
8586

8687
@PostConstruct
87-
public void initMocks() {
88+
public void init() {
8889
mongoDBHandler.setMongoClient(mongoClient);
8990
}
9091

0 commit comments

Comments
 (0)