diff --git a/connectors/google/google-drive/element-templates/google-drive-outbound-connector-hybrid.json b/connectors/google/google-drive/element-templates/google-drive-outbound-connector-hybrid.json index 3562cf1936..c3469ffbea 100644 --- a/connectors/google/google-drive/element-templates/google-drive-outbound-connector-hybrid.json +++ b/connectors/google/google-drive/element-templates/google-drive-outbound-connector-hybrid.json @@ -49,9 +49,6 @@ "label" : "Type", "optional" : false, "value" : "BEARER", - "constraints" : { - "notEmpty" : true - }, "group" : "authentication", "binding" : { "name" : "authentication.authType", @@ -70,9 +67,6 @@ "label" : "Bearer token", "description" : "Enter a valid Google API Bearer token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -90,9 +84,6 @@ "label" : "Client ID", "description" : "Enter Google API Client ID", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -110,9 +101,6 @@ "label" : "Client secret", "description" : "Enter Google API client Secret", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -130,9 +118,6 @@ "label" : "Refresh token", "description" : "Enter a valid Google API refresh token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { diff --git a/connectors/google/google-drive/element-templates/google-drive-outbound-connector.json b/connectors/google/google-drive/element-templates/google-drive-outbound-connector.json index da91ebbcdc..d4ba4f3c3d 100644 --- a/connectors/google/google-drive/element-templates/google-drive-outbound-connector.json +++ b/connectors/google/google-drive/element-templates/google-drive-outbound-connector.json @@ -44,9 +44,6 @@ "label" : "Type", "optional" : false, "value" : "BEARER", - "constraints" : { - "notEmpty" : true - }, "group" : "authentication", "binding" : { "name" : "authentication.authType", @@ -65,9 +62,6 @@ "label" : "Bearer token", "description" : "Enter a valid Google API Bearer token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -85,9 +79,6 @@ "label" : "Client ID", "description" : "Enter Google API Client ID", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -105,9 +96,6 @@ "label" : "Client secret", "description" : "Enter Google API client Secret", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -125,9 +113,6 @@ "label" : "Refresh token", "description" : "Enter a valid Google API refresh token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { diff --git a/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector-hybrid.json b/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector-hybrid.json index 29871afd37..f198bd1336 100644 --- a/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector-hybrid.json +++ b/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector-hybrid.json @@ -44,14 +44,25 @@ "type" : "zeebe:taskDefinition" }, "type" : "String" + }, { + "id" : "operation.type", + "label" : "Type", + "feel" : "optional", + "binding" : { + "name" : "operation.type", + "type" : "zeebe:input" + }, + "condition" : { + "property" : "operation.operation", + "equals" : "createEmptyColumnOrRow", + "type" : "simple" + }, + "type" : "String" }, { "id" : "authentication.authType", "label" : "Type", "optional" : false, "value" : "BEARER", - "constraints" : { - "notEmpty" : true - }, "group" : "authentication", "binding" : { "name" : "authentication.authType", @@ -70,9 +81,6 @@ "label" : "Bearer token", "description" : "Enter a valid Google API Bearer token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -90,9 +98,6 @@ "label" : "Client ID", "description" : "Enter Google API Client ID", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -110,9 +115,6 @@ "label" : "Client secret", "description" : "Enter Google API client Secret", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -130,9 +132,6 @@ "label" : "Refresh token", "description" : "Enter a valid Google API refresh token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { diff --git a/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector.json b/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector.json index 27ee0e4a2a..f90d4245b1 100644 --- a/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector.json +++ b/connectors/google/google-sheets/element-templates/google-sheets-outbound-connector.json @@ -1,7 +1,7 @@ { "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name" : "Google Sheets Outbound Connector v2", - "id" : "io.camunda.connectors.GoogleSheets.v2", + "name" : "Google Sheets Outbound Connector", + "id" : "io.camunda.connectors.GoogleSheets.v1", "description" : "Work with spreadsheets", "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/google-sheets/", "version" : 2, @@ -39,14 +39,25 @@ "type" : "zeebe:taskDefinition" }, "type" : "Hidden" + }, { + "id" : "operation.type", + "label" : "Type", + "feel" : "optional", + "binding" : { + "name" : "operation.type", + "type" : "zeebe:input" + }, + "condition" : { + "property" : "operation.operation", + "equals" : "createEmptyColumnOrRow", + "type" : "simple" + }, + "type" : "String" }, { "id" : "authentication.authType", "label" : "Type", "optional" : false, "value" : "BEARER", - "constraints" : { - "notEmpty" : true - }, "group" : "authentication", "binding" : { "name" : "authentication.authType", @@ -65,9 +76,6 @@ "label" : "Bearer token", "description" : "Enter a valid Google API Bearer token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -85,9 +93,6 @@ "label" : "Client ID", "description" : "Enter Google API Client ID", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -105,9 +110,6 @@ "label" : "Client secret", "description" : "Enter Google API client Secret", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { @@ -125,9 +127,6 @@ "label" : "Refresh token", "description" : "Enter a valid Google API refresh token", "optional" : false, - "constraints" : { - "notEmpty" : true - }, "feel" : "optional", "group" : "authentication", "binding" : { diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/model/request/GoogleSheetsRequestTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/model/request/GoogleSheetsRequestTest.java index a2ea296bfd..e9a3079714 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/model/request/GoogleSheetsRequestTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/model/request/GoogleSheetsRequestTest.java @@ -100,9 +100,7 @@ private static void verifyAuthentication(Authentication authentication) { if (authentication.authType() == AuthenticationType.REFRESH) { assertThat(authentication.oauthClientId()).isNotNull().isEqualTo(ACTUAL_OAUTH_CLIENT_ID); - assertThat(authentication.oauthClientSecret()) - .isNotNull() - .isEqualTo(ACTUAL_OAUTH_SECRET_ID); + assertThat(authentication.oauthClientSecret()).isNotNull().isEqualTo(ACTUAL_OAUTH_SECRET_ID); assertThat(authentication.oauthRefreshToken()).isNotNull().isEqualTo(ACTUAL_REFRESH_TOKEN); } } diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/AddValuesOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/AddValuesOperationTest.java index fbc9dd4c36..00ab9c92f3 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/AddValuesOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/AddValuesOperationTest.java @@ -21,7 +21,6 @@ import io.camunda.google.model.AuthenticationType; import java.io.IOException; import java.util.List; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -62,10 +61,14 @@ void addValue_shouldAddValue() throws IOException { .thenReturn(null); // When - new AddValuesOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new AddValuesOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); verify( service .spreadsheets() diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateEmptyColumnOrRowOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateEmptyColumnOrRowOperationTest.java index 1643729324..f4669b5123 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateEmptyColumnOrRowOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateEmptyColumnOrRowOperationTest.java @@ -53,7 +53,7 @@ class CreateEmptyColumnOrRowOperationTest extends BaseTest { private Sheets service; @Captor private ArgumentCaptor requestsCaptor; - + private BatchUpdateSpreadsheetResponse response; @BeforeEach @@ -82,10 +82,14 @@ void createEmptyColumnOrRow_shouldAppendEmptyRow() throws IOException { .thenReturn(response); // When - new CreateEmptyColumnOrRowOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new CreateEmptyColumnOrRowOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(1)); @@ -124,10 +128,14 @@ void createEmptyColumnOrRow_shouldInsertEmptyColumn() throws IOException { .thenReturn(response); // When - new CreateEmptyColumnOrRowOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new CreateEmptyColumnOrRowOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(1)); @@ -164,7 +172,11 @@ void createEmptyColumnOrRow_shouldThrowExceptionWhenStartIndexIsEmpty() { CreateEmptyColumnOrRowOperation operation = new CreateEmptyColumnOrRowOperation(model); // When and Then - assertThrows(IllegalArgumentException.class, () -> operation.execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + assertThrows( + IllegalArgumentException.class, + () -> + operation.execute( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); mockedServiceSupplier.verifyNoInteractions(); } } @@ -186,7 +198,11 @@ void createEmptyColumnOrRow_shouldThrowExceptionWhenEndIndexIsEmpty() { CreateEmptyColumnOrRowOperation operation = new CreateEmptyColumnOrRowOperation(model); // When and Then - assertThrows(IllegalArgumentException.class, () -> operation.execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + assertThrows( + IllegalArgumentException.class, + () -> + operation.execute( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); mockedServiceSupplier.verifyNoInteractions(); } } diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateRowOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateRowOperationTest.java index 9956d3b9f8..7a0bdd237c 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateRowOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateRowOperationTest.java @@ -21,7 +21,6 @@ import io.camunda.google.model.AuthenticationType; import java.io.IOException; import java.util.List; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -36,8 +35,7 @@ class CreateRowOperationTest extends BaseTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Sheets service; - //private Authentication auth; - + // private Authentication auth; @DisplayName("Should create row in defined worksheet") @Test @@ -64,10 +62,14 @@ void createRow_shouldCreateRowInDefinedWorksheet() throws IOException { .thenReturn(null); // When - new CreateRowOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new CreateRowOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); verify( service .spreadsheets() diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateSpreadsheetOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateSpreadsheetOperationTest.java index 607685c09c..43055f213a 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateSpreadsheetOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateSpreadsheetOperationTest.java @@ -67,12 +67,15 @@ void createSpreadsheet_shouldCreateSpreadsheetInRootFolder() throws IOException when(service.spreadsheets().create(any()).setFields(any()).execute()).thenReturn(response); // When - Object resultObject = new CreateSpreadSheetOperation(model).execute(new Authentication( - AuthenticationType.BEARER, "abc", null, null, null)); + Object resultObject = + new CreateSpreadSheetOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then mockedSheetsServiceSupplier.verify( - () -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); mockedDriveUtil.verifyNoInteractions(); assertThat(resultObject, instanceOf(CreateSpreadSheetResponse.class)); @@ -99,12 +102,21 @@ void createSpreadsheet_shouldCreateSpreadsheetInDefinedFolder() throws IOExcepti when(service.spreadsheets().create(any()).setFields(any()).execute()).thenReturn(response); // When - Object resultObject = new CreateSpreadSheetOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + Object resultObject = + new CreateSpreadSheetOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then mockedSheetsServiceSupplier.verify( - () -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); - mockedDriveUtil.verify(() -> DriveUtil.moveFile(new Authentication(AuthenticationType.BEARER, "abc", null, null, null), PARENT, SPREADSHEET_ID)); + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedDriveUtil.verify( + () -> + DriveUtil.moveFile( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null), + PARENT, + SPREADSHEET_ID)); assertThat(resultObject, instanceOf(CreateSpreadSheetResponse.class)); CreateSpreadSheetResponse operationResult = (CreateSpreadSheetResponse) resultObject; diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateWorksheetOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateWorksheetOperationTest.java index 55047ddc76..cd9ff801cb 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateWorksheetOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/CreateWorksheetOperationTest.java @@ -46,7 +46,7 @@ class CreateWorksheetOperationTest extends BaseTest { private Sheets service; @Captor private ArgumentCaptor requestsCaptor; - + private BatchUpdateSpreadsheetResponse response; @BeforeEach @@ -74,10 +74,14 @@ void createWorksheet_shouldFormRequestWithoutIndex() throws IOException { .thenReturn(response); // When - new CreateWorksheetOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new CreateWorksheetOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(1)); @@ -108,10 +112,14 @@ void createWorksheet_shouldFormRequestWitIndex() throws IOException { .thenReturn(response); // When - new CreateWorksheetOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new CreateWorksheetOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(1)); diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteColumnOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteColumnOperationTest.java index c7ddde4dea..ac5f387307 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteColumnOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteColumnOperationTest.java @@ -49,7 +49,7 @@ class DeleteColumnOperationTest extends BaseTest { private Sheets service; @Captor private ArgumentCaptor requestsCaptor; - + private BatchUpdateSpreadsheetResponse response; @BeforeEach @@ -78,10 +78,14 @@ void deleteColumn_shouldDeleteColumnByNumberIndex() throws IOException { .thenReturn(response); // When - new DeleteColumnOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new DeleteColumnOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(COLUMN_INDEX)); @@ -115,10 +119,14 @@ void deleteColumn_shouldDeleteColumnByLetterIndex() throws IOException { .thenReturn(response); // When - new DeleteColumnOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new DeleteColumnOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(COLUMN_INDEX)); diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteWorksheetOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteWorksheetOperationTest.java index 9842170b52..a599f331fa 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteWorksheetOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/DeleteWorksheetOperationTest.java @@ -44,7 +44,7 @@ class DeleteWorksheetOperationTest extends BaseTest { private Sheets service; @Captor private ArgumentCaptor requestsCaptor; - + private BatchUpdateSpreadsheetResponse response; @BeforeEach @@ -72,10 +72,14 @@ void deleteWorksheet_shouldDeleteByIndex() throws IOException { .thenReturn(response); // When - new DeleteWorksheetOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new DeleteWorksheetOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); List requests = requestsCaptor.getValue().getRequests(); assertThat(requests, hasSize(1)); diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetRowByIndexOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetRowByIndexOperationTest.java index 7159e04789..9b75ced3e4 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetRowByIndexOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetRowByIndexOperationTest.java @@ -25,7 +25,6 @@ import io.camunda.google.model.AuthenticationType; import java.io.IOException; import java.util.List; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -39,7 +38,6 @@ class GetRowByIndexOperationTest extends BaseTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Sheets service; - @DisplayName("Should get row by index on defined worksheet") @Test @@ -61,11 +59,15 @@ void getRow_shouldGetRowByIndexOnDefinedWorksheet() throws IOException { .thenReturn(valueRange); // When - Object result = new GetRowByIndexOperation(model).execute(new Authentication( - AuthenticationType.BEARER, "abc", null, null, null)); + Object result = + new GetRowByIndexOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); assertThat(result, instanceOf(GoogleSheetsResult.class)); Object data = ((GoogleSheetsResult) result).getResponse(); @@ -96,10 +98,15 @@ void getRow_shouldGetRowByIndex() throws IOException { .thenReturn(valueRange); // When - Object result = new GetRowByIndexOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + Object result = + new GetRowByIndexOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); assertThat(result, instanceOf(GoogleSheetsResult.class)); Object data = ((GoogleSheetsResult) result).getResponse(); diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetSpreadsheetDetailsOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetSpreadsheetDetailsOperationTest.java index a9476b7032..41d3e36094 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetSpreadsheetDetailsOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetSpreadsheetDetailsOperationTest.java @@ -20,7 +20,6 @@ import io.camunda.google.model.Authentication; import io.camunda.google.model.AuthenticationType; import java.io.IOException; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -34,7 +33,6 @@ class GetSpreadsheetDetailsOperationTest extends BaseTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Sheets service; - @DisplayName("Should get spreadsheet details by id") @Test @@ -53,10 +51,14 @@ void getSpreadsheetDetails_shouldGetDetailsById() throws IOException { when(service.spreadsheets().get(anyString()).execute()).thenReturn(spreadsheet); // When - new GetSpreadsheetDetailsOperation(model).execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); + new GetSpreadsheetDetailsOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); verify(service.spreadsheets().get(SPREADSHEET_ID)).execute(); } } diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetWorksheetDataOperationTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetWorksheetDataOperationTest.java index 7dc2e372b9..f06cbd9a30 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetWorksheetDataOperationTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/operation/impl/GetWorksheetDataOperationTest.java @@ -25,7 +25,6 @@ import io.camunda.google.model.AuthenticationType; import java.io.IOException; import java.util.List; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -39,7 +38,6 @@ class GetWorksheetDataOperationTest extends BaseTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Sheets service; - @DisplayName("Should get worksheet data") @Test @@ -59,11 +57,15 @@ void getWorksheetData_shouldGetWorksheetData() throws IOException { .thenReturn(valueRange); // When - Object result = new GetWorksheetDataOperation(model).execute(new Authentication( - AuthenticationType.BEARER, "abc", null, null, null)); + Object result = + new GetWorksheetDataOperation(model) + .execute(new Authentication(AuthenticationType.BEARER, "abc", null, null, null)); // Then - mockedServiceSupplier.verify(() -> GoogleSheetsServiceSupplier.getGoogleSheetsService(new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); + mockedServiceSupplier.verify( + () -> + GoogleSheetsServiceSupplier.getGoogleSheetsService( + new Authentication(AuthenticationType.BEARER, "abc", null, null, null))); assertThat(result, instanceOf(GoogleSheetsResult.class)); Object data = ((GoogleSheetsResult) result).getResponse(); diff --git a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/supplier/GoogleSheetsServiceSupplierTest.java b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/supplier/GoogleSheetsServiceSupplierTest.java index 2dff1ed8d8..8b31799676 100644 --- a/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/supplier/GoogleSheetsServiceSupplierTest.java +++ b/connectors/google/google-sheets/src/test/java/io/camunda/connector/gsheets/supplier/GoogleSheetsServiceSupplierTest.java @@ -23,7 +23,8 @@ class GoogleSheetsServiceSupplierTest { void getSheetsService_shouldInitGoogleSheetsServiceV4() { // Given String token = "Bearer_token"; - Authentication authentication = new Authentication(AuthenticationType.BEARER, token, null, null, null); + Authentication authentication = + new Authentication(AuthenticationType.BEARER, token, null, null, null); // When Sheets sheets = GoogleSheetsServiceSupplier.getGoogleSheetsService(authentication);