Browse Source

refactoring: tests User fix bug testFindSystemTbResources

pull/6913/head
nickAS21 4 years ago
parent
commit
c89a497348
  1. 2
      application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java
  2. 1
      application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java
  3. 5
      application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java

2
application/src/test/java/org/thingsboard/server/controller/AbstractNotifyEntityTest.java

@ -341,7 +341,7 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest {
}
private void testPushMsgToRuleEngineTime(ArgumentMatcher<EntityId> matcherOriginatorId, TenantId tenantId, HasName entity, int cntTime) {
tenantId = tenantId.isNullUid() ? ((HasTenantId) entity).getTenantId() : tenantId;
tenantId = tenantId.isNullUid() && ((HasTenantId) entity).getTenantId() != null ? ((HasTenantId) entity).getTenantId() : tenantId;
Mockito.verify(tbClusterService, times(cntTime)).pushMsgToRuleEngine(Mockito.eq(tenantId),
Mockito.argThat(matcherOriginatorId), Mockito.any(TbMsg.class), Mockito.isNull());
}

1
application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java

@ -1188,7 +1188,6 @@ public abstract class BaseDeviceControllerTest extends AbstractControllerTest {
Assert.assertEquals(0, pageData.getData().size());
}
protected void testNotificationUpdateGatewayOneTime(Device device, Device oldDevice) {
Mockito.verify(gatewayNotificationsService, times(1)).onDeviceUpdated(Mockito.eq(device), Mockito.eq(oldDevice));
}

5
application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java

@ -76,9 +76,10 @@ public abstract class BaseUserControllerTest extends AbstractControllerTest {
User foundUser = doGet("/api/user/" + savedUser.getId().getId().toString(), User.class);
Assert.assertEquals(foundUser, savedUser);
testNotifyEntityAllOneTime(savedUser, savedUser.getId(), savedUser.getId(),
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundUser, foundUser,
SYSTEM_TENANT, customerNUULId, null, SYS_ADMIN_EMAIL,
ActionType.ADDED);
ActionType.ADDED, ActionType.ADDED, 1, 1, 1);
Mockito.reset(tbClusterService, auditLogService);
logout();
doGet("/api/noauth/activate?activateToken={activateToken}", TestMailService.currentActivateToken)

Loading…
Cancel
Save