From 17be814aacb1ee5f374873c482a6f9dd29c252e7 Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 08:59:48 +0100 Subject: [PATCH 01/11] XIVY-12667 Restructured demo processes # Please enter the commit message for your changes. Lines starting --- .../demo/sendDemoMessageData.ivyClass | 4 + .../MessageMultipleRecipients.p.json | 106 ------- .../processes/MessageSingleRecipient.p.json | 113 -------- .../processes/ThreemaDemoProcess.p.json | 274 ++++++++++++++++++ .../demo}/KeyPair/KeyPair.rddescriptor | 0 .../connector/demo}/KeyPair/KeyPair.xhtml | 13 +- .../demo/KeyPair/KeyPairData.ivyClass | 6 + .../demo}/KeyPair/KeyPairProcess.p.json | 16 +- .../multipleRecipients.xhtml | 4 +- .../singleRecipient/singleRecipient.xhtml | 9 +- .../MessageMultipleRecipientsTest.java | 4 +- .../webtest/MessageSingleRecipientTest.java | 4 +- threema-connector/config/rest-clients.yaml | 1 + threema-connector/config/variables.yaml_back | 13 + .../processes/createKeyPair.p.json | 67 ----- .../connector/KeyPair/KeyPairData.ivyClass | 4 - 16 files changed, 327 insertions(+), 311 deletions(-) delete mode 100644 threema-connector-demo/processes/MessageMultipleRecipients.p.json delete mode 100644 threema-connector-demo/processes/MessageSingleRecipient.p.json create mode 100644 threema-connector-demo/processes/ThreemaDemoProcess.p.json rename {threema-connector/src_hd/threema/connector => threema-connector-demo/src_hd/threema/connector/demo}/KeyPair/KeyPair.rddescriptor (100%) rename {threema-connector/src_hd/threema/connector => threema-connector-demo/src_hd/threema/connector/demo}/KeyPair/KeyPair.xhtml (67%) create mode 100644 threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairData.ivyClass rename {threema-connector/src_hd/threema/connector => threema-connector-demo/src_hd/threema/connector/demo}/KeyPair/KeyPairProcess.p.json (68%) create mode 100644 threema-connector/config/variables.yaml_back delete mode 100644 threema-connector/processes/createKeyPair.p.json delete mode 100644 threema-connector/src_hd/threema/connector/KeyPair/KeyPairData.ivyClass diff --git a/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass b/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass index 54168df..de2de42 100644 --- a/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass +++ b/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass @@ -8,3 +8,7 @@ type String #field type PERSISTENT #fieldModifier apiResponse List #field apiResponse PERSISTENT #fieldModifier +publicKey String #field +publicKey PERSISTENT #fieldModifier +privatekey String #field +privatekey PERSISTENT #fieldModifier diff --git a/threema-connector-demo/processes/MessageMultipleRecipients.p.json b/threema-connector-demo/processes/MessageMultipleRecipients.p.json deleted file mode 100644 index 86b8832..0000000 --- a/threema-connector-demo/processes/MessageMultipleRecipients.p.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "format" : "10.0.0", - "id" : "18B1ED116183D822", - "config" : { - "data" : "threema.connector.demo.sendDemoMessageData" - }, - "elements" : [ { - "id" : "f0", - "type" : "RequestStart", - "name" : "start.ivp", - "config" : { - "callSignature" : "start", - "outLink" : "start.ivp", - "tags" : "demo" - }, - "visual" : { - "at" : { "x" : 112, "y" : 64 } - }, - "connect" : { "id" : "f3", "to" : "f2" } - }, { - "id" : "f1", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 704, "y" : 64 } - } - }, { - "id" : "f2", - "type" : "DialogCall", - "name" : "multipleRecipients", - "config" : { - "dialogId" : "threema.connector.demo.multipleRecipients", - "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", - "output" : { - "map" : { - "out" : [ - "in", - "result.sendDemoMessageData", - "result.sendDemoMessageData" - ] - } - }, - "call" : { - "params" : [ - { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } - ], - "map" : { - "param.sendDemoMessageData" : [ - "in", - "in" - ] - } - } - }, - "visual" : { - "at" : { "x" : 240, "y" : 64 } - }, - "connect" : { "id" : "f5", "to" : "f4" } - }, { - "id" : "f4", - "type" : "SubProcessCall", - "name" : "handleMessage", - "config" : { - "processCall" : "multipleRecipients:call(String,List)", - "output" : { - "map" : { - "out" : "in", - "out.apiResponse" : "result.apiResponse" - } - }, - "call" : { - "params" : [ - { "name" : "plainMsg", "type" : "String" }, - { "name" : "receivers", "type" : "List" } - ], - "map" : { - "param.plainMsg" : "in.plainMessage", - "param.receivers" : "in.receiver.split(\"\\n\")" - } - } - }, - "visual" : { - "at" : { "x" : 408, "y" : 64 } - }, - "connect" : { "id" : "f7", "to" : "f6" } - }, { - "id" : "f6", - "type" : "DialogCall", - "name" : "ResultPage", - "config" : { - "dialogId" : "threema.connector.demo.ResultPage", - "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", - "call" : { - "params" : [ - { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } - ], - "map" : { - "param.sendDemoMessageData" : "in" - } - } - }, - "visual" : { - "at" : { "x" : 576, "y" : 64 } - }, - "connect" : { "id" : "f8", "to" : "f1" } - } ] -} \ No newline at end of file diff --git a/threema-connector-demo/processes/MessageSingleRecipient.p.json b/threema-connector-demo/processes/MessageSingleRecipient.p.json deleted file mode 100644 index c0bbc6b..0000000 --- a/threema-connector-demo/processes/MessageSingleRecipient.p.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "format" : "10.0.0", - "id" : "18B22F69680901D3", - "config" : { - "data" : "threema.connector.demo.sendDemoMessageData" - }, - "elements" : [ { - "id" : "f0", - "type" : "RequestStart", - "name" : "start.ivp", - "config" : { - "callSignature" : "start", - "outLink" : "start.ivp", - "tags" : "demo" - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 } - }, - "connect" : { "id" : "f3", "to" : "f2" } - }, { - "id" : "f1", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 768, "y" : 64 } - } - }, { - "id" : "f2", - "type" : "DialogCall", - "name" : "singleRecipient", - "config" : { - "dialogId" : "threema.connector.demo.singleRecipient", - "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", - "output" : { - "map" : { - "out" : [ - "in", - "result.sendDemoMessageData" - ] - } - }, - "call" : { - "params" : [ - { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } - ], - "map" : { - "param.sendDemoMessageData" : "in" - } - } - }, - "visual" : { - "at" : { "x" : 272, "y" : 64 } - }, - "connect" : { "id" : "f5", "to" : "f4" } - }, { - "id" : "f4", - "type" : "SubProcessCall", - "name" : "singleMessage", - "config" : { - "processCall" : "singleRecipient:call(String,String,util.LookupType)", - "output" : { - "map" : { - "out" : "in", - "out.plainMessage" : "in.plainMessage" - }, - "code" : "out.apiResponse.add(result.apiResponse);" - }, - "call" : { - "params" : [ - { "name" : "plainMsg", "type" : "String" }, - { "name" : "receiverID", "type" : "String" }, - { "name" : "lookupType", "type" : "util.LookupType" } - ], - "map" : { - "param.plainMsg" : "in.plainMessage", - "param.receiverID" : "in.receiver", - "param.lookupType" : "util.LookupType.getByString(in.type)" - } - } - }, - "visual" : { - "at" : { "x" : 464, "y" : 64 } - }, - "connect" : { "id" : "f7", "to" : "f6" } - }, { - "id" : "f6", - "type" : "DialogCall", - "name" : "ResultPage", - "config" : { - "dialogId" : "threema.connector.demo.ResultPage", - "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", - "output" : { - "map" : { - "out" : [ - "in", - "result.sendDemoMessageData" - ] - } - }, - "call" : { - "params" : [ - { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } - ], - "map" : { - "param.sendDemoMessageData" : "in" - } - } - }, - "visual" : { - "at" : { "x" : 640, "y" : 64 } - }, - "connect" : { "id" : "f8", "to" : "f1" } - } ] -} \ No newline at end of file diff --git a/threema-connector-demo/processes/ThreemaDemoProcess.p.json b/threema-connector-demo/processes/ThreemaDemoProcess.p.json new file mode 100644 index 0000000..99478ce --- /dev/null +++ b/threema-connector-demo/processes/ThreemaDemoProcess.p.json @@ -0,0 +1,274 @@ +{ + "format" : "10.0.0", + "id" : "18B8EEA3B9A84FAE", + "config" : { + "data" : "threema.connector.demo.sendDemoMessageData" + }, + "elements" : [ { + "id" : "f3", + "type" : "RequestStart", + "name" : "SendMessageToSingleRecipient.ivp", + "config" : { + "callSignature" : "SendMessageToSingleRecipient", + "outLink" : "SendMessageToSingleRecipient.ivp", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 96, "y" : 168 } + }, + "connect" : { "id" : "f19", "to" : "f5" } + }, { + "id" : "f4", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 768, "y" : 168 } + } + }, { + "id" : "f5", + "type" : "DialogCall", + "name" : "singleRecipient", + "config" : { + "dialogId" : "threema.connector.demo.singleRecipient", + "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", + "output" : { + "map" : { + "out" : [ + "in", + "result.sendDemoMessageData" + ] + } + }, + "call" : { + "params" : [ + { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } + ], + "map" : { + "param.sendDemoMessageData" : "in" + } + } + }, + "visual" : { + "at" : { "x" : 272, "y" : 168 } + }, + "connect" : { "id" : "f11", "to" : "f6" } + }, { + "id" : "f6", + "type" : "SubProcessCall", + "name" : "singleMessage", + "config" : { + "processCall" : "singleRecipient:call(String,String,util.LookupType)", + "output" : { + "map" : { + "out" : "in", + "out.plainMessage" : "in.plainMessage" + }, + "code" : "out.apiResponse.add(result.apiResponse);" + }, + "call" : { + "params" : [ + { "name" : "plainMsg", "type" : "String" }, + { "name" : "receiverID", "type" : "String" }, + { "name" : "lookupType", "type" : "util.LookupType" } + ], + "map" : { + "param.plainMsg" : "in.plainMessage", + "param.receiverID" : "in.receiver", + "param.lookupType" : "util.LookupType.getByString(in.type)" + } + } + }, + "visual" : { + "at" : { "x" : 464, "y" : 168 }, + "icon" : "res:/webContent/icons/threema-icon_black.png" + }, + "connect" : { "id" : "f18", "to" : "f7" } + }, { + "id" : "f7", + "type" : "DialogCall", + "name" : "ResultPage", + "config" : { + "dialogId" : "threema.connector.demo.ResultPage", + "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", + "output" : { + "map" : { + "out" : [ + "in", + "result.sendDemoMessageData" + ] + } + }, + "call" : { + "params" : [ + { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } + ], + "map" : { + "param.sendDemoMessageData" : "in" + } + } + }, + "visual" : { + "at" : { "x" : 640, "y" : 168 } + }, + "connect" : { "id" : "f16", "to" : "f4" } + }, { + "id" : "f8", + "type" : "RequestStart", + "name" : "SendMessageToMultipleRecipients.ivp", + "config" : { + "callSignature" : "SendMessageToMultipleRecipients", + "outLink" : "SendMessageToMultipleRecipients.ivp", + "tags" : "demo" + }, + "visual" : { + "at" : { "x" : 96, "y" : 280 } + }, + "connect" : { "id" : "f20", "to" : "f10" } + }, { + "id" : "f9", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 768, "y" : 280 } + } + }, { + "id" : "f10", + "type" : "DialogCall", + "name" : "multipleRecipients", + "config" : { + "dialogId" : "threema.connector.demo.multipleRecipients", + "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", + "output" : { + "map" : { + "out" : [ + "in", + "result.sendDemoMessageData", + "result.sendDemoMessageData" + ] + } + }, + "call" : { + "params" : [ + { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } + ], + "map" : { + "param.sendDemoMessageData" : [ + "in", + "in" + ] + } + } + }, + "visual" : { + "at" : { "x" : 272, "y" : 280 } + }, + "connect" : { "id" : "f15", "to" : "f12" } + }, { + "id" : "f12", + "type" : "SubProcessCall", + "name" : "handleMessage", + "config" : { + "processCall" : "multipleRecipients:call(String,List)", + "output" : { + "map" : { + "out" : "in", + "out.apiResponse" : "result.apiResponse" + } + }, + "call" : { + "params" : [ + { "name" : "plainMsg", "type" : "String" }, + { "name" : "receivers", "type" : "List" } + ], + "map" : { + "param.plainMsg" : "in.plainMessage", + "param.receivers" : "in.receiver.split(\"\\n\")" + } + } + }, + "visual" : { + "at" : { "x" : 464, "y" : 280 }, + "icon" : "res:/webContent/icons/threema-icon_black.png" + }, + "connect" : { "id" : "f17", "to" : "f13" } + }, { + "id" : "f13", + "type" : "DialogCall", + "name" : "ResultPage", + "config" : { + "dialogId" : "threema.connector.demo.ResultPage", + "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", + "call" : { + "params" : [ + { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } + ], + "map" : { + "param.sendDemoMessageData" : "in" + } + } + }, + "visual" : { + "at" : { "x" : 640, "y" : 280 } + }, + "connect" : { "id" : "f14", "to" : "f9" } + }, { + "id" : "f0", + "type" : "RequestStart", + "name" : "GenerateKeyPair.ivp", + "config" : { + "callSignature" : "GenerateKeyPair", + "outLink" : "GenerateKeyPair.ivp" + }, + "visual" : { + "at" : { "x" : 96, "y" : 368 } + }, + "connect" : { "id" : "f22", "to" : "f2" } + }, { + "id" : "f1", + "type" : "TaskEnd", + "visual" : { + "at" : { "x" : 768, "y" : 368 } + } + }, { + "id" : "f2", + "type" : "Script", + "name" : "generateKeyPair", + "config" : { + "output" : { + "code" : [ + "import util.KeyPairGenerator;", + "import util.KeyPairGenerator.KeyPair;", + "", + "KeyPair keys = KeyPairGenerator.generate();", + "", + "out.publicKey = keys.publicKey();", + "out.privateKey = keys.privateKey();" + ] + } + }, + "visual" : { + "at" : { "x" : 272, "y" : 368 } + }, + "connect" : { "id" : "f26", "to" : "f25" } + }, { + "id" : "f25", + "type" : "DialogCall", + "name" : "KeyPair", + "config" : { + "dialogId" : "threema.connector.demo.KeyPair", + "startMethod" : "start(String,String)", + "call" : { + "params" : [ + { "name" : "publicKey", "type" : "String" }, + { "name" : "privatekey", "type" : "String" } + ], + "map" : { + "param.publicKey" : "in.publicKey", + "param.privatekey" : "in.privatekey" + } + } + }, + "visual" : { + "at" : { "x" : 464, "y" : 368 } + }, + "connect" : { "id" : "f21", "to" : "f1" } + } ] +} \ No newline at end of file diff --git a/threema-connector/src_hd/threema/connector/KeyPair/KeyPair.rddescriptor b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.rddescriptor similarity index 100% rename from threema-connector/src_hd/threema/connector/KeyPair/KeyPair.rddescriptor rename to threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.rddescriptor diff --git a/threema-connector/src_hd/threema/connector/KeyPair/KeyPair.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml similarity index 67% rename from threema-connector/src_hd/threema/connector/KeyPair/KeyPair.xhtml rename to threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml index ff800ef..7e3573a 100644 --- a/threema-connector/src_hd/threema/connector/KeyPair/KeyPair.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml @@ -7,18 +7,19 @@ KeyPair -

