Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.iceberg.flink;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public abstract class AvroGenericRecordConverterBase {
protected abstract void testConverter(DataGenerator dataGenerator) throws Exception;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static org.apache.iceberg.types.Types.NestedField.optional;
import static org.apache.iceberg.types.Types.NestedField.required;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -44,8 +45,7 @@
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.types.Types;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class TestDataFileSerialization {

Expand Down Expand Up @@ -135,23 +135,19 @@ public void testJavaSerialization() throws Exception {
new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()))) {
for (int i = 0; i < 2; i += 1) {
Object obj = in.readObject();
Assertions.assertThat(obj).as("Should be a DataFile").isInstanceOf(DataFile.class);
assertThat(obj).as("Should be a DataFile").isInstanceOf(DataFile.class);
TestHelpers.assertEquals(DATA_FILE, (DataFile) obj);
}

for (int i = 0; i < 2; i += 1) {
Object obj = in.readObject();
Assertions.assertThat(obj)
.as("Should be a position DeleteFile")
.isInstanceOf(DeleteFile.class);
assertThat(obj).as("Should be a position DeleteFile").isInstanceOf(DeleteFile.class);
TestHelpers.assertEquals(POS_DELETE_FILE, (DeleteFile) obj);
}

for (int i = 0; i < 2; i += 1) {
Object obj = in.readObject();
Assertions.assertThat(obj)
.as("Should be a equality DeleteFile")
.isInstanceOf(DeleteFile.class);
assertThat(obj).as("Should be a equality DeleteFile").isInstanceOf(DeleteFile.class);
TestHelpers.assertEquals(EQ_DELETE_FILE, (DeleteFile) obj);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/
package org.apache.iceberg.flink;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.iceberg.CatalogProperties;
Expand All @@ -26,15 +29,14 @@
import org.apache.iceberg.hive.HiveCatalog;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class TestFlinkCatalogFactory {

private Map<String, String> props;

@Before
@BeforeEach
public void before() {
props = Maps.newHashMap();
props.put("type", "iceberg");
Expand All @@ -51,7 +53,7 @@ public void testCreateCatalogHive() {
FlinkCatalogFactory.createCatalogLoader(catalogName, props, new Configuration())
.loadCatalog();

Assertions.assertThat(catalog).isNotNull().isInstanceOf(HiveCatalog.class);
assertThat(catalog).isNotNull().isInstanceOf(HiveCatalog.class);
}

@Test
Expand All @@ -64,7 +66,7 @@ public void testCreateCatalogHadoop() {
FlinkCatalogFactory.createCatalogLoader(catalogName, props, new Configuration())
.loadCatalog();

Assertions.assertThat(catalog).isNotNull().isInstanceOf(HadoopCatalog.class);
assertThat(catalog).isNotNull().isInstanceOf(HadoopCatalog.class);
}

@Test
Expand All @@ -76,7 +78,7 @@ public void testCreateCatalogCustom() {
FlinkCatalogFactory.createCatalogLoader(catalogName, props, new Configuration())
.loadCatalog();

Assertions.assertThat(catalog).isNotNull().isInstanceOf(CustomHadoopCatalog.class);
assertThat(catalog).isNotNull().isInstanceOf(CustomHadoopCatalog.class);
}

@Test
Expand All @@ -86,7 +88,7 @@ public void testCreateCatalogCustomWithHiveCatalogTypeSet() {
props.put(
FlinkCatalogFactory.ICEBERG_CATALOG_TYPE, FlinkCatalogFactory.ICEBERG_CATALOG_TYPE_HIVE);

Assertions.assertThatThrownBy(
assertThatThrownBy(
() -> FlinkCatalogFactory.createCatalogLoader(catalogName, props, new Configuration()))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageStartingWith(
Expand All @@ -98,7 +100,7 @@ public void testLoadCatalogUnknown() {
String catalogName = "unknownCatalog";
props.put(FlinkCatalogFactory.ICEBERG_CATALOG_TYPE, "fooType");

Assertions.assertThatThrownBy(
assertThatThrownBy(
() -> FlinkCatalogFactory.createCatalogLoader(catalogName, props, new Configuration()))
.isInstanceOf(UnsupportedOperationException.class)
.hasMessageStartingWith("Unknown catalog-type: fooType");
Expand Down
Loading