Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove all display names #35512

Merged
merged 4 commits into from
Feb 27, 2024
Merged
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
1 change: 1 addition & 0 deletions airbyte-cdk/java/airbyte-cdk/README.md
Original file line number Diff line number Diff line change
@@ -166,6 +166,7 @@ MavenLocal debugging steps:

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.23.5 | 2024-02-26 | [\#35512](https://github.com/airbytehq/airbyte/pull/35512) | Rmove @DisplayName from all CDK tests. |
| 0.23.4 | 2024-02-26 | [\#35507](https://github.com/airbytehq/airbyte/pull/35507) | Add more logs into TestDatabase. |
| 0.23.3 | 2024-02-26 | [\#35495](https://github.com/airbytehq/airbyte/pull/35495) | Fix Junit Interceptor to print better stacktraces |
| 0.23.2 | 2024-02-22 | [\#35385](https://github.com/airbytehq/airbyte/pull/35342) | Bugfix: inverted logic of disableTypeDedupe flag |
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.23.4
version=0.23.5
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@
import java.util.Collections;
import java.util.Iterator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;

@@ -289,7 +288,7 @@ void testUnicodeNull() {
}

@Test
@DisplayName("When initial cursor is null, and emit state for every record")
// When initial cursor is null, and emit state for every record
void testStateEmissionFrequency1() {
messageIterator = MoreIterators.of(RECORD_MESSAGE_1, RECORD_MESSAGE_2, RECORD_MESSAGE_3, RECORD_MESSAGE_4, RECORD_MESSAGE_5);
final StateDecoratingIterator iterator1 = new StateDecoratingIterator(
@@ -320,7 +319,7 @@ void testStateEmissionFrequency1() {
}

@Test
@DisplayName("When initial cursor is null, and emit state for every 2 records")
// When initial cursor is null, and emit state for every 2 records
void testStateEmissionFrequency2() {
messageIterator = MoreIterators.of(RECORD_MESSAGE_1, RECORD_MESSAGE_2, RECORD_MESSAGE_3, RECORD_MESSAGE_4, RECORD_MESSAGE_5);
final StateDecoratingIterator iterator1 = new StateDecoratingIterator(
@@ -346,7 +345,7 @@ void testStateEmissionFrequency2() {
}

@Test
@DisplayName("When initial cursor is not null")
// When initial cursor is not null
void testStateEmissionWhenInitialCursorIsNotNull() {
messageIterator = MoreIterators.of(RECORD_MESSAGE_2, RECORD_MESSAGE_3, RECORD_MESSAGE_4, RECORD_MESSAGE_5);
final StateDecoratingIterator iterator1 = new StateDecoratingIterator(
@@ -396,7 +395,7 @@ void testStateEmissionWhenInitialCursorIsNotNull() {
* <a href="https://github.com/airbytehq/airbyte/issues/15427">link</a>
*/
@Test
@DisplayName("When there are multiple records with the same cursor value")
// When there are multiple records with the same cursor value
void testStateEmissionForRecordsSharingSameCursorValue() {

messageIterator = MoreIterators.of(
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@
import java.util.stream.Stream;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -327,7 +326,7 @@ protected void assertExpectedRecords(final Set<JsonNode> expectedRecords,
}

@Test
@DisplayName("On the first sync, produce returns records that exist in the database.")
// On the first sync, produce returns records that exist in the database.
void testExistingData() throws Exception {
final CdcTargetPosition targetPosition = cdcLatestTargetPosition();
final AutoCloseableIterator<AirbyteMessage> read = source().read(config(), getConfiguredCatalog(), null);
@@ -351,7 +350,7 @@ protected void compareTargetPositionFromTheRecordsWithTargetPostionGeneratedBefo
}

@Test
@DisplayName("When a record is deleted, produces a deletion record.")
// When a record is deleted, produces a deletion record.
void testDelete() throws Exception {
final AutoCloseableIterator<AirbyteMessage> read1 = source()
.read(config(), getConfiguredCatalog(), null);
@@ -379,7 +378,7 @@ protected void assertExpectedStateMessagesFromIncrementalSync(final List<Airbyte
}

@Test
@DisplayName("When a record is updated, produces an update record.")
// When a record is updated, produces an update record.
void testUpdate() throws Exception {
final String updatedModel = "Explorer";
final AutoCloseableIterator<AirbyteMessage> read1 = source()
@@ -406,7 +405,8 @@ void testUpdate() throws Exception {

@SuppressWarnings({"BusyWait", "CodeBlock2Expr"})
@Test
@DisplayName("Verify that when data is inserted into the database while a sync is happening and after the first sync, it all gets replicated.")
// Verify that when data is inserted into the database while a sync is happening and after the first
// sync, it all gets replicated.
protected void testRecordsProducedDuringAndAfterSync() throws Exception {

final int recordsToCreate = 20;
@@ -472,7 +472,8 @@ protected void assertExpectedStateMessagesForRecordsProducedDuringAndAfterSync(f
}

@Test
@DisplayName("When both incremental CDC and full refresh are configured for different streams in a sync, the data is replicated as expected.")
// When both incremental CDC and full refresh are configured for different streams in a sync, the
// data is replicated as expected.
void testCdcAndFullRefreshInSameSync() throws Exception {
final ConfiguredAirbyteCatalog configuredCatalog = Jsons.clone(getConfiguredCatalog());

@@ -545,7 +546,7 @@ void testCdcAndFullRefreshInSameSync() throws Exception {
}

@Test
@DisplayName("When no records exist, no records are returned.")
// When no records exist, no records are returned.
void testNoData() throws Exception {

deleteCommand(MODELS_STREAM_NAME);
@@ -563,7 +564,7 @@ protected void assertExpectedStateMessagesForNoData(final List<AirbyteStateMessa
}

@Test
@DisplayName("When no changes have been made to the database since the previous sync, no records are returned.")
// When no changes have been made to the database since the previous sync, no records are returned.
void testNoDataOnSecondSync() throws Exception {
final AutoCloseableIterator<AirbyteMessage> read1 = source()
.read(config(), getConfiguredCatalog(), null);
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
import static org.mockito.Mockito.when;

import java.util.concurrent.Callable;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
@@ -28,7 +27,7 @@ public class AirbyteApiClientTest {
class RetryWithJitter {

@Test
@DisplayName("Should not retry on success")
// Should not retry on success
void ifSucceedShouldNotRetry() throws Exception {
mockCallable = mock(Callable.class);
when(mockCallable.call()).thenReturn("Success!");
@@ -39,7 +38,7 @@ void ifSucceedShouldNotRetry() throws Exception {
}

@Test
@DisplayName("Should retry up to the configured max retries on continued errors")
// Should retry up to the configured max retries on continued errors
void onlyRetryTillMaxRetries() throws Exception {
mockCallable = mock(Callable.class);
when(mockCallable.call()).thenThrow(new RuntimeException("Bomb!"));
@@ -51,7 +50,7 @@ void onlyRetryTillMaxRetries() throws Exception {
}

@Test
@DisplayName("Should retry only if there are errors")
// Should retry only if there are errors
void onlyRetryOnErrors() throws Exception {
mockCallable = mock(Callable.class);
// Because we succeed on the second try, we should only call the method twice.
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
import java.util.Map;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.slf4j.MDC;

@@ -23,7 +22,7 @@ void init() {
}

@Test
@DisplayName("The MDC context is properly overrided")
// The MDC context is properly overrided
void testMDCModified() {
try (final MdcScope ignored = new MdcScope(modificationInMDC)) {
final Map<String, String> mdcState = MDC.getCopyOfContextMap();
@@ -34,7 +33,7 @@ void testMDCModified() {
}

@Test
@DisplayName("The MDC context is properly restored")
// The MDC context is properly restored
void testMDCRestore() {
try (final MdcScope ignored = new MdcScope(modificationInMDC)) {}

Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import io.airbyte.commons.jackson.MoreMappers;
import io.airbyte.configoss.StandardDestinationDefinition;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

@@ -57,15 +56,15 @@ class YamlListToStandardDefinitionsTest {
+ " documentationUrl";

@Nested
@DisplayName("vertifyAndConvertToJsonNode")
// vertifyAndConvertToJsonNode
class VerifyAndConvertToJsonNode {

private static final String ID_NAME = "destinationDefinitionId";

private final ObjectMapper mapper = MoreMappers.initMapper();

@Test
@DisplayName("should correctly read yaml file")
// should correctly read yaml file
void correctlyReadTest() throws JsonProcessingException {
final var jsonDefs = YamlListToStandardDefinitions.verifyAndConvertToJsonNode(ID_NAME, GOOD_DES_DEF_YAML);
final var defList = mapper.treeToValue(jsonDefs, StandardDestinationDefinition[].class);
@@ -74,37 +73,37 @@ void correctlyReadTest() throws JsonProcessingException {
}

@Test
@DisplayName("should error out on duplicate id")
// should error out on duplicate id
void duplicateIdTest() {
assertThrows(RuntimeException.class, () -> YamlListToStandardDefinitions.verifyAndConvertToJsonNode(ID_NAME, DUPLICATE_ID));
}

@Test
@DisplayName("should error out on duplicate name")
// should error out on duplicate name
void duplicateNameTest() {
assertThrows(RuntimeException.class, () -> YamlListToStandardDefinitions.verifyAndConvertToJsonNode(ID_NAME, DUPLICATE_NAME));
}

@Test
@DisplayName("should error out on empty file")
// should error out on empty file
void emptyFileTest() {
assertThrows(RuntimeException.class, () -> YamlListToStandardDefinitions.verifyAndConvertToJsonNode(ID_NAME, ""));
}

@Test
@DisplayName("should error out on bad data")
// should error out on bad data
void badDataTest() {
assertThrows(RuntimeException.class, () -> YamlListToStandardDefinitions.verifyAndConvertToJsonNode(ID_NAME, BAD_DATA));
}

}

@Nested
@DisplayName("verifyAndConvertToModelList")
// verifyAndConvertToModelList
class VerifyAndConvertToModelList {

@Test
@DisplayName("should correctly read yaml file")
// should correctly read yaml file
void correctlyReadTest() {
final var defs = YamlListToStandardDefinitions
.verifyAndConvertToModelList(StandardDestinationDefinition.class, GOOD_DES_DEF_YAML);
@@ -113,28 +112,28 @@ void correctlyReadTest() {
}

@Test
@DisplayName("should error out on duplicate id")
// should error out on duplicate id
void duplicateIdTest() {
assertThrows(RuntimeException.class,
() -> YamlListToStandardDefinitions.verifyAndConvertToModelList(StandardDestinationDefinition.class, DUPLICATE_ID));
}

@Test
@DisplayName("should error out on duplicate name")
// should error out on duplicate name
void duplicateNameTest() {
assertThrows(RuntimeException.class,
() -> YamlListToStandardDefinitions.verifyAndConvertToModelList(StandardDestinationDefinition.class, DUPLICATE_NAME));
}

@Test
@DisplayName("should error out on empty file")
// should error out on empty file
void emptyFileTest() {
assertThrows(RuntimeException.class,
() -> YamlListToStandardDefinitions.verifyAndConvertToModelList(StandardDestinationDefinition.class, ""));
}

@Test
@DisplayName("should error out on bad data")
// should error out on bad data
void badDataTest() {
assertThrows(RuntimeException.class,
() -> YamlListToStandardDefinitions.verifyAndConvertToModelList(StandardDestinationDefinition.class, BAD_DATA));
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@
import java.util.function.BiConsumer;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
@@ -65,7 +64,7 @@ private void runShutdown() {
}

@SuppressWarnings("BusyWait")
@DisplayName("Verify that shutdown waits indefinitely when heartbeat and process are healthy.")
// Verify that shutdown waits indefinitely when heartbeat and process are healthy.
@Test
void testStartsWait() throws InterruptedException {
when(process.isAlive()).thenReturn(true);
@@ -86,7 +85,7 @@ void testStartsWait() throws InterruptedException {
}

@Test
@DisplayName("Test heartbeat ends and graceful shutdown.")
// Test heartbeat ends and graceful shutdown.
void testGracefulShutdown() {
when(heartbeatMonitor.isBeating()).thenReturn(false);
when(process.isAlive()).thenReturn(false);
@@ -97,7 +96,7 @@ void testGracefulShutdown() {
}

@Test
@DisplayName("Test heartbeat ends and shutdown is forced.")
// Test heartbeat ends and shutdown is forced.
void testForcedShutdown() {
when(heartbeatMonitor.isBeating()).thenReturn(false);
when(process.isAlive()).thenReturn(true);
@@ -108,7 +107,7 @@ void testForcedShutdown() {
}

@Test
@DisplayName("Test process dies.")
// Test process dies.
void testProcessDies() {
when(heartbeatMonitor.isBeating()).thenReturn(true);
when(process.isAlive()).thenReturn(false);
Original file line number Diff line number Diff line change
@@ -18,14 +18,13 @@
import io.airbyte.cdk.integrations.destination.s3.util.StreamTransferManagerFactory;
import io.airbyte.commons.json.Jsons;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("GcsCsvFormatConfig")
// GcsCsvFormatConfig
public class GcsCsvFormatConfigTest {

@Test
@DisplayName("Flattening enums can be created from value string")
// Flattening enums can be created from value string
public void testFlatteningCreationFromString() {
assertEquals(Flattening.NO, Flattening.fromValue("no flattening"));
assertEquals(Flattening.ROOT_LEVEL, Flattening.fromValue("root level flattening"));
Original file line number Diff line number Diff line change
@@ -16,10 +16,9 @@
import io.airbyte.cdk.integrations.destination.s3.util.StreamTransferManagerFactory;
import io.airbyte.commons.json.Jsons;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("GcsJsonlFormatConfig")
// GcsJsonlFormatConfig
public class GcsJsonlFormatConfigTest {

@Test
Original file line number Diff line number Diff line change
@@ -13,14 +13,13 @@
import io.airbyte.cdk.integrations.destination.s3.util.Flattening;
import io.airbyte.commons.json.Jsons;
import java.util.Map;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("S3FormatConfigs")
// S3FormatConfigs
public class S3FormatConfigsTest {

@Test
@DisplayName("When CSV format is specified, it returns CSV format config")
// When CSV format is specified, it returns CSV format config
public void testGetCsvS3FormatConfig() {
final JsonNode configJson = Jsons.jsonNode(Map.of(
"format", Jsons.jsonNode(Map.of(
Original file line number Diff line number Diff line change
@@ -20,14 +20,13 @@
import io.airbyte.cdk.integrations.destination.s3.util.StreamTransferManagerFactory;
import io.airbyte.commons.json.Jsons;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

@DisplayName("S3CsvFormatConfig")
// S3CsvFormatConfig
public class S3CsvFormatConfigTest {

@Test
@DisplayName("Flattening enums can be created from value string")
// Flattening enums can be created from value string
public void testFlatteningCreationFromString() {
assertEquals(Flattening.NO, Flattening.fromValue("no flattening"));
assertEquals(Flattening.ROOT_LEVEL, Flattening.fromValue("root level flattening"));
Loading