Skip to content

Commit

Permalink
Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
FilahAnas committed Mar 28, 2024
1 parent 9a1bad7 commit d87518d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mongodb-source-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Tag Docker image
run: docker tag airbyte/source-mongodb-v2:dev sibengineering/airbyte-source-mongodb:1.3.0.9
run: docker tag airbyte/source-mongodb-v2:dev sibengineering/airbyte-source-mongodb:1.3.0.10

- name: Push Docker image to Docker Hub
run: docker push sibengineering/airbyte-source-mongodb:1.3.0.9
run: docker push sibengineering/airbyte-source-mongodb:1.3.0.10
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,7 @@ public boolean tryAdvance(final Consumer<? super JsonNode> action) {
}, false);
}

public Object runCommand(Object any) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoIterable;
import com.mongodb.client.model.Aggregates;
import com.mongodb.client.model.Projections;
Expand Down Expand Up @@ -177,7 +176,7 @@ public static int getDebeziumEventQueueSize(final MongoDbSourceConfig config) {
public static Optional<CollectionStatistics> getCollectionStatistics(final MongoClient mongoClient, final ConfiguredAirbyteStream stream) {
try {
final Map<String, Object> collStats = Map.of(MongoConstants.STORAGE_STATS_KEY, Map.of(), MongoConstants.COUNT_KEY, Map.of());
final MongoDatabase mongoDatabase = mongoClient.getDatabase(stream.getStream().getNamespace());
final MongoDatabase mongoDatabase = (MongoDatabase) mongoClient.getDatabase(stream.getStream().getNamespace());
final MongoCollection<Document> collection = mongoDatabase.getCollection(stream.getStream().getName());
final AggregateIterable<Document> output = collection.aggregate(List.of(new Document("$collStats", collStats)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void testGetIteratorsEmptyInitialState() {
final MongoDbStateManager ogStateManager = MongoDbStateManager.createStateManager(null, CONFIG);
final MongoDbStateManager stateManager = spy(ogStateManager);
final List<AutoCloseableIterator<AirbyteMessage>> iterators =
initialSnapshotHandler.getIterators(STREAMS, stateManager, mongoClient.getDatabase(DB_NAME), CONFIG);
initialSnapshotHandler.getIterators(STREAMS, stateManager, (MongoDatabase) mongoClient.getDatabase(DB_NAME), CONFIG);

assertEquals(iterators.size(), 3);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void testCheckOperationInvalidClusterType() throws IOException {

when(clusterDescription.getType()).thenReturn(ClusterType.STANDALONE);
when(mongoDatabase.runCommand(any())).thenReturn(response);
when(mongoClient.getDatabase(any())).thenReturn(mongoDatabase);
when(mongoClient.getDatabase(any())).thenReturn((com.mongodb.client.MongoDatabase) mongoDatabase);
when(mongoClient.getClusterDescription()).thenReturn(clusterDescription);

final AirbyteConnectionStatus airbyteConnectionStatus = source.check(airbyteSourceConfig);
Expand Down

0 comments on commit d87518d

Please sign in to comment.