diff --git a/application/src/test/java/org/thingsboard/server/controller/CommunityGrantControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/CommunityGrantControllerTest.java index 8d34f8a7ba..d080c307dc 100644 --- a/application/src/test/java/org/thingsboard/server/controller/CommunityGrantControllerTest.java +++ b/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"); } } } diff --git a/common/data/src/test/java/org/thingsboard/server/common/data/audit/ActionTypeTest.java b/common/data/src/test/java/org/thingsboard/server/common/data/audit/ActionTypeTest.java index 6e33ce6bd1..13f955d295 100644 --- a/common/data/src/test/java/org/thingsboard/server/common/data/audit/ActionTypeTest.java +++ b/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 alarmActionTypes = EnumSet.of(