From f88dcdcbddbd6e025110ddaea7b5fccf7afe45aa Mon Sep 17 00:00:00 2001 From: karthik kadajji Date: Fri, 24 Apr 2020 09:29:07 +0200 Subject: [PATCH 1/5] NIFI-7037 Split off username and password fields for GetMongo processor --- .../mongodb/AbstractMongoProcessor.java | 2 +- .../nifi/processors/mongodb/GetMongo.java | 111 ++++++++++++++++-- .../nifi/processors/mongodb/GetMongoIT.java | 60 +++++++++- 3 files changed, 156 insertions(+), 17 deletions(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java index df918d906c03..cf9ad81c21d1 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java @@ -228,7 +228,7 @@ public abstract class AbstractMongoProcessor extends AbstractProcessor { protected MongoDBClientService clientService; @OnScheduled - public final void createClient(ProcessContext context) throws IOException { + public void createClient(ProcessContext context) throws IOException { if (context.getProperty(CLIENT_SERVICE).isSet()) { clientService = context.getProperty(CLIENT_SERVICE).asControllerService(MongoDBClientService.class); return; diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index b3b82b0e8143..b6fc773e5893 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -20,9 +20,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoCursor; +import org.apache.commons.lang3.StringUtils; import org.apache.nifi.annotation.behavior.InputRequirement; import org.apache.nifi.annotation.behavior.InputRequirement.Requirement; import org.apache.nifi.annotation.behavior.WritesAttribute; @@ -36,14 +39,18 @@ import org.apache.nifi.context.PropertyContext; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.logging.ComponentLog; +import org.apache.nifi.mongodb.MongoDBClientService; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.util.StandardValidators; +import org.apache.nifi.security.util.SslContextFactory; +import org.apache.nifi.ssl.SSLContextService; import org.bson.Document; import org.bson.json.JsonWriterSettings; +import javax.net.ssl.SSLContext; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; @@ -57,20 +64,20 @@ @InputRequirement(Requirement.INPUT_ALLOWED) @CapabilityDescription("Creates FlowFiles from documents in MongoDB loaded by a user-specified query.") @WritesAttributes({ - @WritesAttribute(attribute = GetMongo.DB_NAME, description = "The database where the results came from."), - @WritesAttribute(attribute = GetMongo.COL_NAME, description = "The collection where the results came from.") + @WritesAttribute(attribute = GetMongo.DB_NAME, description = "The database where the results came from."), + @WritesAttribute(attribute = GetMongo.COL_NAME, description = "The collection where the results came from.") }) public class GetMongo extends AbstractMongoQueryProcessor { public static final PropertyDescriptor SEND_EMPTY_RESULTS = new PropertyDescriptor.Builder() - .name("get-mongo-send-empty") - .displayName("Send Empty Result") - .description("If a query executes successfully, but returns no results, send an empty JSON document " + - "signifying no result.") - .allowableValues("true", "false") - .defaultValue("false") - .addValidator(StandardValidators.BOOLEAN_VALIDATOR) - .required(false) - .build(); + .name("get-mongo-send-empty") + .displayName("Send Empty Result") + .description("If a query executes successfully, but returns no results, send an empty JSON document " + + "signifying no result.") + .allowableValues("true", "false") + .defaultValue("false") + .addValidator(StandardValidators.BOOLEAN_VALIDATOR) + .required(false) + .build(); static final AllowableValue YES_PP = new AllowableValue("true", "True"); static final AllowableValue NO_PP = new AllowableValue("false", "False"); @@ -85,6 +92,22 @@ public class GetMongo extends AbstractMongoQueryProcessor { .allowableValues(YES_PP, NO_PP) .addValidator(Validator.VALID) .build(); + static final PropertyDescriptor USER_NAME = new PropertyDescriptor.Builder() + .name("User Name") + .displayName("username") + .description("User for mongodb authentication") + .required(false) + .addValidator(Validator.VALID) + .sensitive(false) + .build(); + + static final PropertyDescriptor PASSWORD = new PropertyDescriptor.Builder() + .name("Password") + .description("The Password for the user") + .required(false) + .addValidator(Validator.VALID) + .sensitive(true) + .build(); private final static Set relationships; private final static List propertyDescriptors; @@ -107,6 +130,8 @@ public class GetMongo extends AbstractMongoQueryProcessor { _propertyDescriptors.add(SSL_CONTEXT_SERVICE); _propertyDescriptors.add(CLIENT_AUTH); _propertyDescriptors.add(SEND_EMPTY_RESULTS); + _propertyDescriptors.add(USER_NAME); + _propertyDescriptors.add(PASSWORD); propertyDescriptors = Collections.unmodifiableList(_propertyDescriptors); final Set _relationships = new HashSet<>(); @@ -253,7 +278,14 @@ public void onTrigger(final ProcessContext context, final ProcessSession session }); outgoingFlowFile = session.putAllAttributes(outgoingFlowFile, attributes); - session.getProvenanceReporter().receive(outgoingFlowFile, getURI(context)); + String uriPass=""; + if (context.getProperty(USER_NAME).getValue() != null) { + uriPass = "mongodb://" + context.getProperty(USER_NAME).getValue() + ":" + context.getProperty(PASSWORD).getValue() + "@" + getURI(context).substring(10); + + } else { + uriPass = getURI(context); + } + session.getProvenanceReporter().receive(outgoingFlowFile, uriPass); session.transfer(outgoingFlowFile, REL_SUCCESS); sent++; } @@ -271,4 +303,59 @@ public void onTrigger(final ProcessContext context, final ProcessSession session } } + + @OnScheduled + public void createClient(ProcessContext context) throws IOException { + if (context.getProperty(CLIENT_SERVICE).isSet()) { + clientService = context.getProperty(CLIENT_SERVICE).asControllerService(MongoDBClientService.class); + return; + } + + if (mongoClient != null) { + closeClient(); + } + + getLogger().info("Creating MongoClient"); + + // Set up the client for secure (SSL/TLS communications) if configured to do so + final SSLContextService sslService = context.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); + final String rawClientAuth = context.getProperty(CLIENT_AUTH).getValue(); + final SSLContext sslContext; + + if (sslService != null) { + final SSLContextService.ClientAuth clientAuth; + if (StringUtils.isBlank(rawClientAuth)) { + clientAuth = SSLContextService.ClientAuth.REQUIRED; + } else { + try { + clientAuth = SSLContextService.ClientAuth.valueOf(rawClientAuth); + } catch (final IllegalArgumentException iae) { + throw new IllegalStateException(String.format("Unrecognized client auth '%s'. Possible values are [%s]", + rawClientAuth, StringUtils.join(SslContextFactory.ClientAuth.values(), ", "))); + } + } + sslContext = sslService.createSSLContext(clientAuth); + } else { + sslContext = null; + } + + try { + String uriPass = ""; + if (sslContext == null) { + if (context.getProperty(USER_NAME).getValue() != null) { + uriPass = "mongodb://" + context.getProperty(USER_NAME).getValue() + ":" + context.getProperty(PASSWORD).getValue() + "@" + getURI(context).substring(10); + + } else { + uriPass = getURI(context); + } + mongoClient = new MongoClient(new MongoClientURI(uriPass)); + } else { + mongoClient = new MongoClient(new MongoClientURI(getURI(context), getClientOptions(sslContext))); + } + } catch (Exception e) { + getLogger().error("Failed to schedule {} due to {}", new Object[] { this.getClass().getName(), e }, e); + throw e; + } + } + } diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java index ddea9a8596a0..08b7f0dea1a8 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Lists; +import com.mongodb.BasicDBObject; import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; import com.mongodb.client.MongoCollection; @@ -43,6 +44,8 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Collection; +import java.util.ArrayList; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -61,9 +64,9 @@ public class GetMongoIT { static { CAL = Calendar.getInstance(); DOCUMENTS = Lists.newArrayList( - new Document("_id", "doc_1").append("a", 1).append("b", 2).append("c", 3), - new Document("_id", "doc_2").append("a", 1).append("b", 2).append("c", 4).append("date_field", CAL.getTime()), - new Document("_id", "doc_3").append("a", 1).append("b", 3) + new Document("_id", "doc_1").append("a", 1).append("b", 2).append("c", 3), + new Document("_id", "doc_2").append("a", 1).append("b", 2).append("c", 4).append("date_field", CAL.getTime()), + new Document("_id", "doc_3").append("a", 1).append("b", 3) ); } @@ -492,7 +495,7 @@ public void testDatabaseEL() { for (int x = 0; x < collections.length; x++) { MongoDatabase db = mongoClient.getDatabase(dbs[x]); db.getCollection(collections[x]) - .insertOne(new Document().append("msg", "Hello, World")); + .insertOne(new Document().append("msg", "Hello, World")); Map attrs = new HashMap<>(); attrs.put("db", dbs[x]); @@ -668,4 +671,53 @@ public void testSendEmpty() throws Exception { MockFlowFile flowFile = flowFiles.get(0); Assert.assertEquals(0, flowFile.getSize()); } + + + @Test + public void testReadUserPaswd() throws Exception { + final String username = "myuser"; + final String password = "password"; + mongoClient = new MongoClient(new MongoClientURI(MONGO_URI)); + final MongoDatabase db = mongoClient.getDatabase(DB_NAME); + final BasicDBObject createUserCommand = new BasicDBObject("createUser", username).append("pwd", password).append("roles", + java.util.Collections.singletonList(new BasicDBObject("role", "dbOwner").append("db", DB_NAME))); + + BasicDBObject getUsersInfoCommand = new BasicDBObject("usersInfo", new BasicDBObject("user", username).append("db", DB_NAME)); + Document result = db.runCommand(getUsersInfoCommand); + BasicDBObject dropUserCommand = new BasicDBObject("dropUser", username); + + ArrayList users = (ArrayList) result.get("users"); + if (!users.isEmpty()) { + db.runCommand(dropUserCommand); + System.out.println("dropping user"); + } + db.runCommand(createUserCommand); + + //setting new property + runner.removeProperty(AbstractMongoProcessor.URI); + runner.setVariable("uri", "mongodb://localhost:27017/?authSource="+DB_NAME); + runner.setProperty(AbstractMongoProcessor.URI, "${uri}"); + runner.setProperty(GetMongo.PASSWORD,password); + runner.setProperty(GetMongo.USER_NAME,username); + + runner.setVariable("query", "{\"_id\": \"doc_2\"}"); + runner.setProperty(GetMongo.QUERY, "${query}"); + runner.setProperty(GetMongo.JSON_TYPE, GetMongo.JSON_STANDARD); + runner.run(); + runner.assertAllFlowFilesTransferred(GetMongo.REL_SUCCESS, 1); + + List flowFiles = runner.getFlowFilesForRelationship(GetMongo.REL_SUCCESS); + byte[] raw = runner.getContentAsByteArray(flowFiles.get(0)); + ObjectMapper mapper = new ObjectMapper(); + Map parsed = mapper.readValue(raw, Map.class); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + + // Drop the user which was created + db.runCommand(dropUserCommand); + + Assert.assertTrue(parsed.get("date_field").getClass() == String.class); + Assert.assertTrue(((String)parsed.get("date_field")).startsWith(format.format(CAL.getTime()))); + + } + } From a7edf6a27fc456906e7e2bb870954f44f4d4326e Mon Sep 17 00:00:00 2001 From: karthik kadajji Date: Mon, 27 Apr 2020 10:22:47 +0200 Subject: [PATCH 2/5] NIFI-7037 Split off username and password fields for GetMongo processor --- .../nifi/processors/mongodb/GetMongo.java | 23 +++++++++---------- .../nifi/processors/mongodb/GetMongoIT.java | 17 +++++++------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index b6fc773e5893..77c531d58ed9 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -64,20 +64,20 @@ @InputRequirement(Requirement.INPUT_ALLOWED) @CapabilityDescription("Creates FlowFiles from documents in MongoDB loaded by a user-specified query.") @WritesAttributes({ - @WritesAttribute(attribute = GetMongo.DB_NAME, description = "The database where the results came from."), - @WritesAttribute(attribute = GetMongo.COL_NAME, description = "The collection where the results came from.") + @WritesAttribute(attribute = GetMongo.DB_NAME, description = "The database where the results came from."), + @WritesAttribute(attribute = GetMongo.COL_NAME, description = "The collection where the results came from.") }) public class GetMongo extends AbstractMongoQueryProcessor { public static final PropertyDescriptor SEND_EMPTY_RESULTS = new PropertyDescriptor.Builder() - .name("get-mongo-send-empty") - .displayName("Send Empty Result") - .description("If a query executes successfully, but returns no results, send an empty JSON document " + - "signifying no result.") - .allowableValues("true", "false") - .defaultValue("false") - .addValidator(StandardValidators.BOOLEAN_VALIDATOR) - .required(false) - .build(); + .name("get-mongo-send-empty") + .displayName("Send Empty Result") + .description("If a query executes successfully, but returns no results, send an empty JSON document " + + "signifying no result.") + .allowableValues("true", "false") + .defaultValue("false") + .addValidator(StandardValidators.BOOLEAN_VALIDATOR) + .required(false) + .build(); static final AllowableValue YES_PP = new AllowableValue("true", "True"); static final AllowableValue NO_PP = new AllowableValue("false", "False"); @@ -281,7 +281,6 @@ public void onTrigger(final ProcessContext context, final ProcessSession session String uriPass=""; if (context.getProperty(USER_NAME).getValue() != null) { uriPass = "mongodb://" + context.getProperty(USER_NAME).getValue() + ":" + context.getProperty(PASSWORD).getValue() + "@" + getURI(context).substring(10); - } else { uriPass = getURI(context); } diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java index 08b7f0dea1a8..8180e42f420d 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java @@ -64,9 +64,9 @@ public class GetMongoIT { static { CAL = Calendar.getInstance(); DOCUMENTS = Lists.newArrayList( - new Document("_id", "doc_1").append("a", 1).append("b", 2).append("c", 3), - new Document("_id", "doc_2").append("a", 1).append("b", 2).append("c", 4).append("date_field", CAL.getTime()), - new Document("_id", "doc_3").append("a", 1).append("b", 3) + new Document("_id", "doc_1").append("a", 1).append("b", 2).append("c", 3), + new Document("_id", "doc_2").append("a", 1).append("b", 2).append("c", 4).append("date_field", CAL.getTime()), + new Document("_id", "doc_3").append("a", 1).append("b", 3) ); } @@ -495,7 +495,7 @@ public void testDatabaseEL() { for (int x = 0; x < collections.length; x++) { MongoDatabase db = mongoClient.getDatabase(dbs[x]); db.getCollection(collections[x]) - .insertOne(new Document().append("msg", "Hello, World")); + .insertOne(new Document().append("msg", "Hello, World")); Map attrs = new HashMap<>(); attrs.put("db", dbs[x]); @@ -689,16 +689,15 @@ public void testReadUserPaswd() throws Exception { ArrayList users = (ArrayList) result.get("users"); if (!users.isEmpty()) { db.runCommand(dropUserCommand); - System.out.println("dropping user"); } db.runCommand(createUserCommand); //setting new property runner.removeProperty(AbstractMongoProcessor.URI); - runner.setVariable("uri", "mongodb://localhost:27017/?authSource="+DB_NAME); + runner.setVariable("uri", "mongodb://localhost:27017/?authSource=" + DB_NAME); runner.setProperty(AbstractMongoProcessor.URI, "${uri}"); - runner.setProperty(GetMongo.PASSWORD,password); - runner.setProperty(GetMongo.USER_NAME,username); + runner.setProperty(GetMongo.PASSWORD, password); + runner.setProperty(GetMongo.USER_NAME, username); runner.setVariable("query", "{\"_id\": \"doc_2\"}"); runner.setProperty(GetMongo.QUERY, "${query}"); @@ -716,7 +715,7 @@ public void testReadUserPaswd() throws Exception { db.runCommand(dropUserCommand); Assert.assertTrue(parsed.get("date_field").getClass() == String.class); - Assert.assertTrue(((String)parsed.get("date_field")).startsWith(format.format(CAL.getTime()))); + Assert.assertTrue(((String) parsed.get("date_field")).startsWith(format.format(CAL.getTime()))); } From 546450fff9b430a99b33889c89031e3b4b320d2a Mon Sep 17 00:00:00 2001 From: karthik kadajji Date: Mon, 27 Apr 2020 10:29:11 +0200 Subject: [PATCH 3/5] NIFI-7037 Split off username and password fields for GetMongo processor --- .../main/java/org/apache/nifi/processors/mongodb/GetMongo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index 77c531d58ed9..5956d0d526b0 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -72,7 +72,7 @@ public class GetMongo extends AbstractMongoQueryProcessor { .name("get-mongo-send-empty") .displayName("Send Empty Result") .description("If a query executes successfully, but returns no results, send an empty JSON document " + - "signifying no result.") + "signifying no result.") .allowableValues("true", "false") .defaultValue("false") .addValidator(StandardValidators.BOOLEAN_VALIDATOR) From ae4d4d7d300d27a8ac41922b87fa3ec6bce9c65c Mon Sep 17 00:00:00 2001 From: karthik kadajji Date: Mon, 27 Apr 2020 13:52:13 +0200 Subject: [PATCH 4/5] NIFI-7037 Split off username and password fields for GetMongo processor --- .../main/java/org/apache/nifi/processors/mongodb/GetMongo.java | 2 +- .../java/org/apache/nifi/processors/mongodb/GetMongoIT.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index 5956d0d526b0..ca131d308394 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -278,7 +278,7 @@ public void onTrigger(final ProcessContext context, final ProcessSession session }); outgoingFlowFile = session.putAllAttributes(outgoingFlowFile, attributes); - String uriPass=""; + String uriPass = ""; if (context.getProperty(USER_NAME).getValue() != null) { uriPass = "mongodb://" + context.getProperty(USER_NAME).getValue() + ":" + context.getProperty(PASSWORD).getValue() + "@" + getURI(context).substring(10); } else { diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java index 8180e42f420d..ca17059369e4 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java @@ -716,7 +716,5 @@ public void testReadUserPaswd() throws Exception { Assert.assertTrue(parsed.get("date_field").getClass() == String.class); Assert.assertTrue(((String) parsed.get("date_field")).startsWith(format.format(CAL.getTime()))); - } - } From 1db5d206c0f2af47402ecd449b3b8dea1b32fddb Mon Sep 17 00:00:00 2001 From: karthik kadajji Date: Mon, 27 Apr 2020 13:57:14 +0200 Subject: [PATCH 5/5] NIFI-7037 Split off username and password fields for GetMongo processor --- .../test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java index ca17059369e4..a86907405091 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoIT.java @@ -672,7 +672,6 @@ public void testSendEmpty() throws Exception { Assert.assertEquals(0, flowFile.getSize()); } - @Test public void testReadUserPaswd() throws Exception { final String username = "myuser";