This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 204bad66c3 refactor: Reactivate mqtt cypress test (#3064)
204bad66c3 is described below

commit 204bad66c3272a3e5d89b2ed390667cafda7ae01
Author: Philipp Zehnder <[email protected]>
AuthorDate: Wed Jul 24 17:24:41 2024 +0200

    refactor: Reactivate mqtt cypress test (#3064)
    
    * refactor: Reactivate mqtt cypress test
    
    * refactor: Fix linting error
---
 docker-compose.yml                                    |  8 ++++++++
 ui/cypress/support/builder/AdapterBuilder.ts          |  4 +---
 ui/cypress/tests/thirdparty/{Mqtt.ts => Mqtt.spec.ts} | 14 ++++++++------
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index 5ea7f82b45..c11d7036fe 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -135,10 +135,18 @@ services:
     networks:
       spnet:
 
+
+  mosquitto:
+    image: eclipse-mosquitto:1.5.4
+    logging: *default-logging
+    networks:
+      spnet:
+
   opcua:
     image: mcr.microsoft.com/iotedge/opc-plc
     logging: *default-logging
     command: --ut=true
+    logging: *default-logging
     networks:
       spnet:
 
diff --git a/ui/cypress/support/builder/AdapterBuilder.ts 
b/ui/cypress/support/builder/AdapterBuilder.ts
index cb42932da1..03a5ac46ba 100644
--- a/ui/cypress/support/builder/AdapterBuilder.ts
+++ b/ui/cypress/support/builder/AdapterBuilder.ts
@@ -101,9 +101,7 @@ export class AdapterBuilder {
         return this;
     }
 
-    public setFormat(
-        format: 'csv' | 'json' | 'json_array' | 'json_object' | 'xml',
-    ) {
+    public setFormat(format: 'csv' | 'json' | 'json_array' | 'xml') {
         this.adapterInput.format = format;
         return this;
     }
diff --git a/ui/cypress/tests/thirdparty/Mqtt.ts 
b/ui/cypress/tests/thirdparty/Mqtt.spec.ts
similarity index 78%
rename from ui/cypress/tests/thirdparty/Mqtt.ts
rename to ui/cypress/tests/thirdparty/Mqtt.spec.ts
index 108fca8dbe..fe5f50ef5e 100644
--- a/ui/cypress/tests/thirdparty/Mqtt.ts
+++ b/ui/cypress/tests/thirdparty/Mqtt.spec.ts
@@ -16,10 +16,10 @@
  *
  */
 
-import { GenericAdapterBuilder } from '../../support/builder/AdapterBuilder';
 import { PipelineElementBuilder } from 
'../../support/builder/PipelineElementBuilder';
 import { ThirdPartyIntegrationUtils } from 
'../../support/utils/ThirdPartyIntegrationUtils';
 import { PipelineElementInput } from 
'../../support/model/PipelineElementInput';
+import { AdapterBuilder } from '../../support/builder/AdapterBuilder';
 import { ParameterUtils } from '../../support/utils/ParameterUtils';
 
 describe('Test MQTT Integration', () => {
@@ -29,22 +29,24 @@ describe('Test MQTT Integration', () => {
 
     it('Perform Test', () => {
         const topicName = 'cypresstopic';
-        const host: string = ParameterUtils.get('localhost', 'activemq');
+        const host: string = ParameterUtils.get('localhost', 'mosquitto');
+        const port: string = ParameterUtils.get('1884', '1883');
 
         const sink: PipelineElementInput = PipelineElementBuilder.create(
             'mqtt_publisher',
         )
             .addInput('input', 'host', host)
             .addInput('input', 'topic', topicName)
+            .addInput('input', 'port', port)
             .build();
 
-        const adapter = GenericAdapterBuilder.create('MQTT')
+        const adapter = AdapterBuilder.create('MQTT')
             .setName('Adapter Mqtt')
             .setTimestampProperty('timestamp')
-            .addProtocolInput('select', 'access-mode-unauthenticated', 'check')
-            .addProtocolInput('input', 'broker_url', 'tcp://' + host + ':1883')
+            .addProtocolInput('radio', 'access-mode-unauthenticated', '')
+            .addProtocolInput('input', 'broker_url', `tcp://${host}:${port}`)
             .addProtocolInput('input', 'topic', topicName)
-            .setFormat('json_object')
+            .setFormat('json')
             .build();
 
         ThirdPartyIntegrationUtils.runTest(sink, adapter);

Reply via email to