diff --git a/application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java b/application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java index 62a266f26a..a4996da4e2 100644 --- a/application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java @@ -311,15 +311,21 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest { protected void testNotifyEntityIsNullOneTimeEdgeServiceNeverError(HasName entity, TenantId tenantId, UserId userId, String userName, ActionType actionType, Exception exp, Object... additionalInfo) { + testNotifyEntityIsNullOneTimeEdgeServiceNeverError(entity, null, tenantId, userId, userName, actionType, exp, additionalInfo); + } + + protected void testNotifyEntityIsNullOneTimeEdgeServiceNeverError(HasName entity, EntityId originatorId, TenantId tenantId, + UserId userId, String userName, ActionType actionType, Exception exp, + Object... additionalInfo) { CustomerId customer_NULL_UUID = (CustomerId) EntityIdFactory.getByTypeAndUuid(EntityType.CUSTOMER, ModelConstants.NULL_UUID); - EntityId entity_originator_NULL_UUID = createEntityId_NULL_UUID(entity); - testNotificationMsgToEdgeServiceNeverWithActionType(entity_originator_NULL_UUID, actionType); + EntityId entity_originator = originatorId != null ? originatorId : createEntityId_NULL_UUID(entity); + testNotificationMsgToEdgeServiceNeverWithActionType(entity_originator, actionType); ArgumentMatcher matcherEntityIsNull = Objects::isNull; ArgumentMatcher matcherError = argument -> argument.getMessage().contains(exp.getMessage()) & argument.getClass().equals(exp.getClass()); - testLogEntityActionErrorAdditionalInfo(matcherEntityIsNull, entity_originator_NULL_UUID, tenantId, customer_NULL_UUID, + testLogEntityActionErrorAdditionalInfo(matcherEntityIsNull, entity_originator, tenantId, customer_NULL_UUID, userId, userName, actionType, 1, matcherError, extractMatcherAdditionalInfo(additionalInfo)); - testPushMsgToRuleEngineNever(entity_originator_NULL_UUID); + testPushMsgToRuleEngineNever(entity_originator); } protected void testNotifyEntityNever(EntityId entityId, HasName entity) { diff --git a/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java index 98b06ebbd1..8409caecab 100644 --- a/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java @@ -407,7 +407,7 @@ public class AssetControllerTest extends AbstractControllerTest { .andExpect(status().isBadRequest()) .andExpect(statusReason(containsString(msgError))); - testNotifyEntityIsNullOneTimeEdgeServiceNeverError(savedAsset1, savedTenant.getId(), tenantAdmin.getId(), tenantAdmin.getEmail(), + testNotifyEntityIsNullOneTimeEdgeServiceNeverError(savedAsset1, savedAsset1.getId(), savedTenant.getId(), tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.DELETED, new DataValidationException(msgError), savedAsset1.getId().getId().toString()); savedView.setEntityId(savedAsset2.getId());