Browse Source

Merge remote-tracking branch 'origin/lts-4.3' into internal-hotfix-4.3

pull/16863/head
Viacheslav Klimov 2 weeks ago
parent
commit
fb67bc3d3b
Failed to extract signature
  1. 4
      application/src/test/java/org/thingsboard/server/controller/CommunityGrantControllerTest.java
  2. 8
      common/data/src/test/java/org/thingsboard/server/common/data/audit/ActionTypeTest.java

4
application/src/test/java/org/thingsboard/server/controller/CommunityGrantControllerTest.java

@ -326,17 +326,21 @@ public class CommunityGrantControllerTest extends AbstractControllerTest {
Mockito.doReturn(new CommunityGrantPortalStatus("AWAITING_SIGNUP", null, null),
new CommunityGrantPortalStatus("DONE", null, null))
.when(portalClient).getStatus(any(), any());
Mockito.doReturn("license-secret").when(portalClient).claimLicense(any());
doPost("/api/communityGrant/start").andExpect(status().isOk());
await("the poller reaching a terminal state").atMost(30, TimeUnit.SECONDS)
.until(() -> flowStateStore.get().getState() == CommunityGrantState.REGISTERED);
assertThat(jdbcTemplate.queryForObject("SELECT license_claim_token FROM tb_cluster", String.class)).isNull();
assertThat(jdbcTemplate.queryForObject("SELECT license_secret FROM tb_cluster", String.class)).isEqualTo("license-secret");
} finally {
poller.disarm();
flowStateStore.update(state -> CommunityGrantFlowState.initial());
if (seededClusterId) {
jdbcTemplate.update("DELETE FROM tb_cluster");
} else {
jdbcTemplate.update("UPDATE tb_cluster SET license_secret = NULL");
}
}
}

8
common/data/src/test/java/org/thingsboard/server/common/data/audit/ActionTypeTest.java

@ -15,6 +15,9 @@ import static org.thingsboard.server.common.data.audit.ActionType.ALARM_CLEAR;
import static org.thingsboard.server.common.data.audit.ActionType.ALARM_DELETE;
import static org.thingsboard.server.common.data.audit.ActionType.ALARM_UNASSIGNED;
import static org.thingsboard.server.common.data.audit.ActionType.ATTRIBUTES_READ;
import static org.thingsboard.server.common.data.audit.ActionType.COMMUNITY_GRANT_ENROLLMENT;
import static org.thingsboard.server.common.data.audit.ActionType.COMMUNITY_GRANT_OFFLINE_CHECKER_RUN;
import static org.thingsboard.server.common.data.audit.ActionType.COMMUNITY_GRANT_REQUEST_ACCESS;
import static org.thingsboard.server.common.data.audit.ActionType.CREDENTIALS_READ;
import static org.thingsboard.server.common.data.audit.ActionType.CREDENTIALS_UPDATED;
import static org.thingsboard.server.common.data.audit.ActionType.DELETED_COMMENT;
@ -40,7 +43,10 @@ class ActionTypeTest {
LOCKOUT,
DELETED_COMMENT,
SMS_SENT,
REST_API_RULE_ENGINE_CALL
REST_API_RULE_ENGINE_CALL,
COMMUNITY_GRANT_OFFLINE_CHECKER_RUN,
COMMUNITY_GRANT_REQUEST_ACCESS,
COMMUNITY_GRANT_ENROLLMENT
);
private final Set<ActionType> alarmActionTypes = EnumSet.of(

Loading…
Cancel
Save