Skip to content

Commit

Permalink
fix failed UT
Browse files Browse the repository at this point in the history
Signed-off-by: Yaliang Wu <[email protected]>
  • Loading branch information
ylwu-amzn committed Jul 11, 2023
1 parent 500add5 commit 1d23685
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public MLCreateConnectorInput(String name,
this.backendRoles = backendRoles;
this.addAllBackendRoles = addAllBackendRoles;
this.access = access;
this.dryRun = dryRun;
}

public static MLCreateConnectorInput parse(XContentParser parser) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public TransportCreateConnectorAction(
protected void doExecute(Task task, ActionRequest request, ActionListener<MLCreateConnectorResponse> listener) {
MLCreateConnectorRequest mlCreateConnectorRequest = MLCreateConnectorRequest.fromActionRequest(request);
MLCreateConnectorInput mlCreateConnectorInput = mlCreateConnectorRequest.getMlCreateConnectorInput();
if (MLCreateConnectorInput.DRY_RUN_CONNECTOR_NAME.equals(mlCreateConnectorInput.getName())) {
if (mlCreateConnectorInput.isDryRun()) {
MLCreateConnectorResponse response = new MLCreateConnectorResponse(MLCreateConnectorInput.DRY_RUN_CONNECTOR_NAME);
listener.onResponse(response);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ public void test_execute_dryRun_connector_creation() {

MLCreateConnectorInput mlCreateConnectorInput = mock(MLCreateConnectorInput.class);
when(mlCreateConnectorInput.getName()).thenReturn(MLCreateConnectorInput.DRY_RUN_CONNECTOR_NAME);
when(mlCreateConnectorInput.isDryRun()).thenReturn(true);
MLCreateConnectorRequest request = new MLCreateConnectorRequest(mlCreateConnectorInput);
action.doExecute(task, request, actionListener);
verify(actionListener).onResponse(any(MLCreateConnectorResponse.class));
Expand Down

0 comments on commit 1d23685

Please sign in to comment.