100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Moved test resources and bug fix for NotificationResourceImpl
Rich Turner1c9747607bce
diff --git a/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java b/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.javaindex e8dc49c9f..3858e6c9a 100644--- a/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java+++ b/manager/src/main/java/org/openremote/manager/notification/NotificationResourceImpl.java@@ -113,23 +113,11 @@ public class NotificationResourceImpl extends WebResource implements Notificatioheaders.put(Constants.AUTH_CONTEXT, getAuthContext());}- Object result = messageBrokerService.getProducerTemplate().requestBodyAndHeaders(- NotificationService.NOTIFICATION_QUEUE, notification, headers);-- if (result instanceof NotificationProcessingException) {- NotificationProcessingException processingException = (NotificationProcessingException) result;- switch (processingException.getReason()) {-- case INSUFFICIENT_ACCESS:- throw new WebApplicationException(processingException.getMessage(), FORBIDDEN);- case MISSING_SOURCE:- case MISSING_NOTIFICATION:- case MISSING_MESSAGE:- case MISSING_TARGETS:- throw new WebApplicationException(processingException.getMessage(), BAD_REQUEST);- case UNSUPPORTED_MESSAGE_TYPE:- throw new IllegalStateException(processingException);- }+ boolean success = messageBrokerService.getProducerTemplate().requestBodyAndHeaders(+ NotificationService.NOTIFICATION_QUEUE, notification, headers, Boolean.class);++ if (!success) {+ throw new WebApplicationException(BAD_REQUEST);}}diff --git a/model/src/main/java/org/openremote/model/security/User.java b/model/src/main/java/org/openremote/model/security/User.javaindex 3bc0c3acb..204be06d0 100644--- a/model/src/main/java/org/openremote/model/security/User.java+++ b/model/src/main/java/org/openremote/model/security/User.java@@ -35,9 +35,10 @@ import javax.ws.rs.core.MultivaluedHashMap;import javax.ws.rs.core.MultivaluedMap;import java.lang.reflect.Field;import java.time.Instant;-import java.util.*;--import static org.openremote.model.Constants.PERSISTENCE_JSON_VALUE_TYPE;+import java.util.ArrayList;+import java.util.Arrays;+import java.util.List;+import java.util.Map;/*** This can be used (among other things) to query the USER_ENTITY table in JPA queries.@@ -87,13 +88,6 @@ public class User {@JsonIgnoreprotected List<UserAttribute> attributes;- public User(String id, String username, String firstName, String lastName) {- this.id = id;- this.username = username;- this.firstName = firstName;- this.lastName = lastName;- }-public User() {}diff --git a/test/src/main/resources/META-INF/services/org.openremote.manager.setup.SetupTasks b/test/src/test/resources/META-INF/services/org.openremote.manager.setup.SetupTaskssimilarity index 100%rename from test/src/main/resources/META-INF/services/org.openremote.manager.setup.SetupTasksrename to test/src/test/resources/META-INF/services/org.openremote.manager.setup.SetupTasksdiff --git a/test/src/main/resources/META-INF/services/org.openremote.model.AssetModelProvider b/test/src/test/resources/META-INF/services/org.openremote.model.AssetModelProvidersimilarity index 100%rename from test/src/main/resources/META-INF/services/org.openremote.model.AssetModelProviderrename to test/src/test/resources/META-INF/services/org.openremote.model.AssetModelProviderdiff --git a/test/src/main/resources/org/openremote/test/failure/RulesFailureActionThrowsException.groovy b/test/src/test/resources/org/openremote/test/failure/RulesFailureActionThrowsException.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/failure/RulesFailureActionThrowsException.groovyrename to test/src/test/resources/org/openremote/test/failure/RulesFailureActionThrowsException.groovydiff --git a/test/src/main/resources/org/openremote/test/failure/RulesFailureConditionInvalidReturn.groovy b/test/src/test/resources/org/openremote/test/failure/RulesFailureConditionInvalidReturn.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/failure/RulesFailureConditionInvalidReturn.groovyrename to test/src/test/resources/org/openremote/test/failure/RulesFailureConditionInvalidReturn.groovydiff --git a/test/src/main/resources/org/openremote/test/failure/RulesFailureConditionThrowsException.groovy b/test/src/test/resources/org/openremote/test/failure/RulesFailureConditionThrowsException.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/failure/RulesFailureConditionThrowsException.groovyrename to test/src/test/resources/org/openremote/test/failure/RulesFailureConditionThrowsException.groovydiff --git a/test/src/main/resources/org/openremote/test/failure/RulesFailureLoop.groovy b/test/src/test/resources/org/openremote/test/failure/RulesFailureLoop.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/failure/RulesFailureLoop.groovyrename to test/src/test/resources/org/openremote/test/failure/RulesFailureLoop.groovydiff --git a/test/src/main/resources/org/openremote/test/protocol/knx/knx-import-testproject.knxproj b/test/src/test/resources/org/openremote/test/protocol/knx/knx-import-testproject.knxprojsimilarity index 100%rename from test/src/main/resources/org/openremote/test/protocol/knx/knx-import-testproject.knxprojrename to test/src/test/resources/org/openremote/test/protocol/knx/knx-import-testproject.knxprojdiff --git a/test/src/main/resources/org/openremote/test/protocol/knx/knx-server-config-mac.xml b/test/src/test/resources/org/openremote/test/protocol/knx/knx-server-config-mac.xmlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/protocol/knx/knx-server-config-mac.xmlrename to test/src/test/resources/org/openremote/test/protocol/knx/knx-server-config-mac.xmldiff --git a/test/src/main/resources/org/openremote/test/protocol/knx/knx-server-config.xml b/test/src/test/resources/org/openremote/test/protocol/knx/knx-server-config.xmlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/protocol/knx/knx-server-config.xmlrename to test/src/test/resources/org/openremote/test/protocol/knx/knx-server-config.xmldiff --git a/test/src/main/resources/org/openremote/test/protocol/velbus/VelbusProject.vlp b/test/src/test/resources/org/openremote/test/protocol/velbus/VelbusProject.vlpsimilarity index 100%rename from test/src/main/resources/org/openremote/test/protocol/velbus/VelbusProject.vlprename to test/src/test/resources/org/openremote/test/protocol/velbus/VelbusProject.vlpdiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca.key b/test/src/test/resources/org/openremote/test/provisioning/ca.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca.keyrename to test/src/test/resources/org/openremote/test/provisioning/ca.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_expired.pem b/test/src/test/resources/org/openremote/test/provisioning/ca_expired.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_expired.pemrename to test/src/test/resources/org/openremote/test/provisioning/ca_expired.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_expired.srl b/test/src/test/resources/org/openremote/test/provisioning/ca_expired.srlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_expired.srlrename to test/src/test/resources/org/openremote/test/provisioning/ca_expired.srldiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_forged.key b/test/src/test/resources/org/openremote/test/provisioning/ca_forged.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_forged.keyrename to test/src/test/resources/org/openremote/test/provisioning/ca_forged.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_forged.pem b/test/src/test/resources/org/openremote/test/provisioning/ca_forged.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_forged.pemrename to test/src/test/resources/org/openremote/test/provisioning/ca_forged.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_forged.srl b/test/src/test/resources/org/openremote/test/provisioning/ca_forged.srlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_forged.srlrename to test/src/test/resources/org/openremote/test/provisioning/ca_forged.srldiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_long.pem b/test/src/test/resources/org/openremote/test/provisioning/ca_long.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_long.pemrename to test/src/test/resources/org/openremote/test/provisioning/ca_long.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/ca_long.srl b/test/src/test/resources/org/openremote/test/provisioning/ca_long.srlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/ca_long.srlrename to test/src/test/resources/org/openremote/test/provisioning/ca_long.srldiff --git a/test/src/main/resources/org/openremote/test/provisioning/device1.csr b/test/src/test/resources/org/openremote/test/provisioning/device1.csrsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device1.csrrename to test/src/test/resources/org/openremote/test/provisioning/device1.csrdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device1.key b/test/src/test/resources/org/openremote/test/provisioning/device1.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device1.keyrename to test/src/test/resources/org/openremote/test/provisioning/device1.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/device1.pem b/test/src/test/resources/org/openremote/test/provisioning/device1.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device1.pemrename to test/src/test/resources/org/openremote/test/provisioning/device1.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device2.csr b/test/src/test/resources/org/openremote/test/provisioning/device2.csrsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device2.csrrename to test/src/test/resources/org/openremote/test/provisioning/device2.csrdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device2.key b/test/src/test/resources/org/openremote/test/provisioning/device2.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device2.keyrename to test/src/test/resources/org/openremote/test/provisioning/device2.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/device2_expired.pem b/test/src/test/resources/org/openremote/test/provisioning/device2_expired.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device2_expired.pemrename to test/src/test/resources/org/openremote/test/provisioning/device2_expired.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device3.csr b/test/src/test/resources/org/openremote/test/provisioning/device3.csrsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device3.csrrename to test/src/test/resources/org/openremote/test/provisioning/device3.csrdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device3.key b/test/src/test/resources/org/openremote/test/provisioning/device3.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device3.keyrename to test/src/test/resources/org/openremote/test/provisioning/device3.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/device3_caexpired.pem b/test/src/test/resources/org/openremote/test/provisioning/device3_caexpired.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device3_caexpired.pemrename to test/src/test/resources/org/openremote/test/provisioning/device3_caexpired.pemdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device4.csr b/test/src/test/resources/org/openremote/test/provisioning/device4.csrsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device4.csrrename to test/src/test/resources/org/openremote/test/provisioning/device4.csrdiff --git a/test/src/main/resources/org/openremote/test/provisioning/device4.key b/test/src/test/resources/org/openremote/test/provisioning/device4.keysimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device4.keyrename to test/src/test/resources/org/openremote/test/provisioning/device4.keydiff --git a/test/src/main/resources/org/openremote/test/provisioning/device4_forged.pem b/test/src/test/resources/org/openremote/test/provisioning/device4_forged.pemsimilarity index 100%rename from test/src/main/resources/org/openremote/test/provisioning/device4_forged.pemrename to test/src/test/resources/org/openremote/test/provisioning/device4_forged.pemdiff --git a/test/src/main/resources/org/openremote/test/rules/BasicBrokenRules.groovy b/test/src/test/resources/org/openremote/test/rules/BasicBrokenRules.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicBrokenRules.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicBrokenRules.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicFlowRules.json b/test/src/test/resources/org/openremote/test/rules/BasicFlowRules.jsonsimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicFlowRules.jsonrename to test/src/test/resources/org/openremote/test/rules/BasicFlowRules.jsondiff --git a/test/src/main/resources/org/openremote/test/rules/BasicJsonRules.json b/test/src/test/resources/org/openremote/test/rules/BasicJsonRules.jsonsimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicJsonRules.jsonrename to test/src/test/resources/org/openremote/test/rules/BasicJsonRules.jsondiff --git a/test/src/main/resources/org/openremote/test/rules/BasicLocationPredicates.groovy b/test/src/test/resources/org/openremote/test/rules/BasicLocationPredicates.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicLocationPredicates.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicLocationPredicates.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicLocationPredicates2.groovy b/test/src/test/resources/org/openremote/test/rules/BasicLocationPredicates2.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicLocationPredicates2.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicLocationPredicates2.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicMatchAllAssetStates.groovy b/test/src/test/resources/org/openremote/test/rules/BasicMatchAllAssetStates.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicMatchAllAssetStates.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicMatchAllAssetStates.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicMatchAllAssetStates2.groovy b/test/src/test/resources/org/openremote/test/rules/BasicMatchAllAssetStates2.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicMatchAllAssetStates2.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicMatchAllAssetStates2.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicSmartHomeMatchAllAssetStates.groovy b/test/src/test/resources/org/openremote/test/rules/BasicSmartHomeMatchAllAssetStates.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicSmartHomeMatchAllAssetStates.groovyrename to test/src/test/resources/org/openremote/test/rules/BasicSmartHomeMatchAllAssetStates.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/BasicTimedExecutionRules.drl b/test/src/test/resources/org/openremote/test/rules/BasicTimedExecutionRules.drlsimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/BasicTimedExecutionRules.drlrename to test/src/test/resources/org/openremote/test/rules/BasicTimedExecutionRules.drldiff --git a/test/src/main/resources/org/openremote/test/rules/ConsoleLocation.groovy b/test/src/test/resources/org/openremote/test/rules/ConsoleLocation.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ConsoleLocation.groovyrename to test/src/test/resources/org/openremote/test/rules/ConsoleLocation.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/Geofence.json b/test/src/test/resources/org/openremote/test/rules/Geofence.jsonsimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/Geofence.jsonrename to test/src/test/resources/org/openremote/test/rules/Geofence.jsondiff --git a/test/src/main/resources/org/openremote/test/rules/ResidenceAllLightsOff.js b/test/src/test/resources/org/openremote/test/rules/ResidenceAllLightsOff.jssimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidenceAllLightsOff.jsrename to test/src/test/resources/org/openremote/test/rules/ResidenceAllLightsOff.jsdiff --git a/test/src/main/resources/org/openremote/test/rules/ResidenceAutoVentilation.groovy b/test/src/test/resources/org/openremote/test/rules/ResidenceAutoVentilation.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidenceAutoVentilation.groovyrename to test/src/test/resources/org/openremote/test/rules/ResidenceAutoVentilation.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/ResidenceNotifyAlarmTrigger.groovy b/test/src/test/resources/org/openremote/test/rules/ResidenceNotifyAlarmTrigger.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidenceNotifyAlarmTrigger.groovyrename to test/src/test/resources/org/openremote/test/rules/ResidenceNotifyAlarmTrigger.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/ResidencePresenceDetection.groovy b/test/src/test/resources/org/openremote/test/rules/ResidencePresenceDetection.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidencePresenceDetection.groovyrename to test/src/test/resources/org/openremote/test/rules/ResidencePresenceDetection.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/ResidenceSmartSwitch.groovy b/test/src/test/resources/org/openremote/test/rules/ResidenceSmartSwitch.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidenceSmartSwitch.groovyrename to test/src/test/resources/org/openremote/test/rules/ResidenceSmartSwitch.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/ResidenceVacationMode.groovy b/test/src/test/resources/org/openremote/test/rules/ResidenceVacationMode.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/ResidenceVacationMode.groovyrename to test/src/test/resources/org/openremote/test/rules/ResidenceVacationMode.groovydiff --git a/test/src/main/resources/org/openremote/test/rules/SmartCityCamera.groovy b/test/src/test/resources/org/openremote/test/rules/SmartCityCamera.groovysimilarity index 100%rename from test/src/main/resources/org/openremote/test/rules/SmartCityCamera.groovyrename to test/src/test/resources/org/openremote/test/rules/SmartCityCamera.groovy