Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
feat: added support for BigQuery destination and PostgreSQL source ty…
Browse files Browse the repository at this point in the history
…pes (#198)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 469482613

Source-Link: googleapis/googleapis@441339a

Source-Link: googleapis/googleapis-gen@7ac2e52
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2FjMmU1MmIzNmYyZjg0OTUwYmI0NzExMjZjNTQzYjllODhlNzVkMiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Aug 25, 2022
1 parent 4c3819e commit 3209237
Show file tree
Hide file tree
Showing 49 changed files with 20,512 additions and 1,249 deletions.
5 changes: 5 additions & 0 deletions google-cloud-datastream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
@Generated("by gapic-generator-java")
public class DatastreamClientTest {
private static MockDatastream mockDatastream;
private static MockIAMPolicy mockIAMPolicy;
private static MockLocations mockLocations;
private static MockServiceHelper mockServiceHelper;
private LocalChannelProvider channelProvider;
Expand All @@ -71,10 +72,11 @@ public class DatastreamClientTest {
public static void startStaticServer() {
mockDatastream = new MockDatastream();
mockLocations = new MockLocations();
mockIAMPolicy = new MockIAMPolicy();
mockServiceHelper =
new MockServiceHelper(
UUID.randomUUID().toString(),
Arrays.<MockGrpcService>asList(mockDatastream, mockLocations));
Arrays.<MockGrpcService>asList(mockDatastream, mockLocations, mockIAMPolicy));
mockServiceHelper.start();
}

Expand Down Expand Up @@ -574,6 +576,7 @@ public void discoverConnectionProfileTest() throws Exception {
Assert.assertEquals(request.getHierarchyDepth(), actualRequest.getHierarchyDepth());
Assert.assertEquals(request.getOracleRdbms(), actualRequest.getOracleRdbms());
Assert.assertEquals(request.getMysqlRdbms(), actualRequest.getMysqlRdbms());
Assert.assertEquals(request.getPostgresqlRdbms(), actualRequest.getPostgresqlRdbms());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.datastream.v1;

import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.protobuf.AbstractMessage;
import io.grpc.ServerServiceDefinition;
import java.util.List;
import javax.annotation.Generated;

@BetaApi
@Generated("by gapic-generator-java")
public class MockIAMPolicy implements MockGrpcService {
private final MockIAMPolicyImpl serviceImpl;

public MockIAMPolicy() {
serviceImpl = new MockIAMPolicyImpl();
}

@Override
public List<AbstractMessage> getRequests() {
return serviceImpl.getRequests();
}

@Override
public void addResponse(AbstractMessage response) {
serviceImpl.addResponse(response);
}

@Override
public void addException(Exception exception) {
serviceImpl.addException(exception);
}

@Override
public ServerServiceDefinition getServiceDefinition() {
return serviceImpl.bindService();
}

@Override
public void reset() {
serviceImpl.reset();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.datastream.v1;

import com.google.api.core.BetaApi;
import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase;
import com.google.protobuf.AbstractMessage;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import javax.annotation.Generated;

@BetaApi
@Generated("by gapic-generator-java")
public class MockIAMPolicyImpl extends IAMPolicyImplBase {
private List<AbstractMessage> requests;
private Queue<Object> responses;

public MockIAMPolicyImpl() {
requests = new ArrayList<>();
responses = new LinkedList<>();
}

public List<AbstractMessage> getRequests() {
return requests;
}

public void addResponse(AbstractMessage response) {
responses.add(response);
}

public void setResponses(List<AbstractMessage> responses) {
this.responses = new LinkedList<Object>(responses);
}

public void addException(Exception exception) {
responses.add(exception);
}

public void reset() {
requests = new ArrayList<>();
responses = new LinkedList<>();
}
}
Loading

0 comments on commit 3209237

Please sign in to comment.