-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15302: Destination Azure Blob Storage: Handle per-stream state (#15318)
* 15302: Azure blob destination consumer fixed * 15302: Unit test added * 15302: Unit test added * 15318: test fix
- Loading branch information
Showing
3 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...a/io/airbyte/integrations/destination/azure_blob_storage/AzureBlobRecordConsumerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package io.airbyte.integrations.destination.azure_blob_storage; | ||
|
||
import io.airbyte.integrations.base.FailureTrackingAirbyteMessageConsumer; | ||
import io.airbyte.integrations.destination.azure_blob_storage.writer.AzureBlobStorageWriterFactory; | ||
import io.airbyte.integrations.standardtest.destination.PerStreamStateMessageTest; | ||
import io.airbyte.protocol.models.AirbyteMessage; | ||
import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; | ||
import java.util.function.Consumer; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
|
||
@DisplayName("AzureBlobRecordConsumer") | ||
@ExtendWith(MockitoExtension.class) | ||
public class AzureBlobRecordConsumerTest extends PerStreamStateMessageTest { | ||
@Mock | ||
private Consumer<AirbyteMessage> outputRecordCollector; | ||
|
||
private AzureBlobStorageConsumer consumer; | ||
|
||
@Mock | ||
private AzureBlobStorageDestinationConfig azureBlobStorageDestinationConfig; | ||
|
||
@Mock | ||
private ConfiguredAirbyteCatalog configuredCatalog; | ||
|
||
@Mock | ||
private AzureBlobStorageWriterFactory writerFactory; | ||
|
||
@BeforeEach | ||
public void init() { | ||
consumer = new AzureBlobStorageConsumer(azureBlobStorageDestinationConfig, configuredCatalog, writerFactory, outputRecordCollector); | ||
} | ||
|
||
@Override | ||
protected Consumer<AirbyteMessage> getMockedConsumer() { | ||
return outputRecordCollector; | ||
} | ||
|
||
@Override | ||
protected FailureTrackingAirbyteMessageConsumer getMessageConsumer() { | ||
return consumer; | ||
} | ||
} |