#139 - Switched to embedded MongoDB for integration tests.
Removed MongoDB dependency by adding Flapdoodle embedded MongoDB. That allows us to get rid of the utility module we had in place for the MongoDB samples guarding the tests to only run when a MongoDB instance is running. Tweaked Travis setup to not require the MongoDB service anymore.
This commit is contained in:
@@ -18,7 +18,6 @@ package example.springdata.mongodb.people;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,8 +26,6 @@ import org.springframework.data.mongodb.core.MongoOperations;
|
||||
import org.springframework.data.mongodb.core.mapping.event.LoggingEventListener;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import example.springdata.mongodb.util.RequiresMongoDB;
|
||||
|
||||
/**
|
||||
* Integration test for {@link PersonRepository}.
|
||||
*
|
||||
@@ -39,8 +36,6 @@ import example.springdata.mongodb.util.RequiresMongoDB;
|
||||
@SpringApplicationConfiguration(classes = ApplicationConfiguration.class)
|
||||
public class PersonRepositoryIntegrationTest {
|
||||
|
||||
@ClassRule public static RequiresMongoDB mongodbAvailable = RequiresMongoDB.anyVersion();
|
||||
|
||||
@Autowired PersonRepository repository;
|
||||
@Autowired MongoOperations operations;
|
||||
|
||||
|
||||
2
mongodb/java8/src/test/resources/application.properties
Normal file
2
mongodb/java8/src/test/resources/application.properties
Normal file
@@ -0,0 +1,2 @@
|
||||
# Random port for embedded MongoDB
|
||||
spring.data.mongodb.port=0
|
||||
Reference in New Issue
Block a user