protected int sendSms(String numberTo, String message) throws ThingsboardException {
        if (this.smsSender == null) {
            throw new ThingsboardException("Unable to send SMS: no SMS provider configured!", ThingsboardErrorCode.GENERAL);
        }
        return this.sendSms(this.smsSender, numberTo, message);
    }
@Test
    public void testLimitSmsMessagingIfSmsDisabled() throws Exception {
        tenantProfile = getDefaultTenantProfile();

        DefaultTenantProfileConfiguration config = createTenantProfileConfigurationWithSmsLimits(0, false);
        saveTenantProfileWitConfiguration(tenantProfile, config);

        TimeUnit.SECONDS.sleep(1);
        assertThrows(RuntimeException.class, () -> {
            defaultSmsService.sendSms(tenantId, null, new String[]{RandomStringUtils.randomNumeric(10)}, "Message");
        }, "SMS sending is disabled due to API limits!");

        //enable sms messaging
        DefaultTenantProfileConfiguration config2 = createTenantProfileConfigurationWithSmsLimits(0, true);
        saveTenantProfileWitConfiguration(tenantProfile, config2);
        TimeUnit.SECONDS.sleep(1);

        for (int i = 0; i < 10; i++) {
            doReturn(1).when(defaultSmsService).sendSms(any(), any());
            defaultSmsService.sendSms(tenantId, null, new String[]{RandomStringUtils.randomNumeric(10)}, "Message");
        }
    }