RussellSpitzer commented on code in PR #7770:
URL: https://github.com/apache/iceberg/pull/7770#discussion_r1543278782


##########
core/src/test/java/org/apache/iceberg/TestManifestListEncryption.java:
##########
@@ -0,0 +1,127 @@
+/*
+ * 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.iceberg;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import org.apache.avro.InvalidAvroMagicException;
+import org.apache.iceberg.encryption.EncryptedFiles;
+import org.apache.iceberg.encryption.EncryptedInputFile;
+import org.apache.iceberg.encryption.EncryptedOutputFile;
+import org.apache.iceberg.encryption.EncryptionKeyMetadata;
+import org.apache.iceberg.encryption.EncryptionManager;
+import org.apache.iceberg.encryption.EncryptionTestHelpers;
+import org.apache.iceberg.exceptions.RuntimeIOException;
+import org.apache.iceberg.inmemory.InMemoryOutputFile;
+import org.apache.iceberg.io.FileAppender;
+import org.apache.iceberg.io.InputFile;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
+import org.assertj.core.api.Assertions;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestManifestListEncryption {
+  private static final String PATH = "s3://bucket/table/m1.avro";
+  private static final long LENGTH = 1024L;
+  private static final int SPEC_ID = 1;
+  private static final long SEQ_NUM = 34L;
+  private static final long MIN_SEQ_NUM = 10L;
+  private static final long SNAPSHOT_ID = 987134631982734L;
+  private static final int ADDED_FILES = 2;
+  private static final long ADDED_ROWS = 5292L;
+  private static final int EXISTING_FILES = 343;
+  private static final long EXISTING_ROWS = 857273L;
+  private static final int DELETED_FILES = 1;
+  private static final long DELETED_ROWS = 22910L;
+  private static final List<ManifestFile.PartitionFieldSummary> 
PARTITION_SUMMARIES =
+      ImmutableList.of();
+  private static final ByteBuffer MANIFEST_KEY_METADATA = 
ByteBuffer.allocate(100);
+
+  private static final ManifestFile TEST_MANIFEST =
+      new GenericManifestFile(
+          PATH,
+          LENGTH,
+          SPEC_ID,
+          ManifestContent.DATA,
+          SEQ_NUM,
+          MIN_SEQ_NUM,
+          SNAPSHOT_ID,
+          ADDED_FILES,
+          ADDED_ROWS,
+          EXISTING_FILES,
+          EXISTING_ROWS,
+          DELETED_FILES,
+          DELETED_ROWS,
+          PARTITION_SUMMARIES,
+          MANIFEST_KEY_METADATA);
+
+  private static final EncryptionManager ENCRYPTION_MANAGER =
+      EncryptionTestHelpers.createEncryptionManager();
+
+  @Test
+  public void testV2Write() throws IOException {
+    ManifestFile manifest = writeAndReadManifestList();
+
+    // all v2 fields should be read correctly

Review Comment:
   Assert J has some helper for this, Not sure if it is correct
   
   ```java
   assertThat(actual).usingRecursiveComparison().isEqualTo(expected);
   ```



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to