NIFI-4929 Converted the majority of MongoDB unit tests to integration tests so they can be reliably run with 'mvn -Pintegration-tests integration-test'

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #2508.
This commit is contained in:
Mike Thomsen 2018-03-03 10:17:21 -05:00 committed by Pierre Villard
parent bff5b7ab71
commit dae2b73d94
5 changed files with 6 additions and 16 deletions

View File

@ -23,14 +23,12 @@ import org.bson.Document;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
@Ignore("This is an integration test and should be marked Ignore until someone needs to run it.")
public class DeleteMongoTest extends MongoWriteTestBase {
public class DeleteMongoIT extends MongoWriteTestBase {
@Before
public void setup() {
super.setup(DeleteMongo.class);

View File

@ -34,7 +34,6 @@ import org.bson.Document;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.text.SimpleDateFormat;
@ -46,10 +45,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Ignore("Integration tests that cause failures in some environments. Require that they be run from Maven to run the embedded mongo maven plugin. Maven Plugin also fails in my CentOS 7 environment.")
public class GetMongoTest {
public class GetMongoIT {
private static final String MONGO_URI = "mongodb://localhost";
private static final String DB_NAME = GetMongoTest.class.getSimpleName().toLowerCase();
private static final String DB_NAME = GetMongoIT.class.getSimpleName().toLowerCase();
private static final String COLLECTION_NAME = "test";
private static final List<Document> DOCUMENTS;

View File

@ -27,7 +27,6 @@ import org.bson.types.ObjectId;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.nio.charset.StandardCharsets;
@ -38,8 +37,7 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
@Ignore("Integration tests that cause failures in some environments. Require that they be run from Maven to run the embedded mongo maven plugin. Maven Plugin also fails in my CentOS 7 environment.")
public class PutMongoTest extends MongoWriteTestBase {
public class PutMongoIT extends MongoWriteTestBase {
@Before
public void setup() {
super.setup(PutMongo.class);

View File

@ -33,7 +33,6 @@ import org.bson.Document;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.nio.charset.StandardCharsets;
@ -46,8 +45,7 @@ import java.util.List;
import static org.junit.Assert.assertEquals;
@Ignore("Integration tests that cause failures in some environments")
public class PutMongoRecordTest extends MongoWriteTestBase {
public class PutMongoRecordIT extends MongoWriteTestBase {
private MockRecordParser recordReader;

View File

@ -30,7 +30,6 @@ import org.bson.Document;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
@ -39,8 +38,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Ignore("This is an integration test that requires Mongo to be running.")
public class RunMongoAggregationTest {
public class RunMongoAggregationIT {
private static final String MONGO_URI = "mongodb://localhost";
private static final String DB_NAME = String.format("agg_test-%s", Calendar.getInstance().getTimeInMillis());