Browse Source
Merge pull request #16351 from smatvienko-tb/fix/flaky-asset-controller-edge-notifications
Fixed flaky AssetControllerTest edge notification count tests
pull/16363/head
Viacheslav Klimov
1 month ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
1 deletions
-
application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java
|
|
|
@ -360,8 +360,13 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest { |
|
|
|
} |
|
|
|
|
|
|
|
private void testSendNotificationMsgToEdgeServiceTimeEntityEqAny(TenantId tenantId, ActionType actionType, int cntTime) { |
|
|
|
// Count only entities that can be synced to edge. Background services may save non-edge entities for the
|
|
|
|
// tenant at any moment (e.g. QUEUE_STATS created by the periodic rule engine stats report), and their
|
|
|
|
// ADDED notifications have no edge event type, so they are dropped by TbClusterService anyway.
|
|
|
|
ArgumentMatcher<EntityId> matcherEdgeEntityId = argument -> argument != null |
|
|
|
&& EdgeUtils.getEdgeEventTypeByEntityType(argument.getEntityType()) != null; |
|
|
|
Mockito.verify(tbClusterService, times(cntTime)).sendNotificationMsgToEdge(Mockito.eq(tenantId), |
|
|
|
Mockito.any(), Mockito.any(EntityId.class), Mockito.any(), Mockito.isNull(), |
|
|
|
Mockito.any(), Mockito.argThat(matcherEdgeEntityId), Mockito.any(), Mockito.isNull(), |
|
|
|
Mockito.eq(EdgeUtils.getEdgeEventActionTypeByActionType(actionType)), Mockito.any()); |
|
|
|
} |
|
|
|
|
|
|
|
|