exceptionfactory commented on a change in pull request #5304:
URL: https://github.com/apache/nifi/pull/5304#discussion_r687668668
##########
File path:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/main/java/org/apache/nifi/mongodb/MongoDBLookupService.java
##########
@@ -67,6 +66,10 @@
"then the entire MongoDB result document minus the _id field will be
returned as a record."
)
public class MongoDBLookupService extends JsonInferenceSchemaRegistryService
implements LookupService<Object> {
+ public static final PropertyDescriptor LOCAL_SCHEMA_NAME = new
PropertyDescriptor.Builder()
+ .fromPropertyDescriptor(SCHEMA_NAME)
+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .build();
Review comment:
Is there a reason for introducing this change as part of this PR?
##########
File path:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
##########
@@ -243,23 +246,28 @@ public void testServiceParameters() {
Map<String, Object> criteria = new HashMap<>();
criteria.put("uuid", "x-y-z");
- boolean error = false;
- try {
- service.lookup(criteria);
- } catch(Exception ex) {
- error = true;
- }
+// boolean error = false;
+// try {
+// service.lookup(criteria);
+// } catch(Exception ex) {
+// error = true;
+// }
Review comment:
Is there a reason for leaving these lines commented out? If they are no
longer functional, recommend removing them completely, as well as other
commented lines.
##########
File path:
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-services/src/test/java/org/apache/nifi/mongodb/MongoDBLookupServiceIT.java
##########
@@ -243,23 +246,28 @@ public void testServiceParameters() {
Map<String, Object> criteria = new HashMap<>();
criteria.put("uuid", "x-y-z");
- boolean error = false;
- try {
- service.lookup(criteria);
- } catch(Exception ex) {
- error = true;
- }
+// boolean error = false;
+// try {
+// service.lookup(criteria);
+// } catch(Exception ex) {
+// error = true;
+// }
- Assert.assertFalse("An error was thrown when no error should have been
thrown.", error);
- error = false;
+// Assertions.assertFalse(error, "An error was thrown when no error
should have been thrown.");
- try {
- service.lookup(new HashMap());
- } catch (Exception ex) {
- error = true;
- Assert.assertTrue("The exception was the wrong type", ex
instanceof LookupFailureException);
- }
+ assertDoesNotThrow(() -> service.lookup(criteria));
+
+// error = false;
+
+ assertThrows(LookupFailureException.class, () -> service.lookup(new
HashMap<>()));
- Assert.assertTrue("An error was not thrown when the input was empty",
error);
+// try {
+// service.lookup(new HashMap());
+// } catch (Exception ex) {
+// error = true;
+// Assertions.assertTrue(ex instanceof LookupFailureException, "The
exception was the wrong type");
+// }
+//
+// Assertions.assertTrue(error, "An error was not thrown when the input
was empty");
Review comment:
It looks like these lines could be removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]