Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Updated notification template for JSON rules

Rich Turner127f66a0fc54
diff --git a/manager/src/main/java/org/openremote/manager/rules/JsonRulesBuilder.java b/manager/src/main/java/org/openremote/manager/rules/JsonRulesBuilder.java
index 81617bdca..ac78f816d 100644
--- a/manager/src/main/java/org/openremote/manager/rules/JsonRulesBuilder.java
+++ b/manager/src/main/java/org/openremote/manager/rules/JsonRulesBuilder.java
@@ -878,7 +878,7 @@ public class JsonRulesBuilder extends RulesBuilder {
StringBuilder sb = new StringBuilder();
if (isHtml) {
- sb.append("<table>");
+ sb.append("<table cellpadding=\"30\">");
sb.append("<tr><th>Asset ID</th><th>Asset Name</th><th>Attribute</th><th>Value</th></tr>");
assetStates.forEach(assetState -> {
sb.append("<tr><td>");
@@ -893,14 +893,14 @@ public class JsonRulesBuilder extends RulesBuilder {
});
sb.append("</table>");
} else {
- sb.append("Asset ID\tAsset Name\tAttribute\tValue");
+ sb.append("Asset ID\t\tAsset Name\t\tAttribute\t\tValue");
assetStates.forEach(assetState -> {
sb.append(assetState.getId());
- sb.append("\t");
+ sb.append("\t\t");
sb.append(assetState.getName());
- sb.append("\t");
+ sb.append("\t\t");
sb.append(assetState.getAttributeName());
- sb.append("\t");
+ sb.append("\t\t");
sb.append(assetState.getValue().map(Value::toString).orElse(""));
});
}
diff --git a/test/src/test/groovy/org/openremote/test/protocol/velbus/VelbusBasicTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/velbus/VelbusBasicTest.groovy
index 061a67baf..adc91af6c 100644
--- a/test/src/test/groovy/org/openremote/test/protocol/velbus/VelbusBasicTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/protocol/velbus/VelbusBasicTest.groovy
@@ -47,7 +47,7 @@ class VelbusBasicTest extends Specification implements ManagerContainerTrait {
def static MockVelbusClient messageProcessor = new MockVelbusClient()
@Shared
- def static PollingConditions conditions = new PollingConditions(timeout: 10)
+ def static PollingConditions conditions = new PollingConditions(timeout: 15)
static loadDevicePackets(MockVelbusClient messageProcessor) {
messageProcessor.mockPackets = [
diff --git a/test/src/test/groovy/org/openremote/test/rules/residence/JsonRulesTest.groovy b/test/src/test/groovy/org/openremote/test/rules/residence/JsonRulesTest.groovy
index 8d3052f92..0ff31bd3e 100644
--- a/test/src/test/groovy/org/openremote/test/rules/residence/JsonRulesTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/rules/residence/JsonRulesTest.groovy
@@ -89,7 +89,7 @@ class JsonRulesTest extends Specification implements ManagerContainerTrait {
}
and: "the container environment is started with the mock handler"
- def conditions = new PollingConditions(timeout: 10, delay: 1)
+ def conditions = new PollingConditions(timeout: 15, delay: 1)
def serverPort = findEphemeralPort()
def services = Lists.newArrayList(defaultServices())
services.removeIf {it instanceof PushNotificationHandler}
@@ -226,7 +226,7 @@ class JsonRulesTest extends Specification implements ManagerContainerTrait {
assert emailMessages.size() == 1
assert emailMessages[0].recipients.size() == 1
assert emailMessages[0].recipients[0].address == "[email protected]"
- assert emailMessages[0].HTMLText == "<table><tr><th>Asset ID</th><th>Asset Name</th><th>Attribute</th><th>Value</th></tr><tr><td>${consoleRegistration.id}</td><td>Test Console</td><td>location</td><td>{\"type\":\"Point\",\"coordinates\":[0,0]}</td></tr></table>"
+ assert emailMessages[0].HTMLText == "<table cellpadding=\"30\"><tr><th>Asset ID</th><th>Asset Name</th><th>Attribute</th><th>Value</th></tr><tr><td>${consoleRegistration.id}</td><td>Test Console</td><td>location</td><td>{\"type\":\"Point\",\"coordinates\":[0,0]}</td></tr></table>"
}
and: "after a few seconds the rule should not have fired again"