You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2020/05/15 14:51:45 UTC

[plc4x] 02/02: - Applied a fix for some tests.

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

cdutz pushed a commit to branch rel/0.7
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit d00e452bc573eec9cc213df413b3950d438ed150
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri May 15 16:51:29 2020 +0200

    - Applied a fix for some tests.
---
 .../test/java/org/apache/plc4x/camel/Plc4XComponentTest.java |  4 ++--
 .../test/java/org/apache/plc4x/camel/Plc4XProducerTest.java  | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
index 7d8f78d..db521b6 100644
--- a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
+++ b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XComponentTest.java
@@ -51,11 +51,11 @@ public class Plc4XComponentTest extends CamelTestSupport {
                 Plc4XEndpoint producer = getContext().getEndpoint("plc4x:mock:10.10.10.1/1/1", Plc4XEndpoint.class);
                 producer.setTags(tags);
                 from("direct:plc4x")
-                    .setBody(constant(Arrays.asList(new TagData("test","testAddress",false))))
+                    .setBody(constant(Collections.singletonMap("test",Collections.singletonMap("testAddress",false))))
                     .to("plc4x:mock:10.10.10.1/1/1")
                     .to("mock:result");
                 from("direct:plc4x2")
-                    .setBody(constant(Arrays.asList(new TagData("test2","testAddress2",0x05))))
+                    .setBody(constant(Collections.singletonMap("test2",Collections.singletonMap("testAddress2",0x05))))
                     .to("plc4x:mock:10.10.10.1/1/1")
                     .to("mock:result");
                 from(producer)
diff --git a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
index a205b10..e8db835 100644
--- a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
+++ b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/Plc4XProducerTest.java
@@ -27,6 +27,9 @@ import org.junit.jupiter.api.Test;
 
 import java.lang.reflect.Field;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import static org.mockito.Mockito.*;
@@ -51,11 +54,12 @@ public class Plc4XProducerTest {
         when(endpointMock.getConnection()).thenReturn(mockConnection);
         SUT = new Plc4XProducer(endpointMock);
         testExchange = mock(Exchange.class, RETURNS_DEEP_STUBS);
-
+        Map<String, Map<String,Object>> tags = new HashMap();
+        tags.put("test1", Collections.singletonMap("testAddress1",0));
+        tags.put("test1", Collections.singletonMap("testAddress2",true));
+        tags.put("test1", Collections.singletonMap("testAddress3","TestString"));
         when(testExchange.getIn().getBody())
-            .thenReturn(Arrays.asList(new TagData("testName","testAddress",0),
-                new TagData("testName2","testAddress2",true),
-                new TagData("testName3","testAddress3","testVal")));
+            .thenReturn(tags);
     }
 
     @Test