From 0b168e79b8675d899efc9a9ff7b70209ca756cd4 Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Mon, 14 Nov 2022 17:15:07 +0200 Subject: [PATCH 1/8] Add grype ignore file --- .grype.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .grype.yaml diff --git a/.grype.yaml b/.grype.yaml new file mode 100644 index 0000000..04a5035 --- /dev/null +++ b/.grype.yaml @@ -0,0 +1,4 @@ +ignore: + - package: + name: protobuf-java + version: 3.19.4 From 2baae5d23a057cc4e6aded073685a0a02be937ff Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Mon, 15 Apr 2024 19:00:33 +0300 Subject: [PATCH 2/8] Reproduce --- component.json | 2 +- .../elastic/jdbc/actions/NewSelectAction.java | 7 + .../select_action/SelectMySQLSpec.groovy | 122 +++++++++++++++--- 3 files changed, 112 insertions(+), 19 deletions(-) diff --git a/component.json b/component.json index a2cc951..c828d99 100755 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "title": "Database", "description": "Database JDBC connector", - "version": "2.5.7", + "version": "2.5.8-dev.1", "credentials": { "verifier": "io.elastic.jdbc.JdbcCredentialsVerifier", "fields": { diff --git a/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java b/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java index 9beb8e0..b09f229 100644 --- a/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java +++ b/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java @@ -30,7 +30,14 @@ public class NewSelectAction implements Function { @Override public void execute(ExecutionParameters parameters) { JsonObject body = parameters.getMessage().getBody(); + JsonObject passthrough = parameters.getMessage().getPassthrough(); final JsonObject configuration = parameters.getConfiguration(); + System.out.println("Pass==============================="); + System.out.println(passthrough.toString()); + System.out.println("Pass==============================="); + System.out.println("Body==============================="); + System.out.println(body.toString()); + System.out.println("Body==============================="); EventEmitter eventEmitter = parameters.getEventEmitter(); checkConfig(configuration); String dbEngine = configuration.getString("dbEngine"); diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy index 980e838..4ba5b97 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy @@ -4,8 +4,7 @@ import io.elastic.api.EventEmitter import io.elastic.api.ExecutionParameters import io.elastic.api.Message import io.elastic.jdbc.TestUtils -import io.elastic.jdbc.actions.SelectAction -import spock.lang.Ignore +import io.elastic.jdbc.actions.NewSelectAction import spock.lang.Shared import spock.lang.Specification @@ -47,7 +46,7 @@ class SelectMySQLSpec extends Specification { @Shared EventEmitter emitter @Shared - SelectAction action + NewSelectAction action def setupSpec() { connection = DriverManager.getConnection(connectionString, user, password) @@ -58,30 +57,75 @@ class SelectMySQLSpec extends Specification { } def createAction() { - action = new SelectAction() + action = new NewSelectAction() } def runAction(JsonObject config, JsonObject body, JsonObject snapshot) { - Message msg = new Message.Builder().body(body).build() + String passthrough = "{\n" + + " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + + " \"attachments\": {},\n" + + " \"body\": {\n" + + " \"EmpID\": 8,\n" + + " \"EmpName\": \"Alex Rid\",\n" + + " \"Designation\": \"QA\",\n" + + " \"Department\": \"IT\",\n" + + " \"JoiningDate\": \"2019-08-27\",\n" + + " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + + " },\n" + + " \"headers\": {},\n" + + " \"passthrough\": {\n" + + " \"step_3\": {\n" + + " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + + " \"attachments\": {},\n" + + " \"body\": {\n" + + " \"EmpID\": 8,\n" + + " \"EmpName\": \"Alex Rid\",\n" + + " \"Designation\": \"QA\",\n" + + " \"Department\": \"IT\",\n" + + " \"JoiningDate\": \"2019-08-27\",\n" + + " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + + " },\n" + + " \"headers\": {},\n" + + " \"stepId\": \"step_3\"\n" + + " },\n" + + " \"step_2\": {\n" + + " \"body\": {}\n" + + " },\n" + + " \"step_1\": {\n" + + " \"body\": [\n" + + " {\n" + + " \"a\": 1\n" + + " }\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"stepId\": \"step_3\"\n" + + "}"; + jakarta.json.JsonObject passthroughJson = Json.createReader(new StringReader(passthrough)).readObject(); + Message msg = new Message.Builder() + .body(body) + .passthrough(passthroughJson) + .build() errorCallback = Mock(EventEmitter.Callback) snapshotCallback = Mock(EventEmitter.Callback) dataCallback = Mock(EventEmitter.Callback) reboundCallback = Mock(EventEmitter.Callback) onHttpReplyCallback = Mock(EventEmitter.Callback) emitter = new EventEmitter.Builder() - .onData(dataCallback) - .onSnapshot(snapshotCallback) - .onError(errorCallback) - .onRebound(reboundCallback) - .onHttpReplyCallback(onHttpReplyCallback).build() + .onData(dataCallback) + .onSnapshot(snapshotCallback) + .onError(errorCallback) + .onRebound(reboundCallback) + .onHttpReplyCallback(onHttpReplyCallback).build() ExecutionParameters params = new ExecutionParameters(msg, emitter, config, snapshot) action.execute(params); } def getStarsConfig() { JsonObject config = TestUtils.getMysqlConfigurationBuilder() - .add("sqlQuery", "SELECT * from stars where @id:number =id AND name=@name") - .build() +// .add("sqlQuery", "SELECT * from stars where @id:number =id AND name=@name") + .add("sqlQuery", "SELECT * from stars") + .build() return config; } @@ -101,13 +145,55 @@ class SelectMySQLSpec extends Specification { def "one select"() { prepareStarsTable(); - JsonObject snapshot = Json.createObjectBuilder().build(); - JsonObject body = Json.createObjectBuilder() - .add("id", 1) - .add("name", "Hello") - .build() +// String passthrough = "{\n" + +// " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + +// " \"attachments\": {},\n" + +// " \"body\": {\n" + +// " \"EmpID\": 8,\n" + +// " \"EmpName\": \"Alex Rid\",\n" + +// " \"Designation\": \"QA\",\n" + +// " \"Department\": \"IT\",\n" + +// " \"JoiningDate\": \"2019-08-27\",\n" + +// " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + +// " },\n" + +// " \"headers\": {},\n" + +// " \"passthrough\": {\n" + +// " \"step_3\": {\n" + +// " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + +// " \"attachments\": {},\n" + +// " \"body\": {\n" + +// " \"EmpID\": 8,\n" + +// " \"EmpName\": \"Alex Rid\",\n" + +// " \"Designation\": \"QA\",\n" + +// " \"Department\": \"IT\",\n" + +// " \"JoiningDate\": \"2019-08-27\",\n" + +// " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + +// " },\n" + +// " \"headers\": {},\n" + +// " \"stepId\": \"step_3\"\n" + +// " },\n" + +// " \"step_2\": {\n" + +// " \"body\": {}\n" + +// " },\n" + +// " \"step_1\": {\n" + +// " \"body\": [\n" + +// " {\n" + +// " \"a\": 1\n" + +// " }\n" + +// " ]\n" + +// " }\n" + +// " },\n" + +// " \"stepId\": \"step_3\"\n" + +// "}"; +// jakarta.json.JsonObject jsonBody = Json.createReader(new StringReader(body)).readObject(); + jakarta.json.JsonObject jsonBody = Json.createReader(new StringReader("{}")).readObject(); + jakarta.json.JsonObject snapshot = Json.createObjectBuilder().build(); +// JsonObject body = Json.createObjectBuilder() +// .add("id", 1) +// .add("name", "Hello") +// .build() when: - runAction(getStarsConfig(), body, snapshot) + runAction(getStarsConfig(), jsonBody, snapshot) then: 0 * errorCallback.receive(_) } From d63986c5909ef51863551584d26fcacded367898 Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Mon, 15 Apr 2024 20:36:13 +0300 Subject: [PATCH 3/8] Fix try1 --- build.gradle | 2 +- component.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 421ea70..fc6f422 100755 --- a/build.gradle +++ b/build.gradle @@ -74,7 +74,7 @@ dependencies { compile 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2' compile 'com.google.code.gson:gson:2.10' compile 'com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8' - compile 'io.elastic:sailor-jvm:4.0.1' + compile 'io.elastic:sailor-jvm:4.0.2-SNAPSHOT' compile 'mysql:mysql-connector-java:8.0.29' compile 'org.postgresql:postgresql:42.5.0' diff --git a/component.json b/component.json index c828d99..949478c 100755 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "title": "Database", "description": "Database JDBC connector", - "version": "2.5.8-dev.1", + "version": "2.5.8-dev.2", "credentials": { "verifier": "io.elastic.jdbc.JdbcCredentialsVerifier", "fields": { From 63cab8bc56c8b99fa4b0b4d4def9eaedf6db1e1a Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Tue, 16 Apr 2024 17:43:01 +0300 Subject: [PATCH 4/8] Fix try1 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32de6fd..cfb772d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.5.8 (April 19, 2024) +* Updated Sailor to 4.0.2 + ## 2.5.7 (July 07, 2023) * Bumped Sailor to 4.0.1 From d5e7b6500228ee98a12353d2bc5cc69fcdadb7d0 Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Tue, 16 Apr 2024 17:57:52 +0300 Subject: [PATCH 5/8] Fix try1 --- build.gradle | 4 +- .../select_action/SelectMySQLSpec.groovy | 41 +------------------ 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/build.gradle b/build.gradle index fc6f422..0b3f031 100755 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ if (hasProperty('runWithDependencyCheck')) { dependencyCheck { format = 'HTML' - failBuildOnCVSS = 8 + failBuildOnCVSS = 9 suppressionFile='./dependencyCheck-suppression.xml' } } @@ -76,7 +76,7 @@ dependencies { compile 'com.microsoft.sqlserver:mssql-jdbc:6.4.0.jre8' compile 'io.elastic:sailor-jvm:4.0.2-SNAPSHOT' compile 'mysql:mysql-connector-java:8.0.29' - compile 'org.postgresql:postgresql:42.5.0' + compile 'org.postgresql:postgresql:42.5.6' testCompile 'io.github.cdimascio:java-dotenv:5.1.0' testCompile 'org.hsqldb:hsqldb:2.0.0' diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy index 4ba5b97..75e0899 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy @@ -61,46 +61,7 @@ class SelectMySQLSpec extends Specification { } def runAction(JsonObject config, JsonObject body, JsonObject snapshot) { - String passthrough = "{\n" + - " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + - " \"attachments\": {},\n" + - " \"body\": {\n" + - " \"EmpID\": 8,\n" + - " \"EmpName\": \"Alex Rid\",\n" + - " \"Designation\": \"QA\",\n" + - " \"Department\": \"IT\",\n" + - " \"JoiningDate\": \"2019-08-27\",\n" + - " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + - " },\n" + - " \"headers\": {},\n" + - " \"passthrough\": {\n" + - " \"step_3\": {\n" + - " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + - " \"attachments\": {},\n" + - " \"body\": {\n" + - " \"EmpID\": 8,\n" + - " \"EmpName\": \"Alex Rid\",\n" + - " \"Designation\": \"QA\",\n" + - " \"Department\": \"IT\",\n" + - " \"JoiningDate\": \"2019-08-27\",\n" + - " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + - " },\n" + - " \"headers\": {},\n" + - " \"stepId\": \"step_3\"\n" + - " },\n" + - " \"step_2\": {\n" + - " \"body\": {}\n" + - " },\n" + - " \"step_1\": {\n" + - " \"body\": [\n" + - " {\n" + - " \"a\": 1\n" + - " }\n" + - " ]\n" + - " }\n" + - " },\n" + - " \"stepId\": \"step_3\"\n" + - "}"; + String passthrough = "{\"step_2\":{\"body\":{}},\"step_1\":{\"body\":[{\"a\":1}]}}"; jakarta.json.JsonObject passthroughJson = Json.createReader(new StringReader(passthrough)).readObject(); Message msg = new Message.Builder() .body(body) From 2540c5a5c2d2068570a11b90feb02a4a246112fd Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Wed, 17 Apr 2024 14:35:29 +0300 Subject: [PATCH 6/8] Fix try1 --- src/main/java/io/elastic/jdbc/actions/NewSelectAction.java | 7 ------- .../actions/insert_action/InsertActionMySQLSpec.groovy | 2 +- .../UpsertRowByPrimaryKeyMySQLSpec.groovy | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java b/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java index b09f229..9beb8e0 100644 --- a/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java +++ b/src/main/java/io/elastic/jdbc/actions/NewSelectAction.java @@ -30,14 +30,7 @@ public class NewSelectAction implements Function { @Override public void execute(ExecutionParameters parameters) { JsonObject body = parameters.getMessage().getBody(); - JsonObject passthrough = parameters.getMessage().getPassthrough(); final JsonObject configuration = parameters.getConfiguration(); - System.out.println("Pass==============================="); - System.out.println(passthrough.toString()); - System.out.println("Pass==============================="); - System.out.println("Body==============================="); - System.out.println(body.toString()); - System.out.println("Body==============================="); EventEmitter eventEmitter = parameters.getEventEmitter(); checkConfig(configuration); String dbEngine = configuration.getString("dbEngine"); diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy index b9c6f9f..c363ecf 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy @@ -68,6 +68,6 @@ class InsertActionMySQLSpec extends Specification { expect: records.size() == 1 - records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19T10:10:10, diameter=24}' + records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19T08:10:10, diameter=24}' } } diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy index 410a600..9394fe7 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy @@ -116,7 +116,7 @@ class UpsertRowByPrimaryKeyMySQLSpec extends Specification { expect: records.size() == 1 - records.get(0) == '{id=1, name=Taurus, date=2015-02-19T10:10:10, radius=123, destination=null, visible=true, ' + + records.get(0) == '{id=1, name=Taurus, date=2015-02-19T08:10:10, radius=123, destination=null, visible=true, ' + 'visibledate=null}' } From d69a23b30133decfa9ea8cccfc9d63bfb7631884 Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Wed, 17 Apr 2024 14:52:31 +0300 Subject: [PATCH 7/8] Fix try1 --- .../actions/insert_action/InsertActionMySQLSpec.groovy | 2 +- .../UpsertRowByPrimaryKeyMySQLSpec.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy index c363ecf..b9c6f9f 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/insert_action/InsertActionMySQLSpec.groovy @@ -68,6 +68,6 @@ class InsertActionMySQLSpec extends Specification { expect: records.size() == 1 - records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19T08:10:10, diameter=24}' + records.get(0) == '{id=1, name=Taurus, radius=12, destination=null, visible=true, createdat=2015-02-19T10:10:10, diameter=24}' } } diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy index 9394fe7..410a600 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/upsert_row_by_primary_key/UpsertRowByPrimaryKeyMySQLSpec.groovy @@ -116,7 +116,7 @@ class UpsertRowByPrimaryKeyMySQLSpec extends Specification { expect: records.size() == 1 - records.get(0) == '{id=1, name=Taurus, date=2015-02-19T08:10:10, radius=123, destination=null, visible=true, ' + + records.get(0) == '{id=1, name=Taurus, date=2015-02-19T10:10:10, radius=123, destination=null, visible=true, ' + 'visibledate=null}' } From 0535061d0c1ce1953bd44c81f75a004a0e6d2f2b Mon Sep 17 00:00:00 2001 From: Pavel Voropaiev Date: Wed, 17 Apr 2024 15:09:57 +0300 Subject: [PATCH 8/8] Fix try1 --- .../select_action/SelectMySQLSpec.groovy | 60 +++---------------- 1 file changed, 7 insertions(+), 53 deletions(-) diff --git a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy index 75e0899..efec25e 100644 --- a/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy +++ b/src/test/groovy/io/elastic/jdbc/integration/actions/select_action/SelectMySQLSpec.groovy @@ -61,11 +61,8 @@ class SelectMySQLSpec extends Specification { } def runAction(JsonObject config, JsonObject body, JsonObject snapshot) { - String passthrough = "{\"step_2\":{\"body\":{}},\"step_1\":{\"body\":[{\"a\":1}]}}"; - jakarta.json.JsonObject passthroughJson = Json.createReader(new StringReader(passthrough)).readObject(); Message msg = new Message.Builder() .body(body) - .passthrough(passthroughJson) .build() errorCallback = Mock(EventEmitter.Callback) snapshotCallback = Mock(EventEmitter.Callback) @@ -84,8 +81,7 @@ class SelectMySQLSpec extends Specification { def getStarsConfig() { JsonObject config = TestUtils.getMysqlConfigurationBuilder() -// .add("sqlQuery", "SELECT * from stars where @id:number =id AND name=@name") - .add("sqlQuery", "SELECT * from stars") + .add("sqlQuery", "SELECT * from stars where @id:number =id AND name=@name") .build() return config; } @@ -106,55 +102,13 @@ class SelectMySQLSpec extends Specification { def "one select"() { prepareStarsTable(); -// String passthrough = "{\n" + -// " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + -// " \"attachments\": {},\n" + -// " \"body\": {\n" + -// " \"EmpID\": 8,\n" + -// " \"EmpName\": \"Alex Rid\",\n" + -// " \"Designation\": \"QA\",\n" + -// " \"Department\": \"IT\",\n" + -// " \"JoiningDate\": \"2019-08-27\",\n" + -// " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + -// " },\n" + -// " \"headers\": {},\n" + -// " \"passthrough\": {\n" + -// " \"step_3\": {\n" + -// " \"id\": \"a405c0da-cf68-4196-a6b7-ab58998bc632\",\n" + -// " \"attachments\": {},\n" + -// " \"body\": {\n" + -// " \"EmpID\": 8,\n" + -// " \"EmpName\": \"Alex Rid\",\n" + -// " \"Designation\": \"QA\",\n" + -// " \"Department\": \"IT\",\n" + -// " \"JoiningDate\": \"2019-08-27\",\n" + -// " \"ColumnTIMESTAMP\": \"2019-05-03 00:00:01.0\"\n" + -// " },\n" + -// " \"headers\": {},\n" + -// " \"stepId\": \"step_3\"\n" + -// " },\n" + -// " \"step_2\": {\n" + -// " \"body\": {}\n" + -// " },\n" + -// " \"step_1\": {\n" + -// " \"body\": [\n" + -// " {\n" + -// " \"a\": 1\n" + -// " }\n" + -// " ]\n" + -// " }\n" + -// " },\n" + -// " \"stepId\": \"step_3\"\n" + -// "}"; -// jakarta.json.JsonObject jsonBody = Json.createReader(new StringReader(body)).readObject(); - jakarta.json.JsonObject jsonBody = Json.createReader(new StringReader("{}")).readObject(); - jakarta.json.JsonObject snapshot = Json.createObjectBuilder().build(); -// JsonObject body = Json.createObjectBuilder() -// .add("id", 1) -// .add("name", "Hello") -// .build() + JsonObject snapshot = Json.createObjectBuilder().build(); + JsonObject body = Json.createObjectBuilder() + .add("id", 1) + .add("name", "Hello") + .build() when: - runAction(getStarsConfig(), jsonBody, snapshot) + runAction(getStarsConfig(), body, snapshot) then: 0 * errorCallback.receive(_) }