Copilot commented on code in PR #6042:
URL: https://github.com/apache/texera/pull/6042#discussion_r3502721430


##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/scan/FileAttributeTypeSpec.scala:
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.texera.amber.operator.source.scan
+
+import org.apache.texera.amber.core.tuple.AttributeType
+import org.apache.texera.amber.util.JSONUtils.objectMapper
+import org.scalatest.flatspec.AnyFlatSpec
+import org.scalatest.matchers.should.Matchers
+
+class FileAttributeTypeSpec extends AnyFlatSpec with Matchers {
+
+  "FileAttributeType" should "map each constant to its wire name (also its 
toString)" in {
+    FileAttributeType.STRING.getName shouldBe "string"
+    FileAttributeType.SINGLE_STRING.getName shouldBe "single string"
+    FileAttributeType.INTEGER.getName shouldBe "integer"
+    FileAttributeType.LONG.getName shouldBe "long"
+    FileAttributeType.DOUBLE.getName shouldBe "double"
+    FileAttributeType.BOOLEAN.getName shouldBe "boolean"
+    FileAttributeType.TIMESTAMP.getName shouldBe "timestamp"
+    FileAttributeType.BINARY.getName shouldBe "binary"
+    FileAttributeType.LARGE_BINARY.getName shouldBe "large binary"
+    FileAttributeType.values() should have length 9
+    FileAttributeType.SINGLE_STRING.toString shouldBe "single string"
+  }

Review Comment:
   The test description claims it verifies the wire name mapping and 
`toString`, but it currently only asserts `toString` for `SINGLE_STRING`. To 
match the description and avoid missing regressions, assert `toString == 
getName` for all enum constants (can be done in a small loop).



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

Reply via email to