Skip to content

Commit 2596879

Browse files
authored
[PECO-1020] Adding mock constructor method for WorkspaceClient to support mocked ApiClient (#144)
Adding additional constructor in WorkspaceClient to support mocking ApiClient ## Changes A new constructor in WorkspaceClient to support mocking ApiClient ## Tests Ran $mvn clean package to verify all test cases and compilation errors --------- Signed-off-by: Gopal Lal <[email protected]>
1 parent 3a8494e commit 2596879

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

.codegen/workspace.java.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@ public class WorkspaceClient {
4646

4747
/** Constructor for mocks */
4848
public WorkspaceClient(boolean mock) {
49-
apiClient = null;
50-
config = null;
49+
this(mock, null /* apiClient */);
50+
}
51+
52+
/** Constructor for mocks */
53+
public WorkspaceClient(boolean mock, ApiClient apiClient) {
54+
this.apiClient = apiClient;
55+
this.config = null;
5156
}
5257
{{range .Services}}{{if not .IsAccounts}}
5358
{{if .Description}}/**

databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)