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

 ##########
 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);
+    }
+
+    public void can_create_a_simple_record_schema_with_bad_type_case() throws 
IOException {
 
 Review comment:
   `@Test` annotation is missing.
   Otherwise the test runs fine now.

----------------------------------------------------------------
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