turcsanyip commented on a change in pull request #3570: Fix for NIFI-6422
URL: https://github.com/apache/nifi/pull/3570#discussion_r303635343
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/test/java/org/apache/nifi/processors/gcp/bigquery/BigQueryUtilsTest.java
 ##########
 @@ -0,0 +1,50 @@
+package org.apache.nifi.processors.gcp.bigquery;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.google.cloud.bigquery.Field;
+import com.google.cloud.bigquery.LegacySQLTypeName;
+import com.google.cloud.bigquery.Schema;
+import com.google.cloud.bigquery.Field.Mode;
+
+public class BigQueryUtilsTest {
+
+    @Test
+    public void can_create_a_simple_boolean_schema() throws IOException {
+        final String jsonRead = new String(
+                
Files.readAllBytes(Paths.get("src/test/resources/schemas/simple_boolean_schema.json"))
+        );
+        Field booleanField = Field.newBuilder("boolean", 
LegacySQLTypeName.BOOLEAN).setMode(Mode.NULLABLE).build();
+        Schema expected = Schema.of(booleanField);
+        Assert.assertEquals(BigQueryUtils.schemaFromString(jsonRead), 
expected);
 
 Review comment:
   `assert*` methods expect the `expected` value as their first argument, and 
the `actual` as the second.
   It would work in this way too, only the test failure messages would be 
misleading, because the expected/actual would be swapped.
   Please check the other two test methods too.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to