Skip to content

Commit

Permalink
add a return for the mock (#22535)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohansong authored Feb 7, 2023
1 parent 2bd8596 commit b89196b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import com.fasterxml.jackson.databind.JsonNode;
import io.airbyte.api.client.AirbyteApiClient;
import io.airbyte.api.client.generated.SourceApi;
import io.airbyte.api.client.model.generated.DiscoverCatalogResult;
import io.airbyte.api.client.model.generated.SourceDiscoverSchemaWriteRequestBody;
import io.airbyte.commons.features.EnvVariableFeatureFlags;
import io.airbyte.commons.json.Jsons;
Expand Down Expand Up @@ -71,6 +73,8 @@ public abstract class AbstractSourceConnectorTest {
private static final String JOB_ID = String.valueOf(0L);
private static final int JOB_ATTEMPT = 0;

private static final UUID CATALOG_ID = UUID.randomUUID();

private static final UUID SOURCE_ID = UUID.randomUUID();

private static final String CPU_REQUEST_FIELD_NAME = "cpuRequest";
Expand Down Expand Up @@ -144,6 +148,8 @@ public void setUpInternal() throws Exception {
mAirbyteApiClient = mock(AirbyteApiClient.class);
mSourceApi = mock(SourceApi.class);
when(mAirbyteApiClient.getSourceApi()).thenReturn(mSourceApi);
when(mSourceApi.writeDiscoverCatalogResult(any()))
.thenReturn(new DiscoverCatalogResult().catalogId(CATALOG_ID));
mConnectorConfigUpdater = mock(ConnectorConfigUpdater.class);
processFactory = new DockerProcessFactory(
workerConfigs,
Expand Down

0 comments on commit b89196b

Please sign in to comment.