Skip to content

Commit 3cdb8d1

Browse files
feat: added support for BigQuery destination and PostgreSQL source types (#198)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 469482613 Source-Link: googleapis/googleapis@441339a Source-Link: https://github.com/googleapis/googleapis-gen/commit/7ac2e52b36f2f84950bb471126c543b9e88e75d2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2FjMmU1MmIzNmYyZjg0OTUwYmI0NzExMjZjNTQzYjllODhlNzVkMiJ9
1 parent 92bc164 commit 3cdb8d1

File tree

49 files changed

+20512
-1249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+20512
-1249
lines changed

java-datastream/google-cloud-datastream/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
<classifier>testlib</classifier>
112112
<scope>test</scope>
113113
</dependency>
114+
<dependency>
115+
<groupId>com.google.api.grpc</groupId>
116+
<artifactId>grpc-google-iam-v1</artifactId>
117+
<scope>test</scope>
118+
</dependency>
114119
</dependencies>
115120

116121
<profiles>

java-datastream/google-cloud-datastream/src/test/java/com/google/cloud/datastream/v1/DatastreamClientTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
@Generated("by gapic-generator-java")
6363
public class DatastreamClientTest {
6464
private static MockDatastream mockDatastream;
65+
private static MockIAMPolicy mockIAMPolicy;
6566
private static MockLocations mockLocations;
6667
private static MockServiceHelper mockServiceHelper;
6768
private LocalChannelProvider channelProvider;
@@ -71,10 +72,11 @@ public class DatastreamClientTest {
7172
public static void startStaticServer() {
7273
mockDatastream = new MockDatastream();
7374
mockLocations = new MockLocations();
75+
mockIAMPolicy = new MockIAMPolicy();
7476
mockServiceHelper =
7577
new MockServiceHelper(
7678
UUID.randomUUID().toString(),
77-
Arrays.<MockGrpcService>asList(mockDatastream, mockLocations));
79+
Arrays.<MockGrpcService>asList(mockDatastream, mockLocations, mockIAMPolicy));
7880
mockServiceHelper.start();
7981
}
8082

@@ -574,6 +576,7 @@ public void discoverConnectionProfileTest() throws Exception {
574576
Assert.assertEquals(request.getHierarchyDepth(), actualRequest.getHierarchyDepth());
575577
Assert.assertEquals(request.getOracleRdbms(), actualRequest.getOracleRdbms());
576578
Assert.assertEquals(request.getMysqlRdbms(), actualRequest.getMysqlRdbms());
579+
Assert.assertEquals(request.getPostgresqlRdbms(), actualRequest.getPostgresqlRdbms());
577580
Assert.assertTrue(
578581
channelProvider.isHeaderSent(
579582
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.datastream.v1;
18+
19+
import com.google.api.core.BetaApi;
20+
import com.google.api.gax.grpc.testing.MockGrpcService;
21+
import com.google.protobuf.AbstractMessage;
22+
import io.grpc.ServerServiceDefinition;
23+
import java.util.List;
24+
import javax.annotation.Generated;
25+
26+
@BetaApi
27+
@Generated("by gapic-generator-java")
28+
public class MockIAMPolicy implements MockGrpcService {
29+
private final MockIAMPolicyImpl serviceImpl;
30+
31+
public MockIAMPolicy() {
32+
serviceImpl = new MockIAMPolicyImpl();
33+
}
34+
35+
@Override
36+
public List<AbstractMessage> getRequests() {
37+
return serviceImpl.getRequests();
38+
}
39+
40+
@Override
41+
public void addResponse(AbstractMessage response) {
42+
serviceImpl.addResponse(response);
43+
}
44+
45+
@Override
46+
public void addException(Exception exception) {
47+
serviceImpl.addException(exception);
48+
}
49+
50+
@Override
51+
public ServerServiceDefinition getServiceDefinition() {
52+
return serviceImpl.bindService();
53+
}
54+
55+
@Override
56+
public void reset() {
57+
serviceImpl.reset();
58+
}
59+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.datastream.v1;
18+
19+
import com.google.api.core.BetaApi;
20+
import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase;
21+
import com.google.protobuf.AbstractMessage;
22+
import java.util.ArrayList;
23+
import java.util.LinkedList;
24+
import java.util.List;
25+
import java.util.Queue;
26+
import javax.annotation.Generated;
27+
28+
@BetaApi
29+
@Generated("by gapic-generator-java")
30+
public class MockIAMPolicyImpl extends IAMPolicyImplBase {
31+
private List<AbstractMessage> requests;
32+
private Queue<Object> responses;
33+
34+
public MockIAMPolicyImpl() {
35+
requests = new ArrayList<>();
36+
responses = new LinkedList<>();
37+
}
38+
39+
public List<AbstractMessage> getRequests() {
40+
return requests;
41+
}
42+
43+
public void addResponse(AbstractMessage response) {
44+
responses.add(response);
45+
}
46+
47+
public void setResponses(List<AbstractMessage> responses) {
48+
this.responses = new LinkedList<Object>(responses);
49+
}
50+
51+
public void addException(Exception exception) {
52+
responses.add(exception);
53+
}
54+
55+
public void reset() {
56+
requests = new ArrayList<>();
57+
responses = new LinkedList<>();
58+
}
59+
}

0 commit comments

Comments
 (0)