nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi] SandishKumarHN commented on a change in pull request #3748: NIFI-6680: Nifi PutKudu processor - Convert record field names to low…
Date Wed, 25 Sep 2019 21:37:13 GMT
SandishKumarHN commented on a change in pull request #3748: NIFI-6680: Nifi PutKudu processor
- Convert record field names to low…
URL: https://github.com/apache/nifi/pull/3748#discussion_r328351902
 
 

 ##########
 File path: nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-processors/src/test/java/org/apache/nifi/processors/kudu/TestPutKudu.java
 ##########
 @@ -366,54 +368,82 @@ public void testUpdateFlowFiles() throws Exception {
 
     @Test
     public void testBuildRow() {
-        buildPartialRow((long) 1, "foo", (short) 10);
+        buildPartialRow((long) 1, "foo", (short) 10, "id", "id", false);
     }
 
     @Test
     public void testBuildPartialRowNullable() {
-        buildPartialRow((long) 1, null, (short) 10);
+        buildPartialRow((long) 1, null, (short) 10, "id", "id",  false);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testBuildPartialRowNullPrimaryKey() {
-        buildPartialRow(null, "foo", (short) 10);
+        buildPartialRow(null, "foo", (short) 10, "id", "id",  false);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testBuildPartialRowNotNullable() {
-        buildPartialRow((long) 1, "foo", null);
+        buildPartialRow((long) 1, "foo", null, "id", "id", false);
     }
 
-    private void buildPartialRow(Long id, String name, Short age) {
+    @Test
+    public void testBuildPartialRowLowercaseFields() {
+        PartialRow row = buildPartialRow((long) 1, "foo", (short) 10, "id", "ID", true);
+        row.getLong("id");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testBuildPartialRowLowercaseFieldsFalse() {
+        PartialRow row = buildPartialRow((long) 1, "foo", (short) 10, "id", "ID", false);
+        row.getLong("id");
+    }
+
+    @Test
+    public void testBuildPartialRowLowercaseFieldsKuduUpper() {
+        PartialRow row = buildPartialRow((long) 1, "foo", (short) 10, "ID", "ID", false);
+        row.getLong("ID");
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testBuildPartialRowLowercaseFieldsKuduUpperFail() {
+        PartialRow row = buildPartialRow((long) 1, "foo", (short) 10, "ID", "ID", true);
+        row.getLong("ID");
+    }
+
+    private PartialRow buildPartialRow(Long id, String name, Short age, String kuduIdName,
String recordIdName, Boolean lowercaseFields) {
         final Schema kuduSchema = new Schema(Arrays.asList(
 
 Review comment:
   @kjmccarthy nit: can you keep the original indent 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message