Skip to content

Commit

Permalink
Fix arg capture in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gosusnp committed Dec 15, 2022
1 parent 0d33ee8 commit b16f07d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ public abstract class AbstractSourceConnectorTest {

private ConfigRepository mConfigRepository;

private final ArgumentCaptor<AirbyteCatalog> lastPersistedCatalog = ArgumentCaptor.forClass(AirbyteCatalog.class);
// This has to be using the protocol version of the platform in order to capture the arg
private final ArgumentCaptor<io.airbyte.protocol.models.AirbyteCatalog> lastPersistedCatalog =
ArgumentCaptor.forClass(io.airbyte.protocol.models.AirbyteCatalog.class);

protected AirbyteCatalog getLastPersistedCatalog() {
return lastPersistedCatalog.getValue();
return convertProtocolObject(lastPersistedCatalog.getValue(), AirbyteCatalog.class);
}

@BeforeEach
Expand Down Expand Up @@ -175,8 +177,7 @@ protected UUID runDiscover() throws Exception {
new AirbyteIntegrationLauncher(JOB_ID, JOB_ATTEMPT, getImageName(), processFactory, workerConfigs.getResourceRequirements(), false))
.run(new StandardDiscoverCatalogInput().withSourceId(SOURCE_ID.toString()).withConnectionConfiguration(getConfig()), jobRoot)
.getDiscoverCatalogId();
verify(mConfigRepository).writeActorCatalogFetchEvent(
convertProtocolObject(lastPersistedCatalog.capture(), io.airbyte.protocol.models.AirbyteCatalog.class), any(), any(), any());
verify(mConfigRepository).writeActorCatalogFetchEvent(lastPersistedCatalog.capture(), any(), any(), any());
return toReturn;
}

Expand Down

0 comments on commit b16f07d

Please sign in to comment.