Newly generated Keypair

+

Keypair for Threema.Gateway

+

Use the following keys to request a new End-to-End Threema.Gateway ID over at Theema Gateway.

- + - - + + - - + +
diff --git a/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairData.ivyClass b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairData.ivyClass new file mode 100644 index 0000000..2ee413c --- /dev/null +++ b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairData.ivyClass @@ -0,0 +1,6 @@ +KeyPairData #class +threema.connector.demo.KeyPair #namespace +publicKey String #field +publicKey PERSISTENT #fieldModifier +privatekey String #field +privatekey PERSISTENT #fieldModifier diff --git a/threema-connector/src_hd/threema/connector/KeyPair/KeyPairProcess.p.json b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json similarity index 68% rename from threema-connector/src_hd/threema/connector/KeyPair/KeyPairProcess.p.json rename to threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json index d7e4795..257b427 100644 --- a/threema-connector/src_hd/threema/connector/KeyPair/KeyPairProcess.p.json +++ b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json @@ -1,25 +1,27 @@ { "format" : "10.0.0", - "id" : "18B675A6BCE832D1", + "id" : "18B8EF27D89ED10D", "kind" : "HTML_DIALOG", "config" : { - "data" : "threema.connector.KeyPair.KeyPairData" + "data" : "threema.connector.demo.KeyPair.KeyPairData" }, "elements" : [ { "id" : "f0", "type" : "HtmlDialogStart", - "name" : "start(createKeyPairData)", + "name" : "start(String,String)", "config" : { "callSignature" : "start", "input" : { "params" : [ - { "name" : "createKeyPairData", "type" : "threema.connector.createKeyPairData" } + { "name" : "publicKey", "type" : "String" }, + { "name" : "privatekey", "type" : "String" } ], "map" : { - "out.createKeyPairData" : "param.createKeyPairData" + "out.publicKey" : "param.publicKey", + "out.privatekey" : "param.privatekey" } }, - "guid" : "18B675A6BCFECF51" + "guid" : "18B8EF27D8A1D1A5" }, "visual" : { "at" : { "x" : 96, "y" : 64 } @@ -36,7 +38,7 @@ "type" : "HtmlDialogEventStart", "name" : "close", "config" : { - "guid" : "18B675A6BD2AE7CB" + "guid" : "18B8EF27D8CA39FE" }, "visual" : { "at" : { "x" : 96, "y" : 160 } diff --git a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml index e387c3d..502802a 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml @@ -27,7 +27,7 @@ cols="33" required="true" /> + value="Receiver (one per line) ThreemaId / Email / Phone (international format)" /> @@ -38,7 +38,7 @@ + value="Send" update="form" icon="pi pi-check" />
diff --git a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml index 83e4804..d40793b 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml @@ -27,12 +27,13 @@ + value="#{data.sendDemoMessageData.receiver}" required="true" placeholder="placeholder"> - + + layout="lineDirection" required="true" + onclick="(() => {console.log('hamburger')})()"> + value="Send" update="form" icon="pi pi-check" /> diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java index 463e62f..44bea27 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java @@ -6,9 +6,11 @@ import static com.codeborne.selenide.Selenide.$$; import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; + import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.ivy.webtest.engine.EngineUrl; import com.codeborne.selenide.ElementsCollection; @@ -19,7 +21,7 @@ public class MessageMultipleRecipientsTest { @Test @Disabled public void sendMessage() { - open(EngineUrl.createProcessUrl("threema-connector-demo/18B1ED116183D822/start.ivp")); + open(EngineUrl.createProcessUrl("threema-connector-demo/18B8EEA3B9A84FAE/SendMessageToMultipleRecipients.ivp")); String message = "Hello World"; String recipients = "validId\ninvalidId"; // Assert empty form diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java index fb96520..941e59b 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java @@ -7,9 +7,11 @@ import static com.codeborne.selenide.Selenide.$$; import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; + import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.ivy.webtest.engine.EngineUrl; import com.axonivy.ivy.webtest.primeui.PrimeUi; @@ -21,7 +23,7 @@ public class MessageSingleRecipientTest { @Test @Disabled public void sendMessage() { - open(EngineUrl.createProcessUrl("threema-connector-demo/18B22F69680901D3/start.ivp")); + open(EngineUrl.createProcessUrl("threema-connector-demo/18B8EEA3B9A84FAE/SendMessageToSingleRecipient.ivp")); String message = "Hello World"; String validId = "validId"; // Assert empty form diff --git a/threema-connector/config/rest-clients.yaml b/threema-connector/config/rest-clients.yaml index 52b6940..0d96434 100644 --- a/threema-connector/config/rest-clients.yaml +++ b/threema-connector/config/rest-clients.yaml @@ -2,5 +2,6 @@ RestClients: ThreemaGateway: UUID: af315689-b538-4142-a823-0632d66754d7 Url: https://msgapi.threema.ch + Icon: res:/webContent/icons/threema-icon_black.png Features: - ch.ivyteam.ivy.rest.client.mapper.JsonFeature diff --git a/threema-connector/config/variables.yaml_back b/threema-connector/config/variables.yaml_back new file mode 100644 index 0000000..e4fd1d0 --- /dev/null +++ b/threema-connector/config/variables.yaml_back @@ -0,0 +1,13 @@ +Variables: + threemaConnector: + + # Your Threema.Gateway ID + threemaId: '' + + # Your Threema.Gateway Secret + # [password] + secret: '' + + # Your private key associated with your Threema.Gateway ID + # [password] + privateKey: '' diff --git a/threema-connector/processes/createKeyPair.p.json b/threema-connector/processes/createKeyPair.p.json deleted file mode 100644 index 9427be7..0000000 --- a/threema-connector/processes/createKeyPair.p.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "format" : "10.0.0", - "id" : "18B67537F65B8CEE", - "config" : { - "data" : "threema.connector.createKeyPairData" - }, - "elements" : [ { - "id" : "f0", - "type" : "RequestStart", - "name" : "start.ivp", - "config" : { - "callSignature" : "start", - "outLink" : "start.ivp" - }, - "visual" : { - "at" : { "x" : 96, "y" : 64 } - }, - "connect" : { "id" : "f4", "to" : "f3" } - }, { - "id" : "f1", - "type" : "TaskEnd", - "visual" : { - "at" : { "x" : 696, "y" : 64 } - } - }, { - "id" : "f3", - "type" : "Script", - "name" : "generateKeyPair", - "config" : { - "output" : { - "code" : [ - "import util.KeyPairGenerator;", - "import util.KeyPairGenerator.KeyPair;", - "", - "KeyPair keys = KeyPairGenerator.generate();", - "", - "out.publicKey = keys.publicKey();", - "out.privateKey = keys.privateKey();" - ] - } - }, - "visual" : { - "at" : { "x" : 320, "y" : 64 } - }, - "connect" : { "id" : "f6", "to" : "f5" } - }, { - "id" : "f5", - "type" : "DialogCall", - "name" : "KeyPair", - "config" : { - "dialogId" : "threema.connector.KeyPair", - "startMethod" : "start(threema.connector.createKeyPairData)", - "call" : { - "params" : [ - { "name" : "createKeyPairData", "type" : "threema.connector.createKeyPairData" } - ], - "map" : { - "param.createKeyPairData" : "in" - } - } - }, - "visual" : { - "at" : { "x" : 508, "y" : 64 } - }, - "connect" : { "id" : "f2", "to" : "f1" } - } ] -} \ No newline at end of file diff --git a/threema-connector/src_hd/threema/connector/KeyPair/KeyPairData.ivyClass b/threema-connector/src_hd/threema/connector/KeyPair/KeyPairData.ivyClass deleted file mode 100644 index b47ddd9..0000000 --- a/threema-connector/src_hd/threema/connector/KeyPair/KeyPairData.ivyClass +++ /dev/null @@ -1,4 +0,0 @@ -KeyPairData #class -threema.connector.KeyPair #namespace -createKeyPairData threema.connector.createKeyPairData #field -createKeyPairData PERSISTENT #fieldModifier From e8a164986bc269ccba0354ae853136d5521a288f Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 10:29:17 +0100 Subject: [PATCH 02/11] XIVY-12667 Added option to send another message from result screen --- .../demo/sendDemoMessageData.ivyClass | 2 + .../processes/ThreemaDemoProcess.p.json | 56 ++++++++++++++----- .../demo/ResultPage/ResultPage.xhtml | 6 +- .../demo/ResultPage/ResultPageProcess.p.json | 25 ++++++++- .../multipleRecipients.xhtml | 2 +- .../singleRecipient/singleRecipient.xhtml | 2 +- threema-connector-product/README.md | 3 +- 7 files changed, 75 insertions(+), 21 deletions(-) diff --git a/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass b/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass index de2de42..43c34d8 100644 --- a/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass +++ b/threema-connector-demo/dataclasses/threema/connector/demo/sendDemoMessageData.ivyClass @@ -12,3 +12,5 @@ publicKey String #field publicKey PERSISTENT #fieldModifier privatekey String #field privatekey PERSISTENT #fieldModifier +sendAnother Boolean #field +sendAnother PERSISTENT #fieldModifier diff --git a/threema-connector-demo/processes/ThreemaDemoProcess.p.json b/threema-connector-demo/processes/ThreemaDemoProcess.p.json index 99478ce..4deb411 100644 --- a/threema-connector-demo/processes/ThreemaDemoProcess.p.json +++ b/threema-connector-demo/processes/ThreemaDemoProcess.p.json @@ -21,7 +21,7 @@ "id" : "f4", "type" : "TaskEnd", "visual" : { - "at" : { "x" : 768, "y" : 168 } + "at" : { "x" : 936, "y" : 168 } } }, { "id" : "f5", @@ -78,7 +78,7 @@ } }, "visual" : { - "at" : { "x" : 464, "y" : 168 }, + "at" : { "x" : 512, "y" : 168 }, "icon" : "res:/webContent/icons/threema-icon_black.png" }, "connect" : { "id" : "f18", "to" : "f7" } @@ -91,10 +91,10 @@ "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", "output" : { "map" : { - "out" : [ - "in", - "result.sendDemoMessageData" - ] + "out" : "result.sendDemoMessageData", + "out.plainMessage" : "\"\"", + "out.receiver" : "\"\"", + "out.type" : "\"\"" } }, "call" : { @@ -107,9 +107,9 @@ } }, "visual" : { - "at" : { "x" : 640, "y" : 168 } + "at" : { "x" : 688, "y" : 168 } }, - "connect" : { "id" : "f16", "to" : "f4" } + "connect" : { "id" : "f24", "to" : "f23" } }, { "id" : "f8", "type" : "RequestStart", @@ -127,7 +127,7 @@ "id" : "f9", "type" : "TaskEnd", "visual" : { - "at" : { "x" : 768, "y" : 280 } + "at" : { "x" : 936, "y" : 280 } } }, { "id" : "f10", @@ -185,7 +185,7 @@ } }, "visual" : { - "at" : { "x" : 464, "y" : 280 }, + "at" : { "x" : 512, "y" : 280 }, "icon" : "res:/webContent/icons/threema-icon_black.png" }, "connect" : { "id" : "f17", "to" : "f13" } @@ -196,6 +196,14 @@ "config" : { "dialogId" : "threema.connector.demo.ResultPage", "startMethod" : "start(threema.connector.demo.sendDemoMessageData)", + "output" : { + "map" : { + "out" : "in", + "out.plainMessage" : "\"\"", + "out.receiver" : "\"\"", + "out.type" : "\"\"" + } + }, "call" : { "params" : [ { "name" : "sendDemoMessageData", "type" : "threema.connector.demo.sendDemoMessageData" } @@ -206,9 +214,9 @@ } }, "visual" : { - "at" : { "x" : 640, "y" : 280 } + "at" : { "x" : 688, "y" : 280 } }, - "connect" : { "id" : "f14", "to" : "f9" } + "connect" : { "id" : "f27", "to" : "f14" } }, { "id" : "f0", "type" : "RequestStart", @@ -225,7 +233,7 @@ "id" : "f1", "type" : "TaskEnd", "visual" : { - "at" : { "x" : 768, "y" : 368 } + "at" : { "x" : 936, "y" : 368 } } }, { "id" : "f2", @@ -267,8 +275,28 @@ } }, "visual" : { - "at" : { "x" : 464, "y" : 368 } + "at" : { "x" : 520, "y" : 368 } }, "connect" : { "id" : "f21", "to" : "f1" } + }, { + "id" : "f23", + "type" : "Alternative", + "visual" : { + "at" : { "x" : 840, "y" : 168 } + }, + "connect" : [ + { "id" : "f16", "to" : "f5", "via" : [ { "x" : 840, "y" : 104 }, { "x" : 272, "y" : 104 } ], "condition" : "in.sendAnother" }, + { "id" : "f29", "to" : "f4" } + ] + }, { + "id" : "f14", + "type" : "Alternative", + "visual" : { + "at" : { "x" : 840, "y" : 280 } + }, + "connect" : [ + { "id" : "f31", "to" : "f10", "via" : [ { "x" : 840, "y" : 216 }, { "x" : 272, "y" : 216 } ], "condition" : "in.sendAnother" }, + { "id" : "f30", "to" : "f9" } + ] } ] } \ No newline at end of file diff --git a/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPage.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPage.xhtml index 1b6ebe4..6755089 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPage.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPage.xhtml @@ -40,10 +40,10 @@
- + + value="Close" update="form" icon="pi pi-times" />
diff --git a/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPageProcess.p.json b/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPageProcess.p.json index 7f85581..1a3cf61 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPageProcess.p.json +++ b/threema-connector-demo/src_hd/threema/connector/demo/ResultPage/ResultPageProcess.p.json @@ -44,7 +44,13 @@ "type" : "HtmlDialogEventStart", "name" : "close", "config" : { - "guid" : "18B23815CA6B079E" + "guid" : "18B23815CA6B079E", + "output" : { + "map" : { + "out" : "in", + "out.sendDemoMessageData.sendAnother" : "false" + } + } }, "visual" : { "at" : { "x" : 96, "y" : 160 } @@ -80,5 +86,22 @@ "at" : { "x" : 208, "y" : 64 } }, "connect" : { "id" : "f7", "to" : "f1" } + }, { + "id" : "f8", + "type" : "HtmlDialogEventStart", + "name" : "sendAnother", + "config" : { + "guid" : "18B8F438B7519CB7", + "output" : { + "map" : { + "out" : "in", + "out.sendDemoMessageData.sendAnother" : "true" + } + } + }, + "visual" : { + "at" : { "x" : 96, "y" : 224 } + }, + "connect" : { "id" : "f9", "to" : "f4" } } ] } \ No newline at end of file diff --git a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml index 502802a..ee2312a 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml @@ -38,7 +38,7 @@ + value="Send" update="form" icon="pi pi-send" /> diff --git a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml index d40793b..125b24d 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml @@ -49,7 +49,7 @@ + value="Send" update="form" icon="pi pi-send" /> diff --git a/threema-connector-product/README.md b/threema-connector-product/README.md index b8b02a3..79956a8 100644 --- a/threema-connector-product/README.md +++ b/threema-connector-product/README.md @@ -12,7 +12,8 @@ Credentials and credits are required to send messages. The credentials can be cr ## Setup 1. Generate a new key pair using the "createKeyPair" process. -2. Create "End-to-End Threema ID" at: [Request new ID](https://gateway.threema.ch/en/id-request)
+2. Create "End-to-End Threema ID" at: [Request new ID](https://gateway.threema.ch/en/id-request)
+Free credits for testing purposes can be requestet at [support-gateway@threema.ch](mailto:support-gateway@threema.ch)
3. Add the following variables to your Axon Ivy Project: ``` From fd49fea8ff08f53376edd3d830ca2d7ae04e5c6a Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 10:31:30 +0100 Subject: [PATCH 03/11] XIVY-12667 Removed console output --- .../connector/demo/singleRecipient/singleRecipient.xhtml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml index 125b24d..4f6cfe5 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml @@ -32,8 +32,7 @@ + layout="lineDirection" required="true"> Date: Thu, 2 Nov 2023 11:13:48 +0100 Subject: [PATCH 04/11] XIVY-12667 Added dynamic placeholder for recipient --- .../multipleRecipients.xhtml | 2 +- .../singleRecipient/singleRecipient.xhtml | 31 +++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml index ee2312a..1496a81 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/multipleRecipients/multipleRecipients.xhtml @@ -30,7 +30,7 @@ value="Receiver (one per line) ThreemaId / Email / Phone (international format)" /> + cols="50" required="true"/>
diff --git a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml index 4f6cfe5..14fcf3d 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/singleRecipient/singleRecipient.xhtml @@ -4,7 +4,7 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:ic="http://ivyteam.ch/jsf/component" xmlns:p="http://primefaces.org/ui" - xmlns:pe="http://primefaces.org/ui/extensions"> + xmlns:pe="http://primefaces.org/ui/extensions"> singleRecipient @@ -27,12 +27,12 @@ + value="#{data.sendDemoMessageData.receiver}" required="true" placeholder="recipient"> + layout="lineDirection" required="true" onchange="updatePlaceholder(value)"> - -
@@ -51,7 +49,28 @@ value="Send" update="form" icon="pi pi-send" />
- + + +
From c81b805a89c96f5bd27ffa1c0dd34e053d034bc1 Mon Sep 17 00:00:00 2001 From: ivy-fhe <146715063+ivy-fhe@users.noreply.github.com> Date: Thu, 2 Nov 2023 11:21:13 +0100 Subject: [PATCH 05/11] Update README.md XIVY-12667 Spelling error --- threema-connector-product/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threema-connector-product/README.md b/threema-connector-product/README.md index 79956a8..ce51e47 100644 --- a/threema-connector-product/README.md +++ b/threema-connector-product/README.md @@ -13,7 +13,7 @@ Credentials and credits are required to send messages. The credentials can be cr ## Setup 1. Generate a new key pair using the "createKeyPair" process. 2. Create "End-to-End Threema ID" at: [Request new ID](https://gateway.threema.ch/en/id-request)
-Free credits for testing purposes can be requestet at [support-gateway@threema.ch](mailto:support-gateway@threema.ch)
+Free credits for testing purposes can be requested at [support-gateway@threema.ch](mailto:support-gateway@threema.ch)
3. Add the following variables to your Axon Ivy Project: ``` From a77f2b45fb4b7ceed71e07a0c6465dee93ffdc4d Mon Sep 17 00:00:00 2001 From: ivy-fhe <146715063+ivy-fhe@users.noreply.github.com> Date: Thu, 2 Nov 2023 11:22:20 +0100 Subject: [PATCH 06/11] Update README.md XIVY-12667 Changed process to match name for key generation --- threema-connector-product/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threema-connector-product/README.md b/threema-connector-product/README.md index ce51e47..5134c5a 100644 --- a/threema-connector-product/README.md +++ b/threema-connector-product/README.md @@ -11,7 +11,7 @@ Credentials and credits are required to send messages. The credentials can be cr ![Result screen](./images/resultScreen.png) ## Setup -1. Generate a new key pair using the "createKeyPair" process. +1. Generate a new key pair using the "GenerateKeyPair" process. 2. Create "End-to-End Threema ID" at: [Request new ID](https://gateway.threema.ch/en/id-request)
Free credits for testing purposes can be requested at [support-gateway@threema.ch](mailto:support-gateway@threema.ch)
3. Add the following variables to your Axon Ivy Project: From f914fc5c337f5c139d7ba155a9395e9738fd0a52 Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 12:13:42 +0100 Subject: [PATCH 07/11] XIVY-12667 Upgraded buildplugin to 10.0.14 enabled and configured webtests --- threema-connector-demo/pom.xml | 2 +- threema-connector-test/pom.xml | 4 ++-- threema-connector-webtest/pom.xml | 10 ++++++++-- .../webtest/MessageMultipleRecipientsTest.java | 9 ++++++--- .../connector/webtest/MessageSingleRecipientTest.java | 9 ++++++--- threema-connector/pom.xml | 2 +- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/threema-connector-demo/pom.xml b/threema-connector-demo/pom.xml index 981dd84..dddf810 100644 --- a/threema-connector-demo/pom.xml +++ b/threema-connector-demo/pom.xml @@ -18,7 +18,7 @@ com.axonivy.ivy.ci project-build-plugin - 10.0.6 + 10.0.14 true diff --git a/threema-connector-test/pom.xml b/threema-connector-test/pom.xml index f614ad4..cac22d0 100644 --- a/threema-connector-test/pom.xml +++ b/threema-connector-test/pom.xml @@ -15,7 +15,7 @@ com.axonivy.ivy.test unit-tester - 10.0.0 + 10.0.14 test @@ -36,7 +36,7 @@ com.axonivy.ivy.ci project-build-plugin - 10.0.6 + 10.0.14 true diff --git a/threema-connector-webtest/pom.xml b/threema-connector-webtest/pom.xml index fd5ebe5..cfa091a 100644 --- a/threema-connector-webtest/pom.xml +++ b/threema-connector-webtest/pom.xml @@ -12,10 +12,16 @@ ${project.version} iar + + com.axonivy.connector.threema + threema-connector-test + ${project.version} + iar + com.axonivy.ivy.webtest web-tester - 10.0.0 + 10.0.14 test @@ -25,7 +31,7 @@ com.axonivy.ivy.ci project-build-plugin - 10.0.6 + 10.0.14 true diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java index 44bea27..ed26b67 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java @@ -7,20 +7,23 @@ import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.ivy.webtest.engine.EngineUrl; +import com.axonivy.ivy.webtest.engine.WebAppFixture; import com.codeborne.selenide.ElementsCollection; +import ch.ivyteam.threema.mocks.ThreemaServiceMock; + @IvyWebTest public class MessageMultipleRecipientsTest { @Test - @Disabled - public void sendMessage() { + public void sendMessage(WebAppFixture fixture) { + String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); + fixture.config("RestClients.ThreemaGateway.Url", mockUrl); open(EngineUrl.createProcessUrl("threema-connector-demo/18B8EEA3B9A84FAE/SendMessageToMultipleRecipients.ivp")); String message = "Hello World"; String recipients = "validId\ninvalidId"; diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java index 941e59b..70c5537 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java @@ -8,21 +8,24 @@ import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; import com.axonivy.ivy.webtest.IvyWebTest; import com.axonivy.ivy.webtest.engine.EngineUrl; +import com.axonivy.ivy.webtest.engine.WebAppFixture; import com.axonivy.ivy.webtest.primeui.PrimeUi; import com.codeborne.selenide.ElementsCollection; +import ch.ivyteam.threema.mocks.ThreemaServiceMock; + @IvyWebTest public class MessageSingleRecipientTest { @Test - @Disabled - public void sendMessage() { + public void sendMessage(WebAppFixture fixture) { + String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); + fixture.config("RestClients.ThreemaGateway.Url", mockUrl); open(EngineUrl.createProcessUrl("threema-connector-demo/18B8EEA3B9A84FAE/SendMessageToSingleRecipient.ivp")); String message = "Hello World"; String validId = "validId"; diff --git a/threema-connector/pom.xml b/threema-connector/pom.xml index 11ba934..f173cd3 100644 --- a/threema-connector/pom.xml +++ b/threema-connector/pom.xml @@ -11,7 +11,7 @@ com.axonivy.ivy.ci project-build-plugin - 10.0.6 + 10.0.14 true From b9c4087543e81156bace910b25635be1fa7f36b6 Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 12:22:31 +0100 Subject: [PATCH 08/11] XIVY-12667 removed backup variable file --- threema-connector/config/variables.yaml_back | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 threema-connector/config/variables.yaml_back diff --git a/threema-connector/config/variables.yaml_back b/threema-connector/config/variables.yaml_back deleted file mode 100644 index e4fd1d0..0000000 --- a/threema-connector/config/variables.yaml_back +++ /dev/null @@ -1,13 +0,0 @@ -Variables: - threemaConnector: - - # Your Threema.Gateway ID - threemaId: '' - - # Your Threema.Gateway Secret - # [password] - secret: '' - - # Your private key associated with your Threema.Gateway ID - # [password] - privateKey: '' From 84002a5f4cb4149ea819ce26e0d56ff20fb381b5 Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Thu, 2 Nov 2023 14:36:35 +0100 Subject: [PATCH 09/11] XIVY-12667 Added cleanup after Webtests --- .../processes/ThreemaDemoProcess.p.json | 10 ++++++++-- .../threema/connector/demo/KeyPair/KeyPair.xhtml | 2 +- .../connector/demo/KeyPair/KeyPairProcess.p.json | 6 +++--- .../ch/ivyteam/threema/mocks/ThreemaServiceMock.java | 3 +-- .../webtest/MessageMultipleRecipientsTest.java | 6 ++++++ .../connector/webtest/MessageSingleRecipientTest.java | 7 +++++++ 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/threema-connector-demo/processes/ThreemaDemoProcess.p.json b/threema-connector-demo/processes/ThreemaDemoProcess.p.json index 4deb411..715015a 100644 --- a/threema-connector-demo/processes/ThreemaDemoProcess.p.json +++ b/threema-connector-demo/processes/ThreemaDemoProcess.p.json @@ -269,8 +269,14 @@ { "name" : "privatekey", "type" : "String" } ], "map" : { - "param.publicKey" : "in.publicKey", - "param.privatekey" : "in.privatekey" + "param.publicKey" : [ + "in.publicKey", + "in.publicKey" + ], + "param.privatekey" : [ + "in.privatekey", + "in.privatekey" + ] } } }, diff --git a/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml index 7e3573a..df685f8 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml +++ b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPair.xhtml @@ -25,7 +25,7 @@
- +
diff --git a/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json index 257b427..e08a9c5 100644 --- a/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json +++ b/threema-connector-demo/src_hd/threema/connector/demo/KeyPair/KeyPairProcess.p.json @@ -1,6 +1,6 @@ { "format" : "10.0.0", - "id" : "18B8EF27D89ED10D", + "id" : "18B902D7EEB4DF97", "kind" : "HTML_DIALOG", "config" : { "data" : "threema.connector.demo.KeyPair.KeyPairData" @@ -21,7 +21,7 @@ "out.privatekey" : "param.privatekey" } }, - "guid" : "18B8EF27D8A1D1A5" + "guid" : "18B902D7EEFA5F64" }, "visual" : { "at" : { "x" : 96, "y" : 64 } @@ -38,7 +38,7 @@ "type" : "HtmlDialogEventStart", "name" : "close", "config" : { - "guid" : "18B8EF27D8CA39FE" + "guid" : "18B902D7EFFC72C5" }, "visual" : { "at" : { "x" : 96, "y" : 160 } diff --git a/threema-connector-test/src/ch/ivyteam/threema/mocks/ThreemaServiceMock.java b/threema-connector-test/src/ch/ivyteam/threema/mocks/ThreemaServiceMock.java index 860e3b8..0d9076d 100644 --- a/threema-connector-test/src/ch/ivyteam/threema/mocks/ThreemaServiceMock.java +++ b/threema-connector-test/src/ch/ivyteam/threema/mocks/ThreemaServiceMock.java @@ -25,8 +25,7 @@ public class ThreemaServiceMock { static final String PATH_SUFFIX = "mock"; private static final String THREEMA_ID = "validId"; public static final String URI = "{" + IvyDefaultJaxRsTemplates.APP_URL + "}/api/" + PATH_SUFFIX; - // {ivy.app.baseurl}/api/mock - // https://msgapi.threema.ch + @GET @Path("/lookup/{type}/{id}") diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java index ed26b67..fd7ba3c 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java @@ -7,6 +7,7 @@ import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -20,6 +21,11 @@ @IvyWebTest public class MessageMultipleRecipientsTest { + @AfterEach + public void cleanFixture(WebAppFixture fixture) { + fixture.resetConfig("RestClients.ThreemaGateway.Url"); + } + @Test public void sendMessage(WebAppFixture fixture) { String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java index 70c5537..ba5e437 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java @@ -8,6 +8,7 @@ import static com.codeborne.selenide.Selenide.open; import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -22,6 +23,12 @@ @IvyWebTest public class MessageSingleRecipientTest { + @AfterEach + public void cleanFixture(WebAppFixture fixture) { + fixture.resetConfig("RestClients.ThreemaGateway.Url"); + } + + @Test public void sendMessage(WebAppFixture fixture) { String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); From b76e338fcb0092064d0f68921f4c615367fc1744 Mon Sep 17 00:00:00 2001 From: ivy-fhe <146715063+ivy-fhe@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:42:43 +0100 Subject: [PATCH 10/11] XIVY-12667 Update ci.yml Updated engine version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da54c13..6ad15e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,4 +11,4 @@ jobs: build: uses: axonivy-market/github-workflows/.github/workflows/ci.yml@v2 with: - mvnArgs: -Dmaven.test.failure.ignore=true -Divy.engine.version=10.0.13 + mvnArgs: -Dmaven.test.failure.ignore=true -Divy.engine.version=10.0.14 From 818d8bd67bb8c93eb298f50ca4a857e7f59ea710 Mon Sep 17 00:00:00 2001 From: Fabian Heuberger Date: Wed, 8 Nov 2023 08:31:48 +0100 Subject: [PATCH 11/11] XIVY-12667 Disabled webtests as WebAppFixture does not yet work --- .../connector/webtest/MessageMultipleRecipientsTest.java | 2 ++ .../threema/connector/webtest/MessageSingleRecipientTest.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java index fd7ba3c..944afdd 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageMultipleRecipientsTest.java @@ -8,6 +8,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -27,6 +28,7 @@ public void cleanFixture(WebAppFixture fixture) { } @Test + @Disabled public void sendMessage(WebAppFixture fixture) { String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); fixture.config("RestClients.ThreemaGateway.Url", mockUrl); diff --git a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java index ba5e437..97a6a80 100644 --- a/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java +++ b/threema-connector-webtest/src_test/threema/connector/webtest/MessageSingleRecipientTest.java @@ -9,6 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openqa.selenium.By; @@ -30,6 +31,7 @@ public void cleanFixture(WebAppFixture fixture) { @Test + @Disabled public void sendMessage(WebAppFixture fixture) { String mockUrl = ThreemaServiceMock.URI.replaceAll("\\{", "%7B").replaceAll("\\}", "%7D").replaceAll("/", "%2F"); fixture.config("RestClients.ThreemaGateway.Url", mockUrl);