diff --git a/application/pom.xml b/application/pom.xml index 3093dcfb57..c920709ae4 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard application diff --git a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java index 23331d95f4..737e6d54d5 100644 --- a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java +++ b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java @@ -117,7 +117,7 @@ public class WidgetsBundleController extends BaseController { checkParameter("widgetsBundleId", strWidgetsBundleId); WidgetsBundleId widgetsBundleId = new WidgetsBundleId(toUUID(strWidgetsBundleId)); WidgetsBundle widgetsBundle = checkWidgetsBundleId(widgetsBundleId, Operation.DELETE); - tbWidgetsBundleService.delete(widgetsBundle); + tbWidgetsBundleService.delete(widgetsBundle, getCurrentUser()); } @ApiOperation(value = "Get Widget Bundles (getWidgetsBundles)", diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/DefaultWidgetsBundleService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/DefaultWidgetsBundleService.java index ffd667bfec..7cc150b746 100644 --- a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/DefaultWidgetsBundleService.java +++ b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/DefaultWidgetsBundleService.java @@ -17,9 +17,10 @@ package org.thingsboard.server.service.entitiy.widgets.bundle; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; +import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.User; -import org.thingsboard.server.common.data.edge.EdgeEventActionType; -import org.thingsboard.server.common.data.exception.ThingsboardException; +import org.thingsboard.server.common.data.audit.ActionType; +import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.widget.WidgetsBundleService; import org.thingsboard.server.queue.util.TbCoreComponent; @@ -34,17 +35,31 @@ public class DefaultWidgetsBundleService extends AbstractTbEntityService impleme @Override public WidgetsBundle save(WidgetsBundle widgetsBundle, User user) throws Exception { - WidgetsBundle savedWidgetsBundle = checkNotNull(widgetsBundleService.saveWidgetsBundle(widgetsBundle)); - autoCommit(user, savedWidgetsBundle.getId()); - notificationEntityService.notifySendMsgToEdgeService(widgetsBundle.getTenantId(), savedWidgetsBundle.getId(), - widgetsBundle.getId() == null ? EdgeEventActionType.ADDED : EdgeEventActionType.UPDATED); - return savedWidgetsBundle; + ActionType actionType = widgetsBundle.getId() == null ? ActionType.ADDED : ActionType.UPDATED; + TenantId tenantId = widgetsBundle.getTenantId(); + try { + WidgetsBundle savedWidgetsBundle = checkNotNull(widgetsBundleService.saveWidgetsBundle(widgetsBundle)); + autoCommit(user, savedWidgetsBundle.getId()); + notificationEntityService.notifyCreateOrUpdateOrDelete(tenantId, null, savedWidgetsBundle.getId(), + savedWidgetsBundle, user, actionType, true, null); + return savedWidgetsBundle; + } catch (Exception e) { + notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.WIDGETS_BUNDLE), widgetsBundle, actionType, user, e); + throw e; + } } @Override - public void delete(WidgetsBundle widgetsBundle) throws ThingsboardException { - widgetsBundleService.deleteWidgetsBundle(widgetsBundle.getTenantId(), widgetsBundle.getId()); - notificationEntityService.notifySendMsgToEdgeService(widgetsBundle.getTenantId(), widgetsBundle.getId(), - EdgeEventActionType.DELETED); + public void delete(WidgetsBundle widgetsBundle, User user) { + TenantId tenantId = widgetsBundle.getTenantId(); + try { + widgetsBundleService.deleteWidgetsBundle(widgetsBundle.getTenantId(), widgetsBundle.getId()); + notificationEntityService.notifyCreateOrUpdateOrDelete(tenantId, null, widgetsBundle.getId(), widgetsBundle, + user, ActionType.DELETED, true, null); + } catch (Exception e) { + notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.WIDGETS_BUNDLE), + ActionType.DELETED, user, e, widgetsBundle.getId()); + throw e; + } } } diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/TbWidgetsBundleService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/TbWidgetsBundleService.java index 446010b61c..d60bc66d66 100644 --- a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/TbWidgetsBundleService.java +++ b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/bundle/TbWidgetsBundleService.java @@ -15,13 +15,8 @@ */ package org.thingsboard.server.service.entitiy.widgets.bundle; -import org.thingsboard.server.common.data.User; -import org.thingsboard.server.common.data.exception.ThingsboardException; import org.thingsboard.server.common.data.widget.WidgetsBundle; +import org.thingsboard.server.service.entitiy.SimpleTbEntityService; -public interface TbWidgetsBundleService { - - WidgetsBundle save(WidgetsBundle entity, User currentUser) throws Exception; - - void delete(WidgetsBundle entity) throws ThingsboardException; +public interface TbWidgetsBundleService extends SimpleTbEntityService { } diff --git a/application/src/main/java/org/thingsboard/server/service/notification/rule/trigger/DeviceActivityTriggerProcessor.java b/application/src/main/java/org/thingsboard/server/service/notification/rule/trigger/DeviceActivityTriggerProcessor.java index 5dee2b69b0..6e181044c7 100644 --- a/application/src/main/java/org/thingsboard/server/service/notification/rule/trigger/DeviceActivityTriggerProcessor.java +++ b/application/src/main/java/org/thingsboard/server/service/notification/rule/trigger/DeviceActivityTriggerProcessor.java @@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils; import org.springframework.stereotype.Service; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.DeviceProfile; +import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.notification.info.DeviceActivityNotificationInfo; @@ -41,6 +42,9 @@ public class DeviceActivityTriggerProcessor implements RuleEngineMsgNotification @Override public boolean matchesFilter(RuleEngineMsgTrigger trigger, DeviceActivityNotificationRuleTriggerConfig triggerConfig) { + if (trigger.getMsg().getOriginator().getEntityType() != EntityType.DEVICE) { + return false; + } DeviceEvent event = trigger.getMsg().getType().equals(DataConstants.ACTIVITY_EVENT) ? DeviceEvent.ACTIVE : DeviceEvent.INACTIVE; if (!triggerConfig.getNotifyOn().contains(event)) { return false; diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index cc2b075cf1..16fc305ed2 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -607,6 +607,7 @@ spring: username: "${SPRING_DATASOURCE_USERNAME:postgres}" password: "${SPRING_DATASOURCE_PASSWORD:postgres}" hikari: + leakDetectionThreshold: "${SPRING_DATASOURCE_HIKARI_LEAK_DETECTION_THRESHOLD:0}" maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:16}" registerMbeans: "${SPRING_DATASOURCE_HIKARI_REGISTER_MBEANS:false}" # true - enable MBean to diagnose pools state via JMX @@ -621,6 +622,7 @@ audit-log: "device": "${AUDIT_LOG_MASK_DEVICE:W}" "asset": "${AUDIT_LOG_MASK_ASSET:W}" "dashboard": "${AUDIT_LOG_MASK_DASHBOARD:W}" + "widgets_bundle": "${AUDIT_LOG_MASK_WIDGETS_BUNDLE:W}" "customer": "${AUDIT_LOG_MASK_CUSTOMER:W}" "user": "${AUDIT_LOG_MASK_USER:W}" "rule_chain": "${AUDIT_LOG_MASK_RULE_CHAIN:W}" diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AdminControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AdminControllerTest.java index e6c27aa4a8..dd15c60168 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AdminControllerTest.java @@ -24,6 +24,7 @@ import org.mockito.Mockito; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.AdminSettings; import org.thingsboard.server.common.data.security.model.JwtSettings; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.nio.charset.StandardCharsets; import java.util.Base64; @@ -39,7 +40,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -public abstract class BaseAdminControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class AdminControllerTest extends AbstractControllerTest { final JwtSettings defaultJwtSettings = new JwtSettings(9000, 604800, "thingsboard.io", "thingsboardDefaultSigningKey"); @Test diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAlarmCommentControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AlarmCommentControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseAlarmCommentControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AlarmCommentControllerTest.java index 98446b025d..287ae7cfe1 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAlarmCommentControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AlarmCommentControllerTest.java @@ -40,6 +40,7 @@ import org.thingsboard.server.common.data.audit.ActionType; import org.thingsboard.server.common.data.id.AlarmId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.dao.alarm.AlarmDao; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.LinkedList; import java.util.List; @@ -48,8 +49,9 @@ import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -@ContextConfiguration(classes = {BaseAlarmCommentControllerTest.Config.class}) -public abstract class BaseAlarmCommentControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {AlarmCommentControllerTest.Config.class}) +@DaoSqlTest +public class AlarmCommentControllerTest extends AbstractControllerTest { protected Device customerDevice; protected Alarm alarm; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAlarmControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AlarmControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseAlarmControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AlarmControllerTest.java index 930c4881f9..05030f0091 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAlarmControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AlarmControllerTest.java @@ -40,6 +40,7 @@ import org.thingsboard.server.common.data.audit.ActionType; import org.thingsboard.server.common.data.id.AlarmId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.dao.alarm.AlarmDao; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.LinkedList; import java.util.List; @@ -48,8 +49,9 @@ import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -@ContextConfiguration(classes = {BaseAlarmControllerTest.Config.class}) -public abstract class BaseAlarmControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {AlarmControllerTest.Config.class}) +@DaoSqlTest +public class AlarmControllerTest extends AbstractControllerTest { public static final String TEST_ALARM_TYPE = "Test"; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java index 545cc0522d..40b1707271 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AssetControllerTest.java @@ -46,6 +46,7 @@ import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.asset.AssetDao; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.service.stats.DefaultRuleEngineStatisticsService; import java.util.ArrayList; @@ -56,8 +57,9 @@ import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; -@ContextConfiguration(classes = {BaseAssetControllerTest.Config.class}) -public abstract class BaseAssetControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {AssetControllerTest.Config.class}) +@DaoSqlTest +public class AssetControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAssetProfileControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AssetProfileControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseAssetProfileControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AssetProfileControllerTest.java index 2f7c51c3a2..c84b058cc7 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAssetProfileControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AssetProfileControllerTest.java @@ -42,6 +42,7 @@ import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.asset.AssetProfileDao; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -51,8 +52,9 @@ import java.util.stream.Collectors; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@ContextConfiguration(classes = {BaseAssetProfileControllerTest.Config.class}) -public abstract class BaseAssetProfileControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {AssetProfileControllerTest.Config.class}) +@DaoSqlTest +public class AssetProfileControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator assetProfileInfoIdComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AuditLogControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AuditLogControllerTest.java index 95fcd08e12..a36a33bc6f 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AuditLogControllerTest.java @@ -34,6 +34,7 @@ import org.thingsboard.server.common.data.page.TimePageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.audit.AuditLogDao; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.sqlts.insert.sql.SqlPartitioningRepository; import org.thingsboard.server.service.ttl.AuditLogsCleanUpService; @@ -50,7 +51,8 @@ import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseAuditLogControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class AuditLogControllerTest extends AbstractControllerTest { private Tenant savedTenant; private User tenantAdmin; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AuthControllerTest.java similarity index 95% rename from application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/AuthControllerTest.java index 0ffda76a14..b833e45d34 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/AuthControllerTest.java @@ -17,6 +17,7 @@ package org.thingsboard.server.controller; import org.junit.Test; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.concurrent.TimeUnit; @@ -24,7 +25,8 @@ import static org.hamcrest.Matchers.is; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseAuthControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class AuthControllerTest extends AbstractControllerTest { @Test public void testGetUser() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/ComponentDescriptorControllerTest.java similarity index 96% rename from application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/ComponentDescriptorControllerTest.java index cb35fd5a55..cce4261e14 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/ComponentDescriptorControllerTest.java @@ -28,12 +28,14 @@ import org.thingsboard.server.common.data.plugin.ComponentScope; import org.thingsboard.server.common.data.plugin.ComponentType; import org.thingsboard.server.common.data.rule.RuleChainType; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.List; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseComponentDescriptorControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class ComponentDescriptorControllerTest extends AbstractControllerTest { private static final int AMOUNT_OF_DEFAULT_FILTER_NODES = 4; private Tenant savedTenant; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/CustomerControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/CustomerControllerTest.java index 53e18c6673..125e533471 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/CustomerControllerTest.java @@ -44,6 +44,7 @@ import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.customer.CustomerDao; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.List; @@ -53,8 +54,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@ContextConfiguration(classes = {BaseCustomerControllerTest.Config.class}) -public abstract class BaseCustomerControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {CustomerControllerTest.Config.class}) +@DaoSqlTest +public class CustomerControllerTest extends AbstractControllerTest { static final TypeReference> PAGE_DATA_CUSTOMER_TYPE_REFERENCE = new TypeReference<>() { }; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java index ea9ad45ed3..9f8e63e3b0 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java @@ -43,6 +43,7 @@ import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.dashboard.DashboardDao; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -51,8 +52,9 @@ import java.util.List; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@ContextConfiguration(classes = {BaseDashboardControllerTest.Config.class}) -public abstract class BaseDashboardControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {DashboardControllerTest.Config.class}) +@DaoSqlTest +public class DashboardControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java index 42bfb236df..11d11eccdd 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java @@ -68,6 +68,7 @@ import org.thingsboard.server.dao.device.DeviceDao; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.exception.DeviceCredentialsValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.service.gateway_device.GatewayNotificationsService; import java.util.ArrayList; @@ -84,8 +85,9 @@ import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; import static org.thingsboard.server.common.data.ota.OtaPackageType.SOFTWARE; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; -@ContextConfiguration(classes = {BaseDeviceControllerTest.Config.class}) -public abstract class BaseDeviceControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {DeviceControllerTest.Config.class}) +@DaoSqlTest +public class DeviceControllerTest extends AbstractControllerTest { static final TypeReference> PAGE_DATA_DEVICE_TYPE_REF = new TypeReference<>() { }; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceProfileControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DeviceProfileControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseDeviceProfileControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/DeviceProfileControllerTest.java index fb4f9bd322..d2bcfe2b88 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceProfileControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/DeviceProfileControllerTest.java @@ -51,6 +51,7 @@ import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.device.DeviceProfileDao; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -62,8 +63,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; import static org.thingsboard.server.common.data.ota.OtaPackageType.SOFTWARE; -@ContextConfiguration(classes = {BaseDeviceProfileControllerTest.Config.class}) -public abstract class BaseDeviceProfileControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {DeviceProfileControllerTest.Config.class}) +@DaoSqlTest +public class DeviceProfileControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator deviceProfileInfoIdComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEdgeControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseEdgeControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java index 731b5570cc..c8a20a38f5 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEdgeControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java @@ -52,6 +52,7 @@ import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.edge.EdgeDao; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.edge.imitator.EdgeImitator; import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg; import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg; @@ -77,8 +78,9 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; @TestPropertySource(properties = { "edges.enabled=true", }) -@ContextConfiguration(classes = {BaseEdgeControllerTest.Config.class}) -public abstract class BaseEdgeControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {EdgeControllerTest.Config.class}) +@DaoSqlTest +public class EdgeControllerTest extends AbstractControllerTest { public static final String EDGE_HOST = "localhost"; public static final int EDGE_PORT = 7070; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEdgeEventControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EdgeEventControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseEdgeEventControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/EdgeEventControllerTest.java index c591bb6a16..255aa2bdf1 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEdgeEventControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/EdgeEventControllerTest.java @@ -40,6 +40,7 @@ import org.thingsboard.server.common.data.page.TimePageLink; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.edge.EdgeEventDao; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.sqlts.insert.sql.SqlPartitioningRepository; import org.thingsboard.server.service.ttl.EdgeEventsCleanUpService; @@ -59,7 +60,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. "edges.enabled=true", }) @Slf4j -public abstract class BaseEdgeEventControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class EdgeEventControllerTest extends AbstractControllerTest { private Tenant savedTenant; private User tenantAdmin; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EntityQueryControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/EntityQueryControllerTest.java index ed25395b3b..2aa10992ed 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/EntityQueryControllerTest.java @@ -52,6 +52,7 @@ import org.thingsboard.server.common.data.query.KeyFilter; import org.thingsboard.server.common.data.query.NumericFilterPredicate; import org.thingsboard.server.common.data.query.TsValue; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -62,7 +63,8 @@ import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseEntityQueryControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class EntityQueryControllerTest extends AbstractControllerTest { private Tenant savedTenant; private User tenantAdmin; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEntityRelationControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EntityRelationControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseEntityRelationControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/EntityRelationControllerTest.java index 1c76fb254f..d686be6f27 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEntityRelationControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/EntityRelationControllerTest.java @@ -41,6 +41,7 @@ import org.thingsboard.server.common.data.relation.RelationTypeGroup; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.relation.RelationService; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.Collections; import java.util.List; @@ -50,7 +51,8 @@ import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -public abstract class BaseEntityRelationControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class EntityRelationControllerTest extends AbstractControllerTest { public static final String BASE_DEVICE_NAME = "Test dummy device"; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEntityViewControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EntityViewControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseEntityViewControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/EntityViewControllerTest.java index 75283b63f1..a65769f3f1 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEntityViewControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/EntityViewControllerTest.java @@ -64,6 +64,7 @@ import org.thingsboard.server.common.data.security.DeviceCredentials; import org.thingsboard.server.dao.entityview.EntityViewDao; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.HashSet; @@ -89,8 +90,9 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; "js.evaluator=mock", }) @Slf4j -@ContextConfiguration(classes = {BaseEntityViewControllerTest.Config.class}) -public abstract class BaseEntityViewControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {EntityViewControllerTest.Config.class}) +@DaoSqlTest +public class EntityViewControllerTest extends AbstractControllerTest { static final TypeReference> PAGE_DATA_ENTITY_VIEW_TYPE_REF = new TypeReference<>() { }; static final TypeReference> PAGE_DATA_ENTITY_VIEW_INFO_TYPE_REF = new TypeReference<>() { diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseHomePageApiTest.java b/application/src/test/java/org/thingsboard/server/controller/HomePageApiTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseHomePageApiTest.java rename to application/src/test/java/org/thingsboard/server/controller/HomePageApiTest.java index b71be1c3b6..c601be7272 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseHomePageApiTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/HomePageApiTest.java @@ -57,6 +57,7 @@ import org.thingsboard.server.common.data.query.TsValue; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; import org.thingsboard.server.common.stats.TbApiUsageStateClient; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.settings.AdminSettingsService; import org.thingsboard.server.dao.tenant.TbTenantProfileCache; import org.thingsboard.server.service.ws.telemetry.cmd.v2.EntityCountCmd; @@ -73,7 +74,8 @@ import java.util.concurrent.TimeUnit; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -public abstract class BaseHomePageApiTest extends AbstractControllerTest { +@DaoSqlTest +public class HomePageApiTest extends AbstractControllerTest { @Autowired private TbApiUsageStateClient apiUsageStateClient; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseOtaPackageControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/OtaPackageControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseOtaPackageControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/OtaPackageControllerTest.java index 1aed95ff0c..f4472e83be 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseOtaPackageControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/OtaPackageControllerTest.java @@ -38,6 +38,7 @@ import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -48,7 +49,8 @@ import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; -public abstract class BaseOtaPackageControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class OtaPackageControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseRpcControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/RpcControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseRpcControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/RpcControllerTest.java index 486ba32c4e..c060a7da96 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseRpcControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/RpcControllerTest.java @@ -31,12 +31,14 @@ import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.rpc.Rpc; import org.thingsboard.server.common.data.rpc.RpcStatus; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.List; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseRpcControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class RpcControllerTest extends AbstractControllerTest { private Tenant savedTenant; private User tenantAdmin; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseRuleChainControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/RuleChainControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseRuleChainControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/RuleChainControllerTest.java index ba52cea1ec..16a266e485 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseRuleChainControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/RuleChainControllerTest.java @@ -44,6 +44,7 @@ import org.thingsboard.server.common.data.rule.RuleNode; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.rule.RuleChainDao; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -53,8 +54,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -@ContextConfiguration(classes = {BaseRuleChainControllerTest.Config.class}) -public abstract class BaseRuleChainControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {RuleChainControllerTest.Config.class}) +@DaoSqlTest +public class RuleChainControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseTbResourceControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/TbResourceControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseTbResourceControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/TbResourceControllerTest.java index d82daf9eea..de8f717c0d 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseTbResourceControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TbResourceControllerTest.java @@ -32,6 +32,7 @@ import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -40,7 +41,8 @@ import java.util.List; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseTbResourceControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class TbResourceControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseTelemetryControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/TelemetryControllerTest.java similarity index 95% rename from application/src/test/java/org/thingsboard/server/controller/BaseTelemetryControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/TelemetryControllerTest.java index 0676ccf83c..47cac1b549 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseTelemetryControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TelemetryControllerTest.java @@ -20,10 +20,12 @@ import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.SaveDeviceWithCredentialsRequest; import org.thingsboard.server.common.data.security.DeviceCredentials; import org.thingsboard.server.common.data.security.DeviceCredentialsType; +import org.thingsboard.server.dao.service.DaoSqlTest; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseTelemetryControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class TelemetryControllerTest extends AbstractControllerTest { @Test public void testConstraintValidator() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/TenantControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/TenantControllerTest.java index 2e42009e5b..a5b86fff85 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TenantControllerTest.java @@ -49,6 +49,7 @@ import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Comparator; @@ -69,7 +70,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. "js.evaluator=mock", }) @Slf4j -public abstract class BaseTenantControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class TenantControllerTest extends AbstractControllerTest { static final TypeReference> PAGE_DATA_TENANT_TYPE_REF = new TypeReference<>() { }; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseTenantProfileControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/TenantProfileControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseTenantProfileControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/TenantProfileControllerTest.java index d4116a873d..e6b37143ad 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseTenantProfileControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TenantProfileControllerTest.java @@ -36,6 +36,7 @@ import org.thingsboard.server.common.data.queue.SubmitStrategyType; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; import org.thingsboard.server.common.data.tenant.profile.TenantProfileData; import org.thingsboard.server.common.data.tenant.profile.TenantProfileQueueConfiguration; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -47,7 +48,8 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseTenantProfileControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class TenantProfileControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator tenantProfileInfoIdComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthConfigTest.java b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthConfigTest.java index 0f77eb0fd2..ad898e0215 100644 --- a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthConfigTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthConfigTest.java @@ -39,6 +39,7 @@ import org.thingsboard.server.common.data.security.model.mfa.provider.SmsTwoFaPr import org.thingsboard.server.common.data.security.model.mfa.provider.TotpTwoFaProviderConfig; import org.thingsboard.server.common.data.security.model.mfa.provider.TwoFaProviderConfig; import org.thingsboard.server.common.data.security.model.mfa.provider.TwoFaProviderType; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.service.security.auth.mfa.TwoFactorAuthService; import org.thingsboard.server.service.security.auth.mfa.config.TwoFaConfigManager; import org.thingsboard.server.service.security.auth.mfa.provider.impl.OtpBasedTwoFaProvider; @@ -58,7 +59,8 @@ import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class TwoFactorAuthConfigTest extends AbstractControllerTest { +@DaoSqlTest +public class TwoFactorAuthConfigTest extends AbstractControllerTest { @SpyBean private TotpTwoFaProvider totpTwoFactorAuthProvider; diff --git a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java index 8c8074c35d..1c97ae48d7 100644 --- a/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/TwoFactorAuthTest.java @@ -48,6 +48,7 @@ import org.thingsboard.server.common.data.security.model.mfa.provider.TotpTwoFaP import org.thingsboard.server.common.data.security.model.mfa.provider.TwoFaProviderConfig; import org.thingsboard.server.common.data.security.model.mfa.provider.TwoFaProviderType; import org.thingsboard.server.dao.audit.AuditLogService; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.user.UserService; import org.thingsboard.server.service.security.auth.mfa.TwoFactorAuthService; import org.thingsboard.server.service.security.auth.mfa.config.TwoFaConfigManager; @@ -72,7 +73,8 @@ import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class TwoFactorAuthTest extends AbstractControllerTest { +@DaoSqlTest +public class TwoFactorAuthTest extends AbstractControllerTest { @Autowired private TwoFaConfigManager twoFaConfigManager; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/UserControllerTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/UserControllerTest.java index 5340101e6f..aebc33ec34 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/UserControllerTest.java @@ -50,6 +50,7 @@ import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.settings.StarredDashboardInfo; import org.thingsboard.server.common.data.settings.UserDashboardsInfo; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.dao.user.UserDao; import java.util.ArrayList; @@ -66,8 +67,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.thingsboard.server.dao.model.ModelConstants.SYSTEM_TENANT; -@ContextConfiguration(classes = {BaseUserControllerTest.Config.class}) -public abstract class BaseUserControllerTest extends AbstractControllerTest { +@ContextConfiguration(classes = {UserControllerTest.Config.class}) +@DaoSqlTest +public class UserControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator userDataIdComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java b/application/src/test/java/org/thingsboard/server/controller/WebsocketApiTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java rename to application/src/test/java/org/thingsboard/server/controller/WebsocketApiTest.java index 6de1bc5b35..88dc8f1da0 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/WebsocketApiTest.java @@ -53,6 +53,7 @@ import org.thingsboard.server.common.data.query.KeyFilter; import org.thingsboard.server.common.data.query.NumericFilterPredicate; import org.thingsboard.server.common.data.query.SingleEntityFilter; import org.thingsboard.server.common.data.query.TsValue; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.service.subscription.SubscriptionErrorCode; import org.thingsboard.server.service.subscription.TbAttributeSubscriptionScope; import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService; @@ -73,7 +74,8 @@ import static org.assertj.core.api.Assertions.assertThatNoException; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @Slf4j -public abstract class BaseWebsocketApiTest extends AbstractControllerTest { +@DaoSqlTest +public class WebsocketApiTest extends AbstractControllerTest { @Autowired private TelemetrySubscriptionService tsService; diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/WidgetTypeControllerTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/WidgetTypeControllerTest.java index c4312794b7..25e9027e4b 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/WidgetTypeControllerTest.java @@ -28,6 +28,7 @@ import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.widget.WidgetType; import org.thingsboard.server.common.data.widget.WidgetTypeDetails; import org.thingsboard.server.common.data.widget.WidgetsBundle; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -36,7 +37,8 @@ import java.util.List; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -public abstract class BaseWidgetTypeControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class WidgetTypeControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/WidgetsBundleControllerTest.java similarity index 75% rename from application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java rename to application/src/test/java/org/thingsboard/server/controller/WidgetsBundleControllerTest.java index 828d279e93..ee341fe284 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/WidgetsBundleControllerTest.java @@ -21,16 +21,16 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.StringUtils; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.audit.ActionType; -import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.common.data.widget.WidgetsBundle; +import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.service.DaoSqlTest; import java.util.ArrayList; import java.util.Collections; @@ -38,9 +38,9 @@ import java.util.List; import static org.hamcrest.Matchers.containsString; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.thingsboard.server.dao.model.ModelConstants.SYSTEM_TENANT; -public abstract class BaseWidgetsBundleControllerTest extends AbstractControllerTest { +@DaoSqlTest +public class WidgetsBundleControllerTest extends AbstractControllerTest { private IdComparator idComparator = new IdComparator<>(); @@ -70,7 +70,7 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController public void afterTest() throws Exception { loginSysAdmin(); - doDelete("/api/tenant/"+savedTenant.getId().getId().toString()) + doDelete("/api/tenant/" + savedTenant.getId().getId().toString()) .andExpect(status().isOk()); } @@ -79,14 +79,14 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTitle("My widgets bundle"); - Mockito.reset(tbClusterService); + Mockito.reset(tbClusterService, auditLogService); WidgetsBundle savedWidgetsBundle = doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class); - testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(savedWidgetsBundle, savedWidgetsBundle, - savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), - ActionType.ADDED, ActionType.ADDED, 0, 1, 0); - Mockito.reset(tbClusterService); + testNotifyEntityAllOneTime(savedWidgetsBundle, savedWidgetsBundle.getId(), savedWidgetsBundle.getId(), savedTenant.getId(), + tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.ADDED); + + Mockito.reset(tbClusterService, auditLogService); Assert.assertNotNull(savedWidgetsBundle); Assert.assertNotNull(savedWidgetsBundle.getId()); @@ -101,25 +101,26 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController WidgetsBundle foundWidgetsBundle = doGet("/api/widgetsBundle/" + savedWidgetsBundle.getId().getId().toString(), WidgetsBundle.class); Assert.assertEquals(foundWidgetsBundle.getTitle(), savedWidgetsBundle.getTitle()); - testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(savedWidgetsBundle, savedWidgetsBundle, - savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), - ActionType.UPDATED, ActionType.UPDATED, 0, 1, 0); + testNotifyEntityAllOneTime(savedWidgetsBundle, savedWidgetsBundle.getId(), savedWidgetsBundle.getId(), savedTenant.getId(), + tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.UPDATED); } - @Test - public void testSaveWidgetBundleWithViolationOfLengthValidation() throws Exception { - WidgetsBundle widgetsBundle = new WidgetsBundle(); - widgetsBundle.setTitle(StringUtils.randomAlphabetic(300)); + @Test + public void testSaveWidgetBundleWithViolationOfLengthValidation() throws Exception { + WidgetsBundle widgetsBundle = new WidgetsBundle(); + widgetsBundle.setTitle(StringUtils.randomAlphabetic(300)); - Mockito.reset(tbClusterService); + Mockito.reset(tbClusterService, auditLogService); - String msgError = msgErrorFieldLength("title"); - doPost("/api/widgetsBundle", widgetsBundle) - .andExpect(status().isBadRequest()) - .andExpect(statusReason(containsString(msgError))); + String msgError = msgErrorFieldLength("title"); + doPost("/api/widgetsBundle", widgetsBundle) + .andExpect(status().isBadRequest()) + .andExpect(statusReason(containsString(msgError))); - testNotifyEntityNever(widgetsBundle.getId(), widgetsBundle); - } + testNotifyEntityEqualsOneTimeServiceNeverError(widgetsBundle, savedTenant.getId(), + tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.ADDED, + new DataValidationException("Validation error: title length must be equal or less than 255")); + } @Test public void testUpdateWidgetsBundleFromDifferentTenant() throws Exception { @@ -129,7 +130,7 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController loginDifferentTenant(); - Mockito.reset(tbClusterService); + Mockito.reset(tbClusterService, auditLogService); doPost("/api/widgetsBundle", savedWidgetsBundle) .andExpect(status().isForbidden()) @@ -155,26 +156,25 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTitle("My widgets bundle"); - Mockito.reset(tbClusterService, auditLogService); - WidgetsBundle savedWidgetsBundle = doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class); - doDelete("/api/widgetsBundle/"+savedWidgetsBundle.getId().getId().toString()) + Mockito.reset(tbClusterService, auditLogService); + + doDelete("/api/widgetsBundle/" + savedWidgetsBundle.getId().getId().toString()) .andExpect(status().isOk()); String savedWidgetsBundleIdStr = savedWidgetsBundle.getId().getId().toString(); + + testNotifyEntityAllOneTime(savedWidgetsBundle, savedWidgetsBundle.getId(), savedWidgetsBundle.getId(), savedTenant.getId(), + tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.DELETED); + doGet("/api/widgetsBundle/" + savedWidgetsBundleIdStr) .andExpect(status().isNotFound()) .andExpect(statusReason(containsString(msgErrorNoFound("Widgets bundle", savedWidgetsBundleIdStr)))); - - testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(savedWidgetsBundle, savedWidgetsBundle, - savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(), - ActionType.DELETED, ActionType.DELETED, 0, 1, 0); } @Test public void testSaveWidgetsBundleWithEmptyTitle() throws Exception { - Mockito.reset(tbClusterService, auditLogService); WidgetsBundle widgetsBundle = new WidgetsBundle(); @@ -182,7 +182,9 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController .andExpect(status().isBadRequest()) .andExpect(statusReason(containsString("Widgets bundle title " + msgErrorShouldBeSpecified))); - testNotifyEntityNever(widgetsBundle.getId(), widgetsBundle); + testNotifyEntityEqualsOneTimeServiceNeverError(widgetsBundle, savedTenant.getId(), + tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.ADDED, + new DataValidationException("Widgets bundle title should be specified!")); } @Test @@ -192,13 +194,14 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController WidgetsBundle savedWidgetsBundle = doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class); savedWidgetsBundle.setAlias("new_alias"); - Mockito.clearInvocations(tbClusterService); + Mockito.reset(tbClusterService, auditLogService); doPost("/api/widgetsBundle", savedWidgetsBundle) .andExpect(status().isBadRequest()) .andExpect(statusReason(containsString("Update of widgets bundle alias is prohibited"))); - - testNotifyEntityNever(savedWidgetsBundle.getId(), savedWidgetsBundle); + testNotifyEntityEqualsOneTimeServiceNeverError(savedWidgetsBundle, savedTenant.getId(), + tenantAdmin.getId(), tenantAdmin.getEmail(), ActionType.UPDATED, + new DataValidationException("Update of widgets bundle alias is prohibited!")); } @Test @@ -207,22 +210,17 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController login(tenantAdmin.getEmail(), "testPassword1"); List sysWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference<>(){}); - - Mockito.reset(tbClusterService); + new TypeReference<>() { + }); int cntEntity = 73; List widgetsBundles = new ArrayList<>(); - for (int i=0;i loadedWidgetsBundles = new ArrayList<>(); @@ -230,7 +228,8 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController PageData pageData; do { pageData = doGetTypedWithPageLink("/api/widgetsBundles?", - new TypeReference<>(){}, pageLink); + new TypeReference<>() { + }, pageLink); loadedWidgetsBundles.addAll(pageData.getData()); if (pageData.hasNext()) { pageLink = pageLink.nextPageLink(); @@ -249,13 +248,14 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController loginSysAdmin(); List sysWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference<>(){}); + new TypeReference<>() { + }); int cntEntity = 120; List createdWidgetsBundles = new ArrayList<>(); - for (int i=0;i pageData; do { pageData = doGetTypedWithPageLink("/api/widgetsBundles?", - new TypeReference<>(){}, pageLink); + new TypeReference<>() { + }, pageLink); loadedWidgetsBundles.addAll(pageData.getData()); if (pageData.hasNext()) { pageLink = pageLink.nextPageLink(); @@ -279,22 +280,17 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController Assert.assertEquals(widgetsBundles, loadedWidgetsBundles); - Mockito.reset(tbClusterService); - for (WidgetsBundle widgetsBundle : createdWidgetsBundles) { - doDelete("/api/widgetsBundle/"+widgetsBundle.getId().getId().toString()) + doDelete("/api/widgetsBundle/" + widgetsBundle.getId().getId().toString()) .andExpect(status().isOk()); } - testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new WidgetsBundle(), new WidgetsBundle(), - SYSTEM_TENANT, (CustomerId) createEntityId_NULL_UUID(new Customer()), null, SYS_ADMIN_EMAIL, - ActionType.DELETED, ActionType.DELETED, 0, cntEntity, 0); - pageLink = new PageLink(17); loadedWidgetsBundles.clear(); do { pageData = doGetTypedWithPageLink("/api/widgetsBundles?", - new TypeReference>(){}, pageLink); + new TypeReference>() { + }, pageLink); loadedWidgetsBundles.addAll(pageData.getData()); if (pageData.hasNext()) { pageLink = pageLink.nextPageLink(); @@ -314,19 +310,21 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController login(tenantAdmin.getEmail(), "testPassword1"); List sysWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference>(){}); + new TypeReference>() { + }); List widgetsBundles = new ArrayList<>(); - for (int i=0;i<73;i++) { + for (int i = 0; i < 73; i++) { WidgetsBundle widgetsBundle = new WidgetsBundle(); - widgetsBundle.setTitle("Widgets bundle"+i); + widgetsBundle.setTitle("Widgets bundle" + i); widgetsBundles.add(doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class)); } widgetsBundles.addAll(sysWidgetsBundles); List loadedWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference<>(){}); + new TypeReference<>() { + }); Collections.sort(widgetsBundles, idComparator); Collections.sort(loadedWidgetsBundles, idComparator); @@ -341,12 +339,13 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController List sysWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference<>(){}); + new TypeReference<>() { + }); List createdSystemWidgetsBundles = new ArrayList<>(); - for (int i=0;i<82;i++) { + for (int i = 0; i < 82; i++) { WidgetsBundle widgetsBundle = new WidgetsBundle(); - widgetsBundle.setTitle("Sys widgets bundle"+i); + widgetsBundle.setTitle("Sys widgets bundle" + i); createdSystemWidgetsBundles.add(doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class)); } @@ -358,14 +357,15 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController login(tenantAdmin.getEmail(), "testPassword1"); - for (int i=0;i<127;i++) { + for (int i = 0; i < 127; i++) { WidgetsBundle widgetsBundle = new WidgetsBundle(); - widgetsBundle.setTitle("Tenant widgets bundle"+i); + widgetsBundle.setTitle("Tenant widgets bundle" + i); widgetsBundles.add(doPost("/api/widgetsBundle", widgetsBundle, WidgetsBundle.class)); } List loadedWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference>(){}); + new TypeReference>() { + }); Collections.sort(widgetsBundles, idComparator); Collections.sort(loadedWidgetsBundles, idComparator); @@ -375,7 +375,8 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController loginSysAdmin(); loadedWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference>(){}); + new TypeReference<>() { + }); Collections.sort(systemWidgetsBundles, idComparator); Collections.sort(loadedWidgetsBundles, idComparator); @@ -383,12 +384,13 @@ public abstract class BaseWidgetsBundleControllerTest extends AbstractController Assert.assertEquals(systemWidgetsBundles, loadedWidgetsBundles); for (WidgetsBundle widgetsBundle : createdSystemWidgetsBundles) { - doDelete("/api/widgetsBundle/"+widgetsBundle.getId().getId().toString()) + doDelete("/api/widgetsBundle/" + widgetsBundle.getId().getId().toString()) .andExpect(status().isOk()); } loadedWidgetsBundles = doGetTyped("/api/widgetsBundles?", - new TypeReference<>(){}); + new TypeReference<>() { + }); Collections.sort(sysWidgetsBundles, idComparator); Collections.sort(loadedWidgetsBundles, idComparator); diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java deleted file mode 100644 index a0a483f0f1..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAdminControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class AdminControllerSqlTest extends BaseAdminControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AlarmCommentControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AlarmCommentControllerSqlTest.java deleted file mode 100644 index 7cf09ab329..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AlarmCommentControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAlarmCommentControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AlarmCommentControllerSqlTest extends BaseAlarmCommentControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AlarmControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AlarmControllerSqlTest.java deleted file mode 100644 index 8b9c70c47d..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AlarmControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAlarmControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AlarmControllerSqlTest extends BaseAlarmControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java deleted file mode 100644 index 7a033c15b0..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAssetControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class AssetControllerSqlTest extends BaseAssetControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AssetProfileControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AssetProfileControllerSqlTest.java deleted file mode 100644 index e8b41f5093..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AssetProfileControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAssetProfileControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AssetProfileControllerSqlTest extends BaseAssetProfileControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java deleted file mode 100644 index d13a4fc47e..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAuditLogControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AuditLogControllerSqlTest extends BaseAuditLogControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java deleted file mode 100644 index 84bc50c293..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseAuthControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class AuthControllerSqlTest extends BaseAuthControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java deleted file mode 100644 index 22772f48dc..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseComponentDescriptorControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class ComponentDescriptorControllerSqlTest extends BaseComponentDescriptorControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java deleted file mode 100644 index b4ceb0d1d2..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseCustomerControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class CustomerControllerSqlTest extends BaseCustomerControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java deleted file mode 100644 index 214001ea4a..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseDashboardControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class DashboardControllerSqlTest extends BaseDashboardControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java deleted file mode 100644 index 4e96975afa..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseDeviceControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class DeviceControllerSqlTest extends BaseDeviceControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceProfileControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/DeviceProfileControllerSqlTest.java deleted file mode 100644 index 0aa5185c46..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceProfileControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseDeviceProfileControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DeviceProfileControllerSqlTest extends BaseDeviceProfileControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/EdgeControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/EdgeControllerSqlTest.java deleted file mode 100644 index 958b06398c..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/EdgeControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseEdgeControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EdgeControllerSqlTest extends BaseEdgeControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/EdgeEventControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/EdgeEventControllerSqlTest.java deleted file mode 100644 index 5191347dc3..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/EdgeEventControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseEdgeEventControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EdgeEventControllerSqlTest extends BaseEdgeEventControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/EntityQueryControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/EntityQueryControllerSqlTest.java deleted file mode 100644 index df2ab289c6..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/EntityQueryControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseEntityQueryControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EntityQueryControllerSqlTest extends BaseEntityQueryControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/EntityRelationControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/EntityRelationControllerSqlTest.java deleted file mode 100644 index 1584a72eed..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/EntityRelationControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseEntityRelationControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EntityRelationControllerSqlTest extends BaseEntityRelationControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/EntityViewControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/EntityViewControllerSqlTest.java deleted file mode 100644 index 6e13b83334..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/EntityViewControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseEntityViewControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Victor Basanets on 8/27/2017. - */ -@DaoSqlTest -public class EntityViewControllerSqlTest extends BaseEntityViewControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/HomePageApiSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/HomePageApiSqlTest.java deleted file mode 100644 index 5aa50c9336..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/HomePageApiSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseHomePageApiTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class HomePageApiSqlTest extends BaseHomePageApiTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/OtaPackageControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/OtaPackageControllerSqlTest.java deleted file mode 100644 index f5e2071209..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/OtaPackageControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseOtaPackageControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class OtaPackageControllerSqlTest extends BaseOtaPackageControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/RpcControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/RpcControllerTest.java deleted file mode 100644 index 71ab8a5562..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/RpcControllerTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseRpcControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class RpcControllerTest extends BaseRpcControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/RuleChainControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/RuleChainControllerSqlTest.java deleted file mode 100644 index 14f40b4e55..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/RuleChainControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseRuleChainControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class RuleChainControllerSqlTest extends BaseRuleChainControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TbResourceControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TbResourceControllerSqlTest.java deleted file mode 100644 index f7b6f83c14..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TbResourceControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseTbResourceControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TbResourceControllerSqlTest extends BaseTbResourceControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TelemetryControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TelemetryControllerSqlTest.java deleted file mode 100644 index b256f4fe1e..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TelemetryControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseTelemetryControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TelemetryControllerSqlTest extends BaseTelemetryControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java deleted file mode 100644 index 5e1f474f1b..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseTenantControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class TenantControllerSqlTest extends BaseTenantControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TenantProfileControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TenantProfileControllerSqlTest.java deleted file mode 100644 index bde2975ad5..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TenantProfileControllerSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseTenantProfileControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TenantProfileControllerSqlTest extends BaseTenantProfileControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthConfigSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthConfigSqlTest.java deleted file mode 100644 index 7082268b69..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthConfigSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.TwoFactorAuthConfigTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TwoFactorAuthConfigSqlTest extends TwoFactorAuthConfigTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthSqlTest.java deleted file mode 100644 index e6e2ba5e97..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/TwoFactorAuthSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.TwoFactorAuthTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TwoFactorAuthSqlTest extends TwoFactorAuthTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java deleted file mode 100644 index c3c87b10da..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseUserControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class UserControllerSqlTest extends BaseUserControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/WebsocketApiSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/WebsocketApiSqlTest.java deleted file mode 100644 index f3dc99e72d..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/WebsocketApiSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseWebsocketApiTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class WebsocketApiSqlTest extends BaseWebsocketApiTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java deleted file mode 100644 index a629cfea93..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseWidgetTypeControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class WidgetTypeControllerSqlTest extends BaseWidgetTypeControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java deleted file mode 100644 index c4416cbf6c..0000000000 --- a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.controller.sql; - -import org.thingsboard.server.controller.BaseWidgetsBundleControllerTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -/** - * Created by Valerii Sosliuk on 6/28/2017. - */ -@DaoSqlTest -public class WidgetsBundleControllerSqlTest extends BaseWidgetsBundleControllerTest { -} diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseAlarmEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/AlarmEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseAlarmEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/AlarmEdgeTest.java index c06093535a..afccc634ed 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseAlarmEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/AlarmEdgeTest.java @@ -29,6 +29,7 @@ import org.thingsboard.server.common.data.alarm.AlarmStatus; import org.thingsboard.server.common.data.id.AlarmId; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.AlarmUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import org.thingsboard.server.gen.edge.v1.UplinkMsg; @@ -39,7 +40,8 @@ import java.util.UUID; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseAlarmEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class AlarmEdgeTest extends AbstractEdgeTest { @Test public void testSendAlarmToCloud() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseAssetEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/AssetEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseAssetEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/AssetEdgeTest.java index 996334627f..2f5848ece6 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseAssetEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/AssetEdgeTest.java @@ -23,6 +23,7 @@ import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.edge.Edge; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg; import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -32,7 +33,8 @@ import java.util.UUID; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseAssetEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class AssetEdgeTest extends AbstractEdgeTest { @Test public void testAssets() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseAssetProfileEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/AssetProfileEdgeTest.java similarity index 97% rename from application/src/test/java/org/thingsboard/server/edge/BaseAssetProfileEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/AssetProfileEdgeTest.java index df3f9a8e6e..fd36c11db8 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseAssetProfileEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/AssetProfileEdgeTest.java @@ -21,6 +21,7 @@ import org.junit.Assert; import org.junit.Test; import org.thingsboard.server.common.data.asset.AssetProfile; import org.thingsboard.server.common.data.id.RuleChainId; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -28,7 +29,8 @@ import java.nio.charset.StandardCharsets; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseAssetProfileEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class AssetProfileEdgeTest extends AbstractEdgeTest { @Test public void testAssetProfiles() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseCustomerEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/CustomerEdgeTest.java similarity index 97% rename from application/src/test/java/org/thingsboard/server/edge/BaseCustomerEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/CustomerEdgeTest.java index 93adc722c8..b9bf41fde6 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseCustomerEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/CustomerEdgeTest.java @@ -20,6 +20,7 @@ import org.junit.Assert; import org.junit.Test; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.edge.Edge; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg; import org.thingsboard.server.gen.edge.v1.EdgeConfiguration; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -28,7 +29,8 @@ import java.util.Optional; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseCustomerEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class CustomerEdgeTest extends AbstractEdgeTest { @Test public void testCreateUpdateDeleteCustomer() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseDashboardEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/DashboardEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseDashboardEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/DashboardEdgeTest.java index b6e8c21615..988d6fdc98 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseDashboardEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/DashboardEdgeTest.java @@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.Dashboard; import org.thingsboard.server.common.data.ShortCustomerInfo; import org.thingsboard.server.common.data.edge.Edge; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -31,7 +32,8 @@ import java.util.Set; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseDashboardEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class DashboardEdgeTest extends AbstractEdgeTest { @Test public void testDashboards() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/DeviceEdgeTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/DeviceEdgeTest.java index 1fbd483aa4..2fa0ee321e 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/DeviceEdgeTest.java @@ -52,6 +52,7 @@ import org.thingsboard.server.common.data.security.DeviceCredentialsType; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; import org.thingsboard.server.common.msg.session.FeatureType; import org.thingsboard.server.common.transport.adaptor.JsonConverter; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.AttributesRequestMsg; import org.thingsboard.server.gen.edge.v1.DeviceCredentialsRequestMsg; import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg; @@ -79,7 +80,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @TestPropertySource(properties = { "transport.mqtt.enabled=true" }) -abstract public class BaseDeviceEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class DeviceEdgeTest extends AbstractEdgeTest { @Test public void testDevices() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceProfileEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/DeviceProfileEdgeTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/edge/BaseDeviceProfileEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/DeviceProfileEdgeTest.java index 0a52853bf8..9d4cc0ca15 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseDeviceProfileEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/DeviceProfileEdgeTest.java @@ -43,6 +43,7 @@ import org.thingsboard.server.common.data.ota.OtaPackageType; import org.thingsboard.server.common.data.transport.snmp.SnmpMapping; import org.thingsboard.server.common.data.transport.snmp.config.SnmpCommunicationConfig; import org.thingsboard.server.common.data.transport.snmp.config.impl.TelemetryQueryingSnmpCommunicationConfig; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import org.thingsboard.server.transport.AbstractTransportIntegrationTest; @@ -54,7 +55,8 @@ import java.util.Optional; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseDeviceProfileEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class DeviceProfileEdgeTest extends AbstractEdgeTest { @Test public void testDeviceProfiles() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/EdgeTest.java similarity index 97% rename from application/src/test/java/org/thingsboard/server/edge/BaseEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/EdgeTest.java index 59ad249b34..1f205af53a 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/EdgeTest.java @@ -21,6 +21,7 @@ import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.edge.Edge; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg; import org.thingsboard.server.gen.edge.v1.EdgeConfiguration; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -28,7 +29,8 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import java.util.Optional; import java.util.UUID; -abstract public class BaseEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class EdgeTest extends AbstractEdgeTest { @Test public void testEdge_assignToCustomer_unassignFromCustomer() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseEntityViewEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/EntityViewEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseEntityViewEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/EntityViewEdgeTest.java index a2ab82786b..234a9473fa 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseEntityViewEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/EntityViewEdgeTest.java @@ -25,6 +25,7 @@ import org.thingsboard.server.common.data.EntityView; import org.thingsboard.server.common.data.edge.Edge; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg; import org.thingsboard.server.gen.edge.v1.EntityViewsRequestMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -34,7 +35,8 @@ import java.util.UUID; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseEntityViewEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class EntityViewEdgeTest extends AbstractEdgeTest { @Test public void testEntityViews() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseOtaPackageEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/OtaPackageEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseOtaPackageEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/OtaPackageEdgeTest.java index a8b4d7df7b..5525d63f41 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseOtaPackageEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/OtaPackageEdgeTest.java @@ -27,6 +27,7 @@ import org.thingsboard.server.common.data.OtaPackageInfo; import org.thingsboard.server.common.data.SaveOtaPackageInfoRequest; import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; import org.thingsboard.server.common.data.ota.OtaPackageType; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -35,7 +36,8 @@ import java.nio.ByteBuffer; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; -abstract public class BaseOtaPackageEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class OtaPackageEdgeTest extends AbstractEdgeTest { @Test public void testOtaPackages_usesUrl() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseQueueEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/QueueEdgeTest.java similarity index 97% rename from application/src/test/java/org/thingsboard/server/edge/BaseQueueEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/QueueEdgeTest.java index 60dfb5baed..32e8e7f222 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseQueueEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/QueueEdgeTest.java @@ -24,12 +24,14 @@ import org.thingsboard.server.common.data.queue.Queue; import org.thingsboard.server.common.data.queue.SubmitStrategy; import org.thingsboard.server.common.data.queue.SubmitStrategyType; import org.thingsboard.server.common.msg.queue.ServiceType; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.QueueUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseQueueEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class QueueEdgeTest extends AbstractEdgeTest { @Test public void testQueues() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseRelationEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/RelationEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseRelationEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/RelationEdgeTest.java index 78e0d450ee..04e6f3a3fb 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseRelationEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/RelationEdgeTest.java @@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.id.EntityIdFactory; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.RelationTypeGroup; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.RelationRequestMsg; import org.thingsboard.server.gen.edge.v1.RelationUpdateMsg; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; @@ -33,7 +34,8 @@ import java.util.UUID; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseRelationEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class RelationEdgeTest extends AbstractEdgeTest { @Test diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseRuleChainEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/RuleChainEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseRuleChainEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/RuleChainEdgeTest.java index b376755f1a..6dec81e2e4 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseRuleChainEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/RuleChainEdgeTest.java @@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.common.data.rule.RuleChainMetaData; import org.thingsboard.server.common.data.rule.RuleChainType; import org.thingsboard.server.common.data.rule.RuleNode; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.RuleChainMetadataRequestMsg; import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg; import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg; @@ -37,7 +38,8 @@ import java.util.UUID; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseRuleChainEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class RuleChainEdgeTest extends AbstractEdgeTest { @Test public void testRuleChains() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseTelemetryEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/TelemetryEdgeTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/edge/BaseTelemetryEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/TelemetryEdgeTest.java index 9a5fe26782..448915c10d 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseTelemetryEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/TelemetryEdgeTest.java @@ -30,6 +30,7 @@ import org.thingsboard.server.common.data.edge.EdgeEvent; import org.thingsboard.server.common.data.edge.EdgeEventActionType; import org.thingsboard.server.common.data.edge.EdgeEventType; import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.AttributeDeleteMsg; import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg; import org.thingsboard.server.gen.edge.v1.EntityDataProto; @@ -39,7 +40,8 @@ import org.thingsboard.server.gen.transport.TransportProtos; import java.util.List; import java.util.concurrent.TimeUnit; -abstract public class BaseTelemetryEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class TelemetryEdgeTest extends AbstractEdgeTest { @Test public void testTimeseriesWithFailures() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseUserEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/UserEdgeTest.java similarity index 99% rename from application/src/test/java/org/thingsboard/server/edge/BaseUserEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/UserEdgeTest.java index f1d4427582..f376f50ac5 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseUserEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/UserEdgeTest.java @@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.edge.Edge; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import org.thingsboard.server.gen.edge.v1.UplinkMsg; import org.thingsboard.server.gen.edge.v1.UserCredentialsRequestMsg; @@ -35,7 +36,8 @@ import java.util.Optional; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseUserEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class UserEdgeTest extends AbstractEdgeTest { @Autowired private BCryptPasswordEncoder passwordEncoder; diff --git a/application/src/test/java/org/thingsboard/server/edge/BaseWidgetEdgeTest.java b/application/src/test/java/org/thingsboard/server/edge/WidgetEdgeTest.java similarity index 98% rename from application/src/test/java/org/thingsboard/server/edge/BaseWidgetEdgeTest.java rename to application/src/test/java/org/thingsboard/server/edge/WidgetEdgeTest.java index f5c5bc50e7..ba25d50f87 100644 --- a/application/src/test/java/org/thingsboard/server/edge/BaseWidgetEdgeTest.java +++ b/application/src/test/java/org/thingsboard/server/edge/WidgetEdgeTest.java @@ -22,13 +22,15 @@ import org.junit.Test; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.widget.WidgetType; import org.thingsboard.server.common.data.widget.WidgetsBundle; +import org.thingsboard.server.dao.service.DaoSqlTest; import org.thingsboard.server.gen.edge.v1.UpdateMsgType; import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg; import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -abstract public class BaseWidgetEdgeTest extends AbstractEdgeTest { +@DaoSqlTest +public class WidgetEdgeTest extends AbstractEdgeTest { @Test public void testWidgetsBundleAndWidgetType() throws Exception { diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/AlarmEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/AlarmEdgeSqlTest.java deleted file mode 100644 index 3e7a8a5338..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/AlarmEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseAlarmEdgeTest; - -@DaoSqlTest -public class AlarmEdgeSqlTest extends BaseAlarmEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/AssetEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/AssetEdgeSqlTest.java deleted file mode 100644 index 633b2755eb..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/AssetEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseAssetEdgeTest; - -@DaoSqlTest -public class AssetEdgeSqlTest extends BaseAssetEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/AssetProfileEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/AssetProfileEdgeSqlTest.java deleted file mode 100644 index fb534d538a..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/AssetProfileEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseAssetProfileEdgeTest; - -@DaoSqlTest -public class AssetProfileEdgeSqlTest extends BaseAssetProfileEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/CustomerEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/CustomerEdgeSqlTest.java deleted file mode 100644 index 8814cd6f6c..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/CustomerEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseCustomerEdgeTest; - -@DaoSqlTest -public class CustomerEdgeSqlTest extends BaseCustomerEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/DashboardEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/DashboardEdgeSqlTest.java deleted file mode 100644 index af5fdbd993..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/DashboardEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseDashboardEdgeTest; - -@DaoSqlTest -public class DashboardEdgeSqlTest extends BaseDashboardEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/DeviceEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/DeviceEdgeSqlTest.java deleted file mode 100644 index e7440c9f19..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/DeviceEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseDeviceEdgeTest; - -@DaoSqlTest -public class DeviceEdgeSqlTest extends BaseDeviceEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/DeviceProfileEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/DeviceProfileEdgeSqlTest.java deleted file mode 100644 index 6ccb459ba3..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/DeviceProfileEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseDeviceProfileEdgeTest; - -@DaoSqlTest -public class DeviceProfileEdgeSqlTest extends BaseDeviceProfileEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/EdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/EdgeSqlTest.java deleted file mode 100644 index bf8dd83cf1..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/EdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseEdgeTest; - -@DaoSqlTest -public class EdgeSqlTest extends BaseEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/EntityViewEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/EntityViewEdgeSqlTest.java deleted file mode 100644 index 2f9673098b..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/EntityViewEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseEntityViewEdgeTest; - -@DaoSqlTest -public class EntityViewEdgeSqlTest extends BaseEntityViewEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/OtaPackageEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/OtaPackageEdgeSqlTest.java deleted file mode 100644 index 8968f0715a..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/OtaPackageEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseOtaPackageEdgeTest; - -@DaoSqlTest -public class OtaPackageEdgeSqlTest extends BaseOtaPackageEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/QueueEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/QueueEdgeSqlTest.java deleted file mode 100644 index 74bc1e76a7..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/QueueEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseQueueEdgeTest; - -@DaoSqlTest -public class QueueEdgeSqlTest extends BaseQueueEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/RelationEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/RelationEdgeSqlTest.java deleted file mode 100644 index 029d7fde48..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/RelationEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseRelationEdgeTest; - -@DaoSqlTest -public class RelationEdgeSqlTest extends BaseRelationEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/RuleChainEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/RuleChainEdgeSqlTest.java deleted file mode 100644 index fc43df3267..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/RuleChainEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseRuleChainEdgeTest; - -@DaoSqlTest -public class RuleChainEdgeSqlTest extends BaseRuleChainEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/TelemetryEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/TelemetryEdgeSqlTest.java deleted file mode 100644 index f9c4360f46..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/TelemetryEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseTelemetryEdgeTest; - -@DaoSqlTest -public class TelemetryEdgeSqlTest extends BaseTelemetryEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/UserEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/UserEdgeSqlTest.java deleted file mode 100644 index 913e8c549f..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/UserEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseUserEdgeTest; - -@DaoSqlTest -public class UserEdgeSqlTest extends BaseUserEdgeTest { - -} diff --git a/application/src/test/java/org/thingsboard/server/edge/sql/WidgetEdgeSqlTest.java b/application/src/test/java/org/thingsboard/server/edge/sql/WidgetEdgeSqlTest.java deleted file mode 100644 index f47f8e1aa9..0000000000 --- a/application/src/test/java/org/thingsboard/server/edge/sql/WidgetEdgeSqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.edge.sql; - -import org.thingsboard.server.dao.service.DaoSqlTest; -import org.thingsboard.server.edge.BaseWidgetEdgeTest; - -@DaoSqlTest -public class WidgetEdgeSqlTest extends BaseWidgetEdgeTest { - -} diff --git a/common/actor/pom.xml b/common/actor/pom.xml index 2bc3335ded..eb8d354665 100644 --- a/common/actor/pom.xml +++ b/common/actor/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/cache/pom.xml b/common/cache/pom.xml index 9c887cd7cd..d2fba327a8 100644 --- a/common/cache/pom.xml +++ b/common/cache/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/cluster-api/pom.xml b/common/cluster-api/pom.xml index bd45c1c7ca..78abb6dbbf 100644 --- a/common/cluster-api/pom.xml +++ b/common/cluster-api/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/coap-server/pom.xml b/common/coap-server/pom.xml index a48a0c31bc..605fc111e0 100644 --- a/common/coap-server/pom.xml +++ b/common/coap-server/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/dao-api/pom.xml b/common/dao-api/pom.xml index 71f872b353..a497c38b10 100644 --- a/common/dao-api/pom.xml +++ b/common/dao-api/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/data/pom.xml b/common/data/pom.xml index d81203cd4d..f4d854f650 100644 --- a/common/data/pom.xml +++ b/common/data/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/edge-api/pom.xml b/common/edge-api/pom.xml index cf03facf55..e984020dae 100644 --- a/common/edge-api/pom.xml +++ b/common/edge-api/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/message/pom.xml b/common/message/pom.xml index ac7814bc49..71f95b4629 100644 --- a/common/message/pom.xml +++ b/common/message/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/pom.xml b/common/pom.xml index 812a05abaf..c9917b8915 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard common diff --git a/common/queue/pom.xml b/common/queue/pom.xml index 200867d022..b399ab7e60 100644 --- a/common/queue/pom.xml +++ b/common/queue/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/script/pom.xml b/common/script/pom.xml index 42593f033c..dea4ff1752 100644 --- a/common/script/pom.xml +++ b/common/script/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/script/remote-js-client/pom.xml b/common/script/remote-js-client/pom.xml index 8fbef37bdb..f9436e589d 100644 --- a/common/script/remote-js-client/pom.xml +++ b/common/script/remote-js-client/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT script org.thingsboard.common.script diff --git a/common/script/script-api/pom.xml b/common/script/script-api/pom.xml index 24cf7d832d..1cdc0ab1d5 100644 --- a/common/script/script-api/pom.xml +++ b/common/script/script-api/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT script org.thingsboard.common.script diff --git a/common/stats/pom.xml b/common/stats/pom.xml index 19243d9b28..4b86de63df 100644 --- a/common/stats/pom.xml +++ b/common/stats/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/transport/coap/pom.xml b/common/transport/coap/pom.xml index 14c105c3b7..97a9c26dfb 100644 --- a/common/transport/coap/pom.xml +++ b/common/transport/coap/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/http/pom.xml b/common/transport/http/pom.xml index b02491768e..d2f79a0386 100644 --- a/common/transport/http/pom.xml +++ b/common/transport/http/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/lwm2m/pom.xml b/common/transport/lwm2m/pom.xml index ddd8f227cf..0e4af32359 100644 --- a/common/transport/lwm2m/pom.xml +++ b/common/transport/lwm2m/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/mqtt/pom.xml b/common/transport/mqtt/pom.xml index ae0b35e44d..d28aa95fac 100644 --- a/common/transport/mqtt/pom.xml +++ b/common/transport/mqtt/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/pom.xml b/common/transport/pom.xml index 4f319abfad..b5423c073a 100644 --- a/common/transport/pom.xml +++ b/common/transport/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/transport/snmp/pom.xml b/common/transport/snmp/pom.xml index 30d14a4b28..3b6933aa0c 100644 --- a/common/transport/snmp/pom.xml +++ b/common/transport/snmp/pom.xml @@ -21,7 +21,7 @@ org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport diff --git a/common/transport/transport-api/pom.xml b/common/transport/transport-api/pom.xml index 26dde924f7..adccf65237 100644 --- a/common/transport/transport-api/pom.xml +++ b/common/transport/transport-api/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.common - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/util/pom.xml b/common/util/pom.xml index 79d2d6a064..02a11b49aa 100644 --- a/common/util/pom.xml +++ b/common/util/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/common/version-control/pom.xml b/common/version-control/pom.xml index 381f4ed292..7ba6157a5e 100644 --- a/common/version-control/pom.xml +++ b/common/version-control/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT common org.thingsboard.common diff --git a/dao/pom.xml b/dao/pom.xml index 4fc8a3c08d..df84635006 100644 --- a/dao/pom.xml +++ b/dao/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard dao diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java b/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java index 9109312ec8..b684664587 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java +++ b/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java @@ -58,9 +58,8 @@ public class ModelConstants { public static final String LAST_UPDATE_TS_COLUMN = "last_update_ts"; /** - * Cassandra user constants. + * User constants. */ - public static final String USER_COLUMN_FAMILY_NAME = "user"; public static final String USER_PG_HIBERNATE_COLUMN_FAMILY_NAME = "tb_user"; public static final String USER_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String USER_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; @@ -70,12 +69,8 @@ public class ModelConstants { public static final String USER_LAST_NAME_PROPERTY = "last_name"; public static final String USER_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; - public static final String USER_BY_EMAIL_COLUMN_FAMILY_NAME = "user_by_email"; - public static final String USER_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "user_by_tenant_and_search_text"; - public static final String USER_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "user_by_customer_and_search_text"; - /** - * Cassandra user_credentials constants. + * User_credentials constants. */ public static final String USER_CREDENTIALS_COLUMN_FAMILY_NAME = "user_credentials"; public static final String USER_CREDENTIALS_USER_ID_PROPERTY = USER_ID_PROPERTY; @@ -85,10 +80,6 @@ public class ModelConstants { public static final String USER_CREDENTIALS_RESET_TOKEN_PROPERTY = "reset_token"; public static final String USER_CREDENTIALS_ADDITIONAL_PROPERTY = "additional_info"; - public static final String USER_CREDENTIALS_BY_USER_COLUMN_FAMILY_NAME = "user_credentials_by_user"; - public static final String USER_CREDENTIALS_BY_ACTIVATE_TOKEN_COLUMN_FAMILY_NAME = "user_credentials_by_activate_token"; - public static final String USER_CREDENTIALS_BY_RESET_TOKEN_COLUMN_FAMILY_NAME = "user_credentials_by_reset_token"; - /** * User settings constants. */ @@ -98,7 +89,7 @@ public class ModelConstants { public static final String USER_SETTINGS_SETTINGS = "settings"; /** - * Cassandra admin_settings constants. + * Admin_settings constants. */ public static final String ADMIN_SETTINGS_COLUMN_FAMILY_NAME = "admin_settings"; @@ -106,10 +97,8 @@ public class ModelConstants { public static final String ADMIN_SETTINGS_KEY_PROPERTY = "key"; public static final String ADMIN_SETTINGS_JSON_VALUE_PROPERTY = "json_value"; - public static final String ADMIN_SETTINGS_BY_KEY_COLUMN_FAMILY_NAME = "admin_settings_by_key"; - /** - * Cassandra contact constants. + * Contact constants. */ public static final String COUNTRY_PROPERTY = "country"; public static final String STATE_PROPERTY = "state"; @@ -121,7 +110,7 @@ public class ModelConstants { public static final String EMAIL_PROPERTY = "email"; /** - * Cassandra tenant constants. + * Tenant constants. */ public static final String TENANT_COLUMN_FAMILY_NAME = "tenant"; public static final String TENANT_TITLE_PROPERTY = TITLE_PROPERTY; @@ -129,8 +118,6 @@ public class ModelConstants { public static final String TENANT_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; public static final String TENANT_TENANT_PROFILE_ID_PROPERTY = "tenant_profile_id"; - public static final String TENANT_BY_REGION_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "tenant_by_region_and_search_text"; - /** * Tenant profile constants. */ @@ -139,25 +126,20 @@ public class ModelConstants { public static final String TENANT_PROFILE_PROFILE_DATA_PROPERTY = "profile_data"; public static final String TENANT_PROFILE_DESCRIPTION_PROPERTY = "description"; public static final String TENANT_PROFILE_IS_DEFAULT_PROPERTY = "is_default"; - public static final String TENANT_PROFILE_ISOLATED_TB_CORE = "isolated_tb_core"; public static final String TENANT_PROFILE_ISOLATED_TB_RULE_ENGINE = "isolated_tb_rule_engine"; /** - * Cassandra customer constants. + * Customer constants. */ public static final String CUSTOMER_COLUMN_FAMILY_NAME = "customer"; public static final String CUSTOMER_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String CUSTOMER_TITLE_PROPERTY = TITLE_PROPERTY; public static final String CUSTOMER_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; - public static final String CUSTOMER_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "customer_by_tenant_and_search_text"; - public static final String CUSTOMER_BY_TENANT_AND_TITLE_VIEW_NAME = "customer_by_tenant_and_title"; - /** - * Cassandra device constants. + * Device constants. */ public static final String DEVICE_COLUMN_FAMILY_NAME = "device"; - public static final String DEVICE_FAMILY_NAME = "device"; public static final String DEVICE_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String DEVICE_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; public static final String DEVICE_NAME_PROPERTY = "name"; @@ -174,13 +156,6 @@ public class ModelConstants { public static final String DEVICE_DEVICE_PROFILE_NAME_PROPERTY = "device_profile_name"; public static final String DEVICE_ACTIVE_PROPERTY = "active"; - public static final String DEVICE_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_tenant_and_search_text"; - public static final String DEVICE_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_tenant_by_type_and_search_text"; - public static final String DEVICE_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_customer_and_search_text"; - public static final String DEVICE_BY_CUSTOMER_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_customer_by_type_and_search_text"; - public static final String DEVICE_BY_TENANT_AND_NAME_VIEW_NAME = "device_by_tenant_and_name"; - public static final String DEVICE_TYPES_BY_TENANT_VIEW_NAME = "device_types_by_tenant"; - public static final String DEVICE_INFO_VIEW_COLUMN_FAMILY_NAME = "device_info_view"; /** @@ -198,7 +173,6 @@ public class ModelConstants { public static final String DEVICE_PROFILE_IS_DEFAULT_PROPERTY = "is_default"; public static final String DEVICE_PROFILE_DEFAULT_RULE_CHAIN_ID_PROPERTY = "default_rule_chain_id"; public static final String DEVICE_PROFILE_DEFAULT_DASHBOARD_ID_PROPERTY = "default_dashboard_id"; - public static final String DEVICE_PROFILE_DEFAULT_QUEUE_ID_PROPERTY = "default_queue_id"; public static final String DEVICE_PROFILE_DEFAULT_QUEUE_NAME_PROPERTY = "default_queue_name"; public static final String DEVICE_PROFILE_PROVISION_DEVICE_KEY = "provision_device_key"; public static final String DEVICE_PROFILE_FIRMWARE_ID_PROPERTY = "firmware_id"; @@ -220,44 +194,28 @@ public class ModelConstants { public static final String ASSET_PROFILE_DEFAULT_EDGE_RULE_CHAIN_ID_PROPERTY = "default_edge_rule_chain_id"; /** - * Cassandra entityView constants. + * Entity view constants. */ public static final String ENTITY_VIEW_TABLE_FAMILY_NAME = "entity_view"; public static final String ENTITY_VIEW_ENTITY_ID_PROPERTY = ENTITY_ID_COLUMN; public static final String ENTITY_VIEW_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String ENTITY_VIEW_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; public static final String ENTITY_VIEW_NAME_PROPERTY = DEVICE_NAME_PROPERTY; - public static final String ENTITY_VIEW_BY_TENANT_AND_CUSTOMER_CF = "entity_view_by_tenant_and_customer"; - public static final String ENTITY_VIEW_BY_TENANT_AND_CUSTOMER_AND_TYPE_CF = "entity_view_by_tenant_and_customer_and_type"; - public static final String ENTITY_VIEW_BY_TENANT_AND_ENTITY_ID_CF = "entity_view_by_tenant_and_entity_id"; public static final String ENTITY_VIEW_KEYS_PROPERTY = "keys"; - public static final String ENTITY_VIEW_TYPE_PROPERTY = "type"; public static final String ENTITY_VIEW_START_TS_PROPERTY = "start_ts"; public static final String ENTITY_VIEW_END_TS_PROPERTY = "end_ts"; public static final String ENTITY_VIEW_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; - public static final String ENTITY_VIEW_BY_TENANT_AND_SEARCH_TEXT_CF = "entity_view_by_tenant_and_search_text"; - public static final String ENTITY_VIEW_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_CF = "entity_view_by_tenant_by_type_and_search_text"; - public static final String ENTITY_VIEW_BY_TENANT_AND_NAME = "entity_view_by_tenant_and_name"; /** - * Cassandra audit log constants. + * Audit log constants. */ public static final String AUDIT_LOG_COLUMN_FAMILY_NAME = "audit_log"; - - public static final String AUDIT_LOG_BY_ENTITY_ID_CF = "audit_log_by_entity_id"; - public static final String AUDIT_LOG_BY_CUSTOMER_ID_CF = "audit_log_by_customer_id"; - public static final String AUDIT_LOG_BY_USER_ID_CF = "audit_log_by_user_id"; - public static final String AUDIT_LOG_BY_TENANT_ID_CF = "audit_log_by_tenant_id"; - public static final String AUDIT_LOG_BY_TENANT_ID_PARTITIONS_CF = "audit_log_by_tenant_id_partitions"; - - public static final String AUDIT_LOG_ID_PROPERTY = ID_PROPERTY; public static final String AUDIT_LOG_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String AUDIT_LOG_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; public static final String AUDIT_LOG_ENTITY_TYPE_PROPERTY = ENTITY_TYPE_PROPERTY; public static final String AUDIT_LOG_ENTITY_ID_PROPERTY = ENTITY_ID_COLUMN; public static final String AUDIT_LOG_ENTITY_NAME_PROPERTY = "entity_name"; public static final String AUDIT_LOG_USER_ID_PROPERTY = USER_ID_PROPERTY; - public static final String AUDIT_LOG_PARTITION_PROPERTY = "partition"; public static final String AUDIT_LOG_USER_NAME_PROPERTY = "user_name"; public static final String AUDIT_LOG_ACTION_TYPE_PROPERTY = "action_type"; public static final String AUDIT_LOG_ACTION_DATA_PROPERTY = "action_data"; @@ -265,7 +223,7 @@ public class ModelConstants { public static final String AUDIT_LOG_ACTION_FAILURE_DETAILS_PROPERTY = "action_failure_details"; /** - * Cassandra asset constants. + * Asset constants. */ public static final String ASSET_COLUMN_FAMILY_NAME = "asset"; public static final String ASSET_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -277,23 +235,8 @@ public class ModelConstants { public static final String ASSET_ASSET_PROFILE_ID_PROPERTY = "asset_profile_id"; - public static final String ASSET_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "asset_by_tenant_and_search_text"; - public static final String ASSET_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "asset_by_tenant_by_type_and_search_text"; - public static final String ASSET_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "asset_by_customer_and_search_text"; - public static final String ASSET_BY_CUSTOMER_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "asset_by_customer_by_type_and_search_text"; - public static final String ASSET_BY_TENANT_AND_NAME_VIEW_NAME = "asset_by_tenant_and_name"; - public static final String ASSET_TYPES_BY_TENANT_VIEW_NAME = "asset_types_by_tenant"; - - /** - * Cassandra entity_subtype constants. - */ - public static final String ENTITY_SUBTYPE_COLUMN_FAMILY_NAME = "entity_subtype"; - public static final String ENTITY_SUBTYPE_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; - public static final String ENTITY_SUBTYPE_ENTITY_TYPE_PROPERTY = ENTITY_TYPE_PROPERTY; - public static final String ENTITY_SUBTYPE_TYPE_PROPERTY = "type"; - /** - * Cassandra alarm constants. + * Alarm constants. */ public static final String ENTITY_ALARM_COLUMN_FAMILY_NAME = "entity_alarm"; public static final String ALARM_COLUMN_FAMILY_NAME = "alarm"; @@ -324,12 +267,6 @@ public class ModelConstants { public static final String ALARM_PROPAGATE_TO_TENANT_PROPERTY = "propagate_to_tenant"; public static final String ALARM_PROPAGATE_RELATION_TYPES = "propagate_relation_types"; - public static final String ALARM_OPERATION_RESULT_PROPERTY = "operation_result"; - - public static final String ALARM_BY_ID_VIEW_NAME = "alarm_by_id"; - - public static final String ALARM_COMMENT_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; - public static final String ALARM_COMMENT_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; public static final String ALARM_COMMENT_COLUMN_FAMILY_NAME = "alarm_comment"; public static final String ALARM_COMMENT_ALARM_ID = "alarm_id"; public static final String ALARM_COMMENT_USER_ID = USER_ID_PROPERTY; @@ -337,7 +274,7 @@ public class ModelConstants { public static final String ALARM_COMMENT_COMMENT = "comment"; /** - * Cassandra entity relation constants. + * Entity relation constants. */ public static final String RELATION_COLUMN_FAMILY_NAME = "relation"; public static final String RELATION_FROM_ID_PROPERTY = "from_id"; @@ -347,12 +284,8 @@ public class ModelConstants { public static final String RELATION_TYPE_PROPERTY = "relation_type"; public static final String RELATION_TYPE_GROUP_PROPERTY = "relation_type_group"; - public static final String RELATION_BY_TYPE_AND_CHILD_TYPE_VIEW_NAME = "relation_by_type_and_child_type"; - public static final String RELATION_REVERSE_VIEW_NAME = "reverse_relation"; - - /** - * Cassandra device_credentials constants. + * Device_credentials constants. */ public static final String DEVICE_CREDENTIALS_COLUMN_FAMILY_NAME = "device_credentials"; public static final String DEVICE_CREDENTIALS_DEVICE_ID_PROPERTY = DEVICE_ID_PROPERTY; @@ -360,11 +293,8 @@ public class ModelConstants { public static final String DEVICE_CREDENTIALS_CREDENTIALS_ID_PROPERTY = "credentials_id"; public static final String DEVICE_CREDENTIALS_CREDENTIALS_VALUE_PROPERTY = "credentials_value"; - public static final String DEVICE_CREDENTIALS_BY_DEVICE_COLUMN_FAMILY_NAME = "device_credentials_by_device"; - public static final String DEVICE_CREDENTIALS_BY_CREDENTIALS_ID_COLUMN_FAMILY_NAME = "device_credentials_by_credentials_id"; - /** - * Cassandra widgets_bundle constants. + * Widgets_bundle constants. */ public static final String WIDGETS_BUNDLE_COLUMN_FAMILY_NAME = "widgets_bundle"; public static final String WIDGETS_BUNDLE_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -373,11 +303,8 @@ public class ModelConstants { public static final String WIDGETS_BUNDLE_IMAGE_PROPERTY = "image"; public static final String WIDGETS_BUNDLE_DESCRIPTION = "description"; - public static final String WIDGETS_BUNDLE_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "widgets_bundle_by_tenant_and_search_text"; - public static final String WIDGETS_BUNDLE_BY_TENANT_AND_ALIAS_COLUMN_FAMILY_NAME = "widgets_bundle_by_tenant_and_alias"; - /** - * Cassandra widget_type constants. + * Widget_type constants. */ public static final String WIDGET_TYPE_COLUMN_FAMILY_NAME = "widget_type"; public static final String WIDGET_TYPE_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -388,10 +315,8 @@ public class ModelConstants { public static final String WIDGET_TYPE_DESCRIPTION_PROPERTY = "description"; public static final String WIDGET_TYPE_DESCRIPTOR_PROPERTY = "descriptor"; - public static final String WIDGET_TYPE_BY_TENANT_AND_ALIASES_COLUMN_FAMILY_NAME = "widget_type_by_tenant_and_aliases"; - /** - * Cassandra dashboard constants. + * Dashboard constants. */ public static final String DASHBOARD_COLUMN_FAMILY_NAME = "dashboard"; public static final String DASHBOARD_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -402,10 +327,8 @@ public class ModelConstants { public static final String DASHBOARD_MOBILE_HIDE_PROPERTY = "mobile_hide"; public static final String DASHBOARD_MOBILE_ORDER_PROPERTY = "mobile_order"; - public static final String DASHBOARD_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "dashboard_by_tenant_and_search_text"; - /** - * Cassandra plugin component metadata constants. + * Plugin component metadata constants. */ public static final String COMPONENT_DESCRIPTOR_COLUMN_FAMILY_NAME = "component_descriptor"; public static final String COMPONENT_DESCRIPTOR_TYPE_PROPERTY = "type"; @@ -416,12 +339,8 @@ public class ModelConstants { public static final String COMPONENT_DESCRIPTOR_CONFIGURATION_DESCRIPTOR_PROPERTY = "configuration_descriptor"; public static final String COMPONENT_DESCRIPTOR_ACTIONS_PROPERTY = "actions"; - public static final String COMPONENT_DESCRIPTOR_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "component_desc_by_type_search_text"; - public static final String COMPONENT_DESCRIPTOR_BY_SCOPE_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "component_desc_by_scope_type_search_text"; - public static final String COMPONENT_DESCRIPTOR_BY_ID = "component_desc_by_id"; - /** - * Cassandra event constants. + * Event constants. */ public static final String ERROR_EVENT_TABLE_NAME = "error_event"; public static final String LC_EVENT_TABLE_NAME = "lc_event"; @@ -432,7 +351,6 @@ public class ModelConstants { public static final String EVENT_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String EVENT_SERVICE_ID_PROPERTY = "service_id"; public static final String EVENT_ENTITY_ID_PROPERTY = "entity_id"; - public static final String EVENT_BODY_PROPERTY = "body"; public static final String EVENT_MESSAGES_PROCESSED_COLUMN_NAME = "e_messages_processed"; public static final String EVENT_ERRORS_OCCURRED_COLUMN_NAME = "e_errors_occurred"; @@ -457,7 +375,7 @@ public class ModelConstants { public static final String SINGLETON_MODE = "singleton_mode"; /** - * Cassandra rule chain constants. + * Rule chain constants. */ public static final String RULE_CHAIN_COLUMN_FAMILY_NAME = "rule_chain"; public static final String RULE_CHAIN_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -467,11 +385,8 @@ public class ModelConstants { public static final String RULE_CHAIN_ROOT_PROPERTY = "root"; public static final String RULE_CHAIN_CONFIGURATION_PROPERTY = "configuration"; - public static final String RULE_CHAIN_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "rule_chain_by_tenant_and_search_text"; - public static final String RULE_CHAIN_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "rule_chain_by_tenant_by_type_and_search_text"; - /** - * Cassandra rule node constants. + * Rule node constants. */ public static final String RULE_NODE_COLUMN_FAMILY_NAME = "rule_node"; public static final String RULE_NODE_CHAIN_ID_PROPERTY = "rule_chain_id"; @@ -480,7 +395,7 @@ public class ModelConstants { public static final String RULE_NODE_CONFIGURATION_PROPERTY = "configuration"; /** - * Rule node state constants. + * Node state constants. */ public static final String RULE_NODE_STATE_TABLE_NAME = "rule_node_state"; public static final String RULE_NODE_STATE_NODE_ID_PROPERTY = "rule_node_id"; @@ -491,7 +406,6 @@ public class ModelConstants { /** * OAuth2 client registration constants. */ - public static final String OAUTH2_PARAMS_COLUMN_FAMILY_NAME = "oauth2_params"; public static final String OAUTH2_PARAMS_ENABLED_PROPERTY = "enabled"; public static final String OAUTH2_PARAMS_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; @@ -503,12 +417,8 @@ public class ModelConstants { public static final String OAUTH2_PKG_NAME_PROPERTY = "pkg_name"; public static final String OAUTH2_APP_SECRET_PROPERTY = "app_secret"; - public static final String OAUTH2_CLIENT_REGISTRATION_INFO_COLUMN_FAMILY_NAME = "oauth2_client_registration_info"; - public static final String OAUTH2_CLIENT_REGISTRATION_COLUMN_FAMILY_NAME = "oauth2_client_registration"; public static final String OAUTH2_CLIENT_REGISTRATION_TEMPLATE_COLUMN_FAMILY_NAME = "oauth2_client_registration_template"; - public static final String OAUTH2_ENABLED_PROPERTY = "enabled"; public static final String OAUTH2_TEMPLATE_PROVIDER_ID_PROPERTY = "provider_id"; - public static final String OAUTH2_CLIENT_REGISTRATION_INFO_ID_PROPERTY = "client_registration_info_id"; public static final String OAUTH2_DOMAIN_NAME_PROPERTY = "domain_name"; public static final String OAUTH2_DOMAIN_SCHEME_PROPERTY = "domain_scheme"; public static final String OAUTH2_CLIENT_ID_PROPERTY = "client_id"; @@ -613,12 +523,6 @@ public class ModelConstants { public static final String EDGE_LABEL_PROPERTY = "label"; public static final String EDGE_TYPE_PROPERTY = "type"; public static final String EDGE_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; - public static final String EDGE_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "edge_by_tenant_and_search_text"; - public static final String EDGE_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "edge_by_tenant_by_type_and_search_text"; - public static final String EDGE_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "edge_by_customer_and_search_text"; - public static final String EDGE_BY_CUSTOMER_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "edge_by_customer_by_type_and_search_text"; - public static final String EDGE_BY_TENANT_AND_NAME_VIEW_NAME = "edge_by_tenant_and_name"; - public static final String EDGE_BY_ROUTING_KEY_VIEW_NAME = "edge_by_routing_key"; public static final String EDGE_ROUTING_KEY_PROPERTY = "routing_key"; public static final String EDGE_SECRET_PROPERTY = "secret"; @@ -635,13 +539,11 @@ public class ModelConstants { public static final String EDGE_EVENT_ENTITY_ID_PROPERTY = "entity_id"; public static final String EDGE_EVENT_BODY_PROPERTY = "body"; - public static final String EDGE_EVENT_BY_ID_VIEW_NAME = "edge_event_by_id"; - public static final String EXTERNAL_ID_PROPERTY = "external_id"; /** * User auth settings constants. - * */ + */ public static final String USER_AUTH_SETTINGS_COLUMN_FAMILY_NAME = "user_auth_settings"; public static final String USER_AUTH_SETTINGS_USER_ID_PROPERTY = USER_ID_PROPERTY; public static final String USER_AUTH_SETTINGS_TWO_FA_SETTINGS = "two_fa_settings"; @@ -649,7 +551,6 @@ public class ModelConstants { /** * Cassandra attributes and timeseries constants. */ - public static final String ATTRIBUTES_KV_CF = "attributes_kv_cf"; public static final String TS_KV_CF = "ts_kv_cf"; public static final String TS_KV_PARTITIONS_CF = "ts_kv_partitions_cf"; public static final String TS_KV_LATEST_CF = "ts_kv_latest_cf"; @@ -671,7 +572,6 @@ public class ModelConstants { /** * Queue constants. */ - public static final String QUEUE_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; public static final String QUEUE_NAME_PROPERTY = "name"; public static final String QUEUE_TOPIC_PROPERTY = "topic"; @@ -684,11 +584,9 @@ public class ModelConstants { public static final String QUEUE_COLUMN_FAMILY_NAME = "queue"; public static final String QUEUE_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; - /** * Notification constants - * */ - + */ public static final String NOTIFICATION_TARGET_TABLE_NAME = "notification_target"; public static final String NOTIFICATION_TARGET_CONFIGURATION_PROPERTY = "configuration"; diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java index 40867951ca..92537dc850 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java @@ -19,7 +19,6 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import org.springframework.data.jpa.repository.query.Procedure; import org.springframework.data.repository.query.Param; import org.thingsboard.server.common.data.alarm.AlarmSeverity; import org.thingsboard.server.dao.model.sql.AlarmEntity; @@ -316,7 +315,9 @@ public interface AlarmRepository extends JpaRepository { @Query(value = "SELECT a FROM AlarmInfoEntity a WHERE a.tenantId = :tenantId AND a.id = :alarmId") AlarmInfoEntity findAlarmInfoById(@Param("tenantId") UUID tenantId, @Param("alarmId") UUID alarmId); - @Procedure(procedureName = "create_or_update_active_alarm") + @Query(value = "SELECT create_or_update_active_alarm(:t_id, :c_id, :a_id, :a_created_ts, :a_o_id, :a_o_type, :a_type, :a_severity, " + + ":a_start_ts, :a_end_ts, :a_details, :a_propagate, :a_propagate_to_owner, " + + ":a_propagate_to_tenant, :a_propagation_types, :a_creation_enabled)", nativeQuery = true) String createOrUpdateActiveAlarm(@Param("t_id") UUID tenantId, @Param("c_id") UUID customerId, @Param("a_id") UUID alarmId, @Param("a_created_ts") long createdTime, @Param("a_o_id") UUID originatorId, @Param("a_o_type") int originatorType, @@ -326,21 +327,22 @@ public interface AlarmRepository extends JpaRepository { @Param("a_propagate_to_tenant") boolean propagateToTenant, @Param("a_propagation_types") String propagationTypes, @Param("a_creation_enabled") boolean alarmCreationEnabled); - @Procedure(procedureName = "update_alarm") + @Query(value = "SELECT update_alarm(:t_id, :a_id, :a_severity, :a_start_ts, :a_end_ts, :a_details, :a_propagate, :a_propagate_to_owner, " + + ":a_propagate_to_tenant, :a_propagation_types)", nativeQuery = true) String updateAlarm(@Param("t_id") UUID tenantId, @Param("a_id") UUID alarmId, @Param("a_severity") String severity, @Param("a_start_ts") long startTs, @Param("a_end_ts") long endTs, @Param("a_details") String detailsAsString, @Param("a_propagate") boolean propagate, @Param("a_propagate_to_owner") boolean propagateToOwner, @Param("a_propagate_to_tenant") boolean propagateToTenant, @Param("a_propagation_types") String propagationTypes); - @Procedure(procedureName = "acknowledge_alarm") + @Query(value = "SELECT acknowledge_alarm(:t_id, :a_id, :a_ts)", nativeQuery = true) String acknowledgeAlarm(@Param("t_id") UUID tenantId, @Param("a_id") UUID alarmId, @Param("a_ts") long ts); - @Procedure(procedureName = "clear_alarm") + @Query(value = "SELECT clear_alarm(:t_id, :a_id, :a_ts, :a_details)", nativeQuery = true) String clearAlarm(@Param("t_id") UUID tenantId, @Param("a_id") UUID alarmId, @Param("a_ts") long ts, @Param("a_details") String details); - @Procedure(procedureName = "assign_alarm") + @Query(value = "SELECT assign_alarm(:t_id, :a_id, :u_id, :a_ts)", nativeQuery = true) String assignAlarm(@Param("t_id") UUID tenantId, @Param("a_id") UUID alarmId, @Param("u_id") UUID userId, @Param("a_ts") long assignTime); - @Procedure(procedureName = "unassign_alarm") + @Query(value = "SELECT unassign_alarm(:t_id, :a_id, :a_ts)", nativeQuery = true) String unassignAlarm(@Param("t_id") UUID tenantId, @Param("a_id") UUID alarmId, @Param("a_ts") long unassignTime); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/sqlts/insert/sql/SqlPartitioningRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sqlts/insert/sql/SqlPartitioningRepository.java index 75778a347c..60614e8c90 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sqlts/insert/sql/SqlPartitioningRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sqlts/insert/sql/SqlPartitioningRepository.java @@ -110,9 +110,12 @@ public class SqlPartitioningRepository { String tablePartition = table + "_" + partitionTs; String detachPsqlStmtStr = "ALTER TABLE " + table + " DETACH PARTITION " + tablePartition; - if (getCurrentServerVersion() >= PSQL_VERSION_14) { - detachPsqlStmtStr += " CONCURRENTLY"; - } + + // hotfix of ERROR: partition "integration_debug_event_1678323600000" already pending detach in partitioned table "public.integration_debug_event" + // https://github.com/thingsboard/thingsboard/issues/8271 + // if (getCurrentServerVersion() >= PSQL_VERSION_14) { + // detachPsqlStmtStr += " CONCURRENTLY"; + // } String dropStmtStr = "DROP TABLE " + tablePartition; try { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AdminSettingsServiceTest.java similarity index 98% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/AdminSettingsServiceTest.java index 772644bab8..91675213ea 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AdminSettingsServiceTest.java @@ -31,7 +31,8 @@ import org.thingsboard.server.dao.settings.AdminSettingsService; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -public abstract class BaseAdminSettingsServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class AdminSettingsServiceTest extends AbstractServiceTest { @Autowired AdminSettingsService adminSettingsService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmCommentServiceTest.java similarity index 98% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/AlarmCommentServiceTest.java index e79e00515b..22257242f5 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmCommentServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmCommentServiceTest.java @@ -43,7 +43,8 @@ import java.util.concurrent.ExecutionException; import static org.thingsboard.server.common.data.alarm.AlarmCommentType.OTHER; -public abstract class BaseAlarmCommentServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class AlarmCommentServiceTest extends AbstractServiceTest { @Autowired AlarmService alarmService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java index e5b245d7b6..5b0981b44a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java @@ -62,7 +62,8 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; -public abstract class BaseAlarmServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class AlarmServiceTest extends AbstractServiceTest { @Autowired AlarmService alarmService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/ApiUsageStateServiceTest.java similarity index 95% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/ApiUsageStateServiceTest.java index 7d6ce291aa..1db42409d6 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseApiUsageStateServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/ApiUsageStateServiceTest.java @@ -23,7 +23,8 @@ import org.thingsboard.server.common.data.ApiUsageStateValue; import org.thingsboard.server.dao.usagerecord.ApiUsageStateService; -public abstract class BaseApiUsageStateServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class ApiUsageStateServiceTest extends AbstractServiceTest { @Autowired ApiUsageStateService apiUsageStateService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AssetProfileServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/AssetProfileServiceTest.java index 02bf4b1b1a..391c00fa49 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AssetProfileServiceTest.java @@ -40,7 +40,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.stream.Collectors; -public abstract class BaseAssetProfileServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class AssetProfileServiceTest extends AbstractServiceTest { private IdComparator idComparator = new IdComparator<>(); private IdComparator assetProfileInfoIdComparator = new IdComparator<>(); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AssetServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/AssetServiceTest.java index 3f9c94ca14..eb6feee500 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AssetServiceTest.java @@ -40,7 +40,8 @@ import java.util.List; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; -public abstract class BaseAssetServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class AssetServiceTest extends AbstractServiceTest { @Autowired AssetService assetService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/CustomerServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/CustomerServiceTest.java index 51953e89ff..3256d231ad 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/CustomerServiceTest.java @@ -41,7 +41,8 @@ import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThat; -public abstract class BaseCustomerServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class CustomerServiceTest extends AbstractServiceTest { @Autowired CustomerService customerService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DashboardServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/DashboardServiceTest.java index 7ccd5e6211..4cc9962f60 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DashboardServiceTest.java @@ -43,7 +43,8 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutionException; -public abstract class BaseDashboardServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class DashboardServiceTest extends AbstractServiceTest { @Autowired CustomerService customerService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsCacheTest.java similarity index 98% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsCacheTest.java index 7fc9f7b218..44119af87a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsCacheTest.java @@ -41,7 +41,8 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest { +@DaoSqlTest +public class DeviceCredentialsCacheTest extends AbstractServiceTest { private final String CREDENTIALS_ID_1 = StringUtils.randomAlphanumeric(20); private final String CREDENTIALS_ID_2 = StringUtils.randomAlphanumeric(20); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsServiceTest.java index 4512a5fa4f..ad260977fd 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceCredentialsServiceTest.java @@ -29,7 +29,8 @@ import org.thingsboard.server.dao.device.DeviceCredentialsService; import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.exception.DataValidationException; -public abstract class BaseDeviceCredentialsServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class DeviceCredentialsServiceTest extends AbstractServiceTest { @Autowired DeviceCredentialsService deviceCredentialsService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceProfileServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/DeviceProfileServiceTest.java index fa43d98374..16a80e438d 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceProfileServiceTest.java @@ -49,7 +49,8 @@ import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; -public abstract class BaseDeviceProfileServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class DeviceProfileServiceTest extends AbstractServiceTest { @Autowired DeviceProfileService deviceProfileService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java index cb46e27c81..b35d97f730 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java @@ -57,7 +57,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; -public abstract class BaseDeviceServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class DeviceServiceTest extends AbstractServiceTest { @Autowired CustomerService customerService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/EdgeEventServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/EdgeEventServiceTest.java index 3b942dab5f..63958fe1e4 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeEventServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/EdgeEventServiceTest.java @@ -42,7 +42,8 @@ import java.util.List; import static org.apache.commons.lang3.time.DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT; -public abstract class BaseEdgeEventServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class EdgeEventServiceTest extends AbstractServiceTest { @Autowired EdgeEventService edgeEventService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/EdgeServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/EdgeServiceTest.java index 9b307b2f8c..5e632a7816 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEdgeServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/EdgeServiceTest.java @@ -47,7 +47,8 @@ import java.util.List; import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID; -public abstract class BaseEdgeServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class EdgeServiceTest extends AbstractServiceTest { @Autowired CustomerService customerService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceRegistryTest.java similarity index 95% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceRegistryTest.java index 87b6bbdd80..e46cc96201 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceRegistryTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceRegistryTest.java @@ -25,7 +25,8 @@ import org.thingsboard.server.dao.entity.EntityServiceRegistry; import org.thingsboard.server.dao.rule.RuleChainService; @Slf4j -public abstract class BaseEntityServiceRegistryTest extends AbstractServiceTest { +@DaoSqlTest +public class EntityServiceRegistryTest extends AbstractServiceTest { @Autowired EntityServiceRegistry entityServiceRegistry; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceTest.java index 5ec546cd4e..77f5e87020 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/EntityServiceTest.java @@ -97,7 +97,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; @Slf4j -public abstract class BaseEntityServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class EntityServiceTest extends AbstractServiceTest { static final int ENTITY_COUNT = 5; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ConfigTemplateServiceTest.java similarity index 98% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ConfigTemplateServiceTest.java index df903f4137..f5403f4d13 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ConfigTemplateServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ConfigTemplateServiceTest.java @@ -31,7 +31,8 @@ import org.thingsboard.server.dao.oauth2.OAuth2ConfigTemplateService; import java.util.Arrays; import java.util.UUID; -public abstract class BaseOAuth2ConfigTemplateServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class OAuth2ConfigTemplateServiceTest extends AbstractServiceTest { @Autowired protected OAuth2ConfigTemplateService oAuth2ConfigTemplateService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ServiceTest.java index 73dd08d53c..86e4e2beed 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOAuth2ServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/OAuth2ServiceTest.java @@ -44,7 +44,8 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; -public abstract class BaseOAuth2ServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class OAuth2ServiceTest extends AbstractServiceTest { private static final OAuth2Info EMPTY_PARAMS = new OAuth2Info(false, Collections.emptyList()); @Autowired diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/OtaPackageServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/OtaPackageServiceTest.java index d430e1945a..85dc7cd7f0 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseOtaPackageServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/OtaPackageServiceTest.java @@ -49,7 +49,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.thingsboard.server.common.data.ota.OtaPackageType.FIRMWARE; -public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class OtaPackageServiceTest extends AbstractServiceTest { public static final String TITLE = "My firmware"; private static final String FILE_NAME = "filename.txt"; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/QueueServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/QueueServiceTest.java index 9d2c2bac5a..82144addd8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseQueueServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/QueueServiceTest.java @@ -43,7 +43,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public abstract class BaseQueueServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class QueueServiceTest extends AbstractServiceTest { @Autowired TenantProfileService tenantProfileService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/RelationCacheTest.java similarity index 98% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/RelationCacheTest.java index 8c3e7bd1fc..b8bbfb4513 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/RelationCacheTest.java @@ -39,7 +39,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.thingsboard.server.common.data.CacheConstants.RELATIONS_CACHE; -public abstract class BaseRelationCacheTest extends AbstractServiceTest { +@DaoSqlTest +public class RelationCacheTest extends AbstractServiceTest { private static final EntityId ENTITY_ID_FROM = new DeviceId(UUID.randomUUID()); private static final EntityId ENTITY_ID_TO = new DeviceId(UUID.randomUUID()); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/RelationServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/RelationServiceTest.java index d60a896aec..3bbb71306b 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/RelationServiceTest.java @@ -42,7 +42,8 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.ExecutionException; -public abstract class BaseRelationServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class RelationServiceTest extends AbstractServiceTest { @Autowired RelationService relationService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/RuleChainServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/RuleChainServiceTest.java index 419cdef570..9fafa1a258 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRuleChainServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/RuleChainServiceTest.java @@ -44,7 +44,8 @@ import java.util.List; /** * Created by igor on 3/13/18. */ -public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class RuleChainServiceTest extends AbstractServiceTest { @Autowired EdgeService edgeService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/TenantProfileServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/TenantProfileServiceTest.java index 6d41da2965..51f8aabb57 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantProfileServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/TenantProfileServiceTest.java @@ -45,7 +45,8 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -public abstract class BaseTenantProfileServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class TenantProfileServiceTest extends AbstractServiceTest { @Autowired TenantProfileService tenantProfileService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/TenantServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/TenantServiceTest.java index 2a680d971f..2c7674c81b 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/TenantServiceTest.java @@ -82,7 +82,8 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; -public abstract class BaseTenantServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class TenantServiceTest extends AbstractServiceTest { @SpyBean TenantDao tenantDao; @@ -616,7 +617,7 @@ public abstract class BaseTenantServiceTest extends AbstractServiceTest { private OtaPackage createAndSaveOtaPackageFor(Tenant tenant, DeviceProfile deviceProfile) { return otaPackageService.saveOtaPackage( - BaseOtaPackageServiceTest.createFirmware( + OtaPackageServiceTest.createFirmware( tenant.getId(), "2", deviceProfile.getId()) ); } diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/UserServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/UserServiceTest.java index c7ff515fb5..fcd57e5b3a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/UserServiceTest.java @@ -40,7 +40,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public abstract class BaseUserServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class UserServiceTest extends AbstractServiceTest { @Autowired CustomerService customerService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/WidgetTypeServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/WidgetTypeServiceTest.java index b04053f6d9..a536e7969e 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/WidgetTypeServiceTest.java @@ -36,7 +36,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public abstract class BaseWidgetTypeServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class WidgetTypeServiceTest extends AbstractServiceTest { @Autowired WidgetsBundleService widgetsBundleService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/WidgetsBundleServiceTest.java similarity index 99% rename from dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java rename to dao/src/test/java/org/thingsboard/server/dao/service/WidgetsBundleServiceTest.java index 8f04eaec62..0f5c90b4a8 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/WidgetsBundleServiceTest.java @@ -33,7 +33,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public abstract class BaseWidgetsBundleServiceTest extends AbstractServiceTest { +@DaoSqlTest +public class WidgetsBundleServiceTest extends AbstractServiceTest { @Autowired WidgetsBundleService widgetsBundleService; diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java deleted file mode 100644 index 680cdaa02f..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseAdminSettingsServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AdminSettingsServiceSqlTest extends BaseAdminSettingsServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmCommentServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmCommentServiceSqlTest.java deleted file mode 100644 index c4c57059b1..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmCommentServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseAlarmCommentServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AlarmCommentServiceSqlTest extends BaseAlarmCommentServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java deleted file mode 100644 index c3d2307867..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseAlarmServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AlarmServiceSqlTest extends BaseAlarmServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/ApiUsageStateServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/ApiUsageStateServiceSqlTest.java deleted file mode 100644 index f3d0fed5c4..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/ApiUsageStateServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseApiUsageStateServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class ApiUsageStateServiceSqlTest extends BaseApiUsageStateServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetProfileServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetProfileServiceSqlTest.java deleted file mode 100644 index e31c425140..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetProfileServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseAssetProfileServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AssetProfileServiceSqlTest extends BaseAssetProfileServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java deleted file mode 100644 index 6a5aa4c167..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseAssetServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class AssetServiceSqlTest extends BaseAssetServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java deleted file mode 100644 index b3f36dacf3..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseCustomerServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class CustomerServiceSqlTest extends BaseCustomerServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java deleted file mode 100644 index d6ad4aab90..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseDashboardServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DashboardServiceSqlTest extends BaseDashboardServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheServiceSqlTest.java deleted file mode 100644 index f225d84802..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseDeviceCredentialsCacheTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DeviceCredentialsCacheServiceSqlTest extends BaseDeviceCredentialsCacheTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java deleted file mode 100644 index 6f1748fc45..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseDeviceCredentialsServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DeviceCredentialsServiceSqlTest extends BaseDeviceCredentialsServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceProfileServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceProfileServiceSqlTest.java deleted file mode 100644 index 34219223e5..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceProfileServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseDeviceProfileServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DeviceProfileServiceSqlTest extends BaseDeviceProfileServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java deleted file mode 100644 index 2b20cf1bee..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseDeviceServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class DeviceServiceSqlTest extends BaseDeviceServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeEventServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeEventServiceSqlTest.java deleted file mode 100644 index b3eec44418..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeEventServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseEdgeEventServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EdgeEventServiceSqlTest extends BaseEdgeEventServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeServiceSqlTest.java deleted file mode 100644 index 9c98d57dc9..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EdgeServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseEdgeServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EdgeServiceSqlTest extends BaseEdgeServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceRegistrySqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceRegistrySqlTest.java deleted file mode 100644 index d5b5df984a..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceRegistrySqlTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseEntityServiceRegistryTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EntityServiceRegistrySqlTest extends BaseEntityServiceRegistryTest { - -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceSqlTest.java deleted file mode 100644 index 0d07cf78c8..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/EntityServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseEntityServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class EntityServiceSqlTest extends BaseEntityServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ConfigTemplateServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ConfigTemplateServiceSqlTest.java deleted file mode 100644 index 2b404c272b..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ConfigTemplateServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseOAuth2ConfigTemplateServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class OAuth2ConfigTemplateServiceSqlTest extends BaseOAuth2ConfigTemplateServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ServiceSqlTest.java deleted file mode 100644 index 3b99709e7f..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OAuth2ServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseOAuth2ServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class OAuth2ServiceSqlTest extends BaseOAuth2ServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OtaPackageServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/OtaPackageServiceSqlTest.java deleted file mode 100644 index 16de23f087..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/OtaPackageServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseOtaPackageServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class OtaPackageServiceSqlTest extends BaseOtaPackageServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/QueueServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/QueueServiceSqlTest.java deleted file mode 100644 index 2a9badf6b3..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/QueueServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseQueueServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class QueueServiceSqlTest extends BaseQueueServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java deleted file mode 100644 index d53b65da0d..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseRelationCacheTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class RelationCacheSqlTest extends BaseRelationCacheTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java deleted file mode 100644 index 352e457b2e..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseRelationServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class RelationServiceSqlTest extends BaseRelationServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RuleChainServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RuleChainServiceSqlTest.java deleted file mode 100644 index cc07093763..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RuleChainServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseRuleChainServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class RuleChainServiceSqlTest extends BaseRuleChainServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantProfileServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantProfileServiceSqlTest.java deleted file mode 100644 index 3ef2c25bae..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantProfileServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseTenantProfileServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TenantProfileServiceSqlTest extends BaseTenantProfileServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java deleted file mode 100644 index 635eea80ca..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseTenantServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class TenantServiceSqlTest extends BaseTenantServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java deleted file mode 100644 index bc2e6dc81a..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseUserServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class UserServiceSqlTest extends BaseUserServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java deleted file mode 100644 index b721adb7d1..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseWidgetTypeServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class WidgetTypeServiceSqlTest extends BaseWidgetTypeServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java deleted file mode 100644 index c2ac07882f..0000000000 --- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright © 2016-2023 The Thingsboard Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.thingsboard.server.dao.service.sql; - -import org.thingsboard.server.dao.service.BaseWidgetsBundleServiceTest; -import org.thingsboard.server.dao.service.DaoSqlTest; - -@DaoSqlTest -public class WidgetsBundleServiceSqlTest extends BaseWidgetsBundleServiceTest { -} diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java index faceaa4130..bbea9cbc6a 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java @@ -27,7 +27,7 @@ import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.dao.AbstractJpaDaoTest; import org.thingsboard.server.dao.service.AbstractServiceTest; -import org.thingsboard.server.dao.service.BaseTenantProfileServiceTest; +import org.thingsboard.server.dao.service.TenantProfileServiceTest; import org.thingsboard.server.dao.tenant.TenantDao; import org.thingsboard.server.dao.tenant.TenantProfileDao; @@ -54,7 +54,7 @@ public class JpaTenantDaoTest extends AbstractJpaDaoTest { @Before public void setUp() throws Exception { - tenantProfile = tenantProfileDao.save(TenantId.SYS_TENANT_ID, BaseTenantProfileServiceTest.createTenantProfile("default tenant profile")); + tenantProfile = tenantProfileDao.save(TenantId.SYS_TENANT_ID, TenantProfileServiceTest.createTenantProfile("default tenant profile")); assertThat(tenantProfile).as("tenant profile").isNotNull(); } diff --git a/monitoring/pom.xml b/monitoring/pom.xml index e044635e98..2c8d941775 100644 --- a/monitoring/pom.xml +++ b/monitoring/pom.xml @@ -21,7 +21,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard diff --git a/msa/black-box-tests/pom.xml b/msa/black-box-tests/pom.xml index ae0b12ead7..3844f23791 100644 --- a/msa/black-box-tests/pom.xml +++ b/msa/black-box-tests/pom.xml @@ -21,7 +21,7 @@ org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java index 76ce467fd9..880143b58a 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java @@ -132,6 +132,18 @@ public class TestRestClient { .as(Device.class); } + public PageData getDevices(PageLink pageLink) { + Map params = new HashMap<>(); + addPageLinkToParam(params, pageLink); + return given().spec(requestSpec).queryParams(params) + .get("/api/tenant/devices") + .then() + .statusCode(HTTP_OK) + .extract() + .as(new TypeRef>() { + }); + } + public DeviceCredentials getDeviceCredentialsByDeviceId(DeviceId deviceId) { return given().spec(requestSpec).get("/api/device/{deviceId}/credentials", deviceId.getId()) .then() diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java index cd34e69239..eb6776a4e4 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java @@ -37,6 +37,7 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.thingsboard.server.common.data.Customer; +import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.asset.AssetProfile; import org.thingsboard.server.common.data.id.AlarmId; @@ -150,6 +151,12 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { .findFirst().orElse(null); } + public Device getDeviceByName(String name) { + return testRestClient.getDevices(pageLink).getData().stream() + .filter(s -> s.getName().equals(name)) + .findFirst().orElse(null); + } + public List getRuleChainsByName(String name) { return testRestClient.getRuleChains(pageLink).getData().stream() .filter(s -> s.getName().equals(name)) @@ -269,4 +276,11 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { testRestClient.deleteDashboard(dashboardId); } } + + public void deleteDeviceByName(String deviceName) { + Device device = getDeviceByName(deviceName); + if (device != null) { + testRestClient.deleteDevice(device.getId()); + } + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java index 25b3aff7e1..ee89e5053d 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageHelper.java @@ -119,6 +119,7 @@ public class CustomerPageHelper extends CustomerPageElements { public void createCustomersUser() { plusBtn().click(); + addUserEmailField().click(); addUserEmailField().sendKeys(getRandomNumber() + "@gmail.com"); addBtnC().click(); activateWindowOkBtn().click(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java index b8fbda5135..030f7913c1 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java @@ -18,7 +18,7 @@ package org.thingsboard.server.msa.ui.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -public class DevicePageElements extends OtherPageElements { +public class DevicePageElements extends OtherPageElementsHelper { public DevicePageElements(WebDriver driver) { super(driver); } @@ -29,9 +29,30 @@ public class DevicePageElements extends OtherPageElements { private static final String ASSIGN_TO_CUSTOMER_BTN = "//mat-cell[contains(@class,'name')]/span[text()='%s']" + "/ancestor::mat-row//mat-icon[contains(text(),'assignment_ind')]/parent::button"; private static final String CHOOSE_CUSTOMER_FOR_ASSIGN_FIELD = "//input[@formcontrolname='entity']"; - private static final String CUSTOMER_FROM_ASSIGN_DROPDOWN = "//div[@role = 'listbox']//span[text() = '%s']"; + private static final String ENTITY_FROM_DROPDOWN = "//div[@role = 'listbox']//span[text() = '%s']"; private static final String CLOSE_DEVICE_DETAILS_VIEW = "//header//mat-icon[contains(text(),'close')]/parent::button"; private static final String SUBMIT_ASSIGN_TO_CUSTOMER_BTN = "//button[@type='submit']"; + private static final String ADD_DEVICE_BTN = "//mat-icon[text() = 'insert_drive_file']/parent::button"; + private static final String CREATE_DEVICE_NAME_FIELD = "//tb-device-wizard//input[@formcontrolname='name']"; + private static final String HEADER_NAME_VIEW = "//header//div[@class='tb-details-title']/span"; + private static final String DESCRIPTION_FIELD_CREATE_VIEW = "//tb-device-wizard//textarea[@formcontrolname='description']"; + private static final String ADD_DEVICE_VIEW = "//tb-device-wizard"; + private static final String DELETE_BTN_DETAILS_TAB = "//span[contains(text(),'Delete device')]/parent::button"; + private static final String CHECKBOX_GATEWAY_EDIT = "//mat-checkbox[@formcontrolname='gateway']//label"; + private static final String CHECKBOX_GATEWAY_CREATE = "//tb-device-wizard//mat-checkbox[@formcontrolname='gateway']//label"; + private static final String CHECKBOX_OVERWRITE_ACTIVITY_TIME_EDIT = "//mat-checkbox[@formcontrolname='overwriteActivityTime']//label"; + private static final String CHECKBOX_OVERWRITE_ACTIVITY_TIME_CREATE = "//tb-device-wizard//mat-checkbox[@formcontrolname='overwriteActivityTime']//label"; + private static final String CHECKBOX_GATEWAY_DETAILS = "//mat-checkbox[@formcontrolname='gateway']//input"; + private static final String CHECKBOX_GATEWAY_PAGE = DEVICE + "/ancestor::mat-row//mat-cell[contains(@class,'cdk-column-gateway')]//mat-icon[text() = 'check_box']"; + private static final String CHECKBOX_OVERWRITE_ACTIVITY_TIME_DETAILS = "//mat-checkbox[@formcontrolname='overwriteActivityTime']//input"; + private static final String CLEAR_PROFILE_FIELD_BTN = "//button[@aria-label='Clear']"; + private static final String DEVICE_PROFILE_REDIRECTED_BTN = "//a[@aria-label='Open device profile']"; + private static final String DEVICE_LABEL_FIELD_CREATE = "//tb-device-wizard//input[@formcontrolname='label']"; + private static final String DEVICE_LABEL_PAGE = DEVICE + "/ancestor::mat-row//mat-cell[contains(@class,'cdk-column-label')]/span"; + private static final String DEVICE_CUSTOMER_PAGE = DEVICE + "/ancestor::mat-row//mat-cell[contains(@class,'cdk-column-customerTitle')]/span"; + private static final String CUSTOMER_OPTION_BNT = "//div[text() = 'Customer']/ancestor::mat-step-header"; + private static final String ASSIGN_ON_CUSTOMER_FIELD = "//input[@formcontrolname='entity']"; + private static final String DEVICE_LABEL_EDIT = "//input[@formcontrolname='label']"; public WebElement device(String deviceName) { return waitUntilElementToBeClickable(String.format(DEVICE, deviceName)); @@ -53,8 +74,8 @@ public class DevicePageElements extends OtherPageElements { return waitUntilElementToBeClickable(CHOOSE_CUSTOMER_FOR_ASSIGN_FIELD); } - public WebElement customerFromAssignDropdown(String customerTitle) { - return waitUntilElementToBeClickable(String.format(CUSTOMER_FROM_ASSIGN_DROPDOWN, customerTitle)); + public WebElement entityFromDropdown(String customerTitle) { + return waitUntilElementToBeClickable(String.format(ENTITY_FROM_DROPDOWN, customerTitle)); } public WebElement closeDeviceDetailsViewBtn() { @@ -64,4 +85,92 @@ public class DevicePageElements extends OtherPageElements { public WebElement submitAssignToCustomerBtn() { return waitUntilElementToBeClickable(SUBMIT_ASSIGN_TO_CUSTOMER_BTN); } + + public WebElement addDeviceBtn() { + return waitUntilElementToBeClickable(ADD_DEVICE_BTN); + } + + public WebElement nameField() { + return waitUntilElementToBeClickable(CREATE_DEVICE_NAME_FIELD); + } + + public WebElement headerNameView() { + return waitUntilVisibilityOfElementLocated(HEADER_NAME_VIEW); + } + + public WebElement descriptionFieldCreateField() { + return waitUntilElementToBeClickable(DESCRIPTION_FIELD_CREATE_VIEW); + } + + public WebElement addDeviceView() { + return waitUntilPresenceOfElementLocated(ADD_DEVICE_VIEW); + } + + public WebElement deleteBtnDetailsTab() { + return waitUntilElementToBeClickable(DELETE_BTN_DETAILS_TAB); + } + + public WebElement checkboxGatewayEdit() { + return waitUntilElementToBeClickable(CHECKBOX_GATEWAY_EDIT); + } + + public WebElement checkboxGatewayCreate() { + return waitUntilElementToBeClickable(CHECKBOX_GATEWAY_CREATE); + } + + public WebElement checkboxOverwriteActivityTimeEdit() { + return waitUntilElementToBeClickable(CHECKBOX_OVERWRITE_ACTIVITY_TIME_EDIT); + } + + public WebElement checkboxOverwriteActivityTimeCreate() { + return waitUntilElementToBeClickable(CHECKBOX_OVERWRITE_ACTIVITY_TIME_CREATE); + } + + public WebElement checkboxGatewayDetailsTab() { + return waitUntilPresenceOfElementLocated(CHECKBOX_GATEWAY_DETAILS); + } + + public WebElement checkboxGatewayPage(String deviceName) { + return waitUntilPresenceOfElementLocated(String.format(CHECKBOX_GATEWAY_PAGE, deviceName)); + } + + public WebElement checkboxOverwriteActivityTimeDetails() { + return waitUntilPresenceOfElementLocated(CHECKBOX_OVERWRITE_ACTIVITY_TIME_DETAILS); + } + + public WebElement clearProfileFieldBtn() { + return waitUntilElementToBeClickable(CLEAR_PROFILE_FIELD_BTN); + } + + public WebElement deviceProfileRedirectedBtn() { + return waitUntilElementToBeClickable(DEVICE_PROFILE_REDIRECTED_BTN); + } + + public WebElement deviceLabelFieldCreate() { + return waitUntilElementToBeClickable(DEVICE_LABEL_FIELD_CREATE); + } + + public WebElement deviceLabelOnPage(String deviceName) { + return waitUntilVisibilityOfElementLocated(String.format(DEVICE_LABEL_PAGE, deviceName)); + } + + public WebElement customerOptionBtn() { + return waitUntilElementToBeClickable(CUSTOMER_OPTION_BNT); + } + + public WebElement assignOnCustomerField() { + return waitUntilElementToBeClickable(ASSIGN_ON_CUSTOMER_FIELD); + } + + public WebElement deviceCustomerOnPage(String deviceName) { + return waitUntilVisibilityOfElementLocated(String.format(DEVICE_CUSTOMER_PAGE, deviceName)); + } + + public WebElement deviceLabelEditField() { + return waitUntilElementToBeClickable(DEVICE_LABEL_EDIT); + } + + public WebElement deviceLabelDetailsField() { + return waitUntilVisibilityOfElementLocated(DEVICE_LABEL_EDIT); + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageHelper.java index 19e85244cd..c6df90e0fa 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageHelper.java @@ -22,6 +22,9 @@ public class DevicePageHelper extends DevicePageElements { super(driver); } + private String description; + private String label; + public void openDeviceAlarms(String deviceName) { if (!deviceDetailsView().isDisplayed()) { device(deviceName).click(); @@ -31,7 +34,63 @@ public class DevicePageHelper extends DevicePageElements { public void assignToCustomer(String customerTitle) { chooseCustomerForAssignField().click(); - customerFromAssignDropdown(customerTitle).click(); + entityFromDropdown(customerTitle).click(); submitAssignToCustomerBtn().click(); } + + public void openCreateDeviceView() { + plusBtn().click(); + addDeviceBtn().click(); + } + + public void enterName(String deviceName) { + enterText(nameField(), deviceName); + } + + public void enterDescription(String description) { + enterText(descriptionFieldCreateField(), description); + } + + public void enterLabel(String label) { + enterText(deviceLabelFieldCreate(), label); + } + + public void deleteDeviceByRightSideBtn(String deviceName) { + deleteBtn(deviceName).click(); + warningPopUpYesBtn().click(); + } + + public void deleteDeviceFromDetailsTab() { + deleteBtnDetailsTab().click(); + warningPopUpYesBtn().click(); + } + + public void setDescription() { + scrollToElement(descriptionEntityView()); + description = descriptionEntityView().getAttribute("value"); + } + + public void setLabel() { + label = deviceLabelDetailsField().getAttribute("value"); + } + + public String getDescription() { + return description; + } + + public String getLabel() { + return label; + } + + public void changeDeviceProfile(String deviceProfileName) { + clearProfileFieldBtn().click(); + entityFromDropdown(deviceProfileName).click(); + } + + public void assignOnCustomer(String customerTitle) { + customerOptionBtn().click(); + assignOnCustomerField().click(); + entityFromList(customerTitle).click(); + sleep(2); //waiting for the action to count + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/AbstractDeviceTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/AbstractDeviceTest.java new file mode 100644 index 0000000000..3cd46fefc9 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/AbstractDeviceTest.java @@ -0,0 +1,45 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.devicessmoke; + +import io.qameta.allure.Epic; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.DevicePageHelper; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; + +@Epic("Device smoke tests") +abstract public class AbstractDeviceTest extends AbstractDriverBaseTest { + + protected SideBarMenuViewHelper sideBarMenuView; + protected DevicePageHelper devicePage; + protected String deviceName; + + @BeforeClass + public void login() { + new LoginPageHelper(driver).authorizationTenant(); + sideBarMenuView = new SideBarMenuViewHelper(driver); + devicePage = new DevicePageHelper(driver); + } + + @AfterMethod + public void delete() { + deleteDeviceByName(deviceName); + deviceName = null; + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/CreateDeviceTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/CreateDeviceTest.java new file mode 100644 index 0000000000..3e4ab48f5d --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/CreateDeviceTest.java @@ -0,0 +1,214 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.devicessmoke; + +import io.qameta.allure.Description; +import io.qameta.allure.Feature; +import org.testng.annotations.Test; +import org.thingsboard.server.common.data.Device; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.thingsboard.server.msa.ui.base.AbstractBasePage.random; +import static org.thingsboard.server.msa.ui.utils.Const.DEVICE_PROFILE_IS_REQUIRED_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.NAME_IS_REQUIRED_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_DEVICE_MESSAGE; + +@Feature("Create device") +public class CreateDeviceTest extends AbstractDeviceTest { + + @Test(groups = "smoke") + @Description("Add device after specifying the name (text/numbers /special characters)") + public void createDevice() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.addBtnC().click(); + devicePage.refreshBtn().click(); + + assertIsDisplayed(devicePage.entity(deviceName)); + } + + @Test(groups = "smoke") + @Description("Add device after specifying the name and description (text/numbers /special characters)") + public void createDeviceWithDescription() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.enterDescription(deviceName); + devicePage.addBtnC().click(); + devicePage.refreshBtn().click(); + devicePage.entity(deviceName).click(); + devicePage.setHeaderName(); + + assertThat(devicePage.getHeaderName()).as("Header of device details tab").isEqualTo(deviceName); + assertThat(devicePage.descriptionEntityView().getAttribute("value")) + .as("Description in device details tab").isEqualTo(deviceName); + } + + @Test(groups = "smoke") + @Description("Add device without the name") + public void createDeviceWithoutName() { + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.nameField().click(); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.addDeviceView()); + assertThat(devicePage.errorMessage().getText()).as("Text of warning message").isEqualTo(NAME_IS_REQUIRED_MESSAGE); + } + + @Test(groups = "smoke") + @Description("Create device only with spase in name") + public void createDeviceWithOnlySpace() { + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(" "); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.warningMessage()); + assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(EMPTY_DEVICE_MESSAGE); + assertIsDisplayed(devicePage.addDeviceView()); + } + + @Test(groups = "smoke") + @Description("Create a device with the same name") + public void createDeviceWithSameName() { + Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); + deviceName = device.getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.warningMessage()); + assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(SAME_NAME_WARNING_DEVICE_MESSAGE); + assertIsDisplayed(devicePage.addDeviceView()); + } + + @Test(groups = "smoke") + @Description("Add device after specifying the name (text/numbers /special characters) without refresh") + public void createDeviceWithoutRefresh() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.entity(deviceName)); + } + + @Test(groups = "smoke") + @Description("Add device without device profile") + public void createDeviceWithoutDeviceProfile() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.clearProfileFieldBtn().click(); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.errorMessage()); + assertThat(devicePage.errorMessage().getText()).as("Text of warning message").isEqualTo(DEVICE_PROFILE_IS_REQUIRED_MESSAGE); + assertIsDisplayed(devicePage.addDeviceView()); + } + + @Test(groups = "smoke") + @Description("Add device with enabled gateway") + public void createDeviceWithEnableGateway() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.checkboxGatewayCreate().click(); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.device(deviceName)); + assertIsDisplayed(devicePage.checkboxGatewayPage(deviceName)); + } + + @Test(groups = "smoke") + @Description("Add device with enabled overwrite activity time for connected") + public void createDeviceWithEnableOverwriteActivityTimeForConnected() { + deviceName = ENTITY_NAME + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.checkboxGatewayCreate().click(); + devicePage.checkboxOverwriteActivityTimeCreate().click(); + devicePage.addBtnC().click(); + devicePage.device(deviceName).click(); + + assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) + .as("Overwrite activity time for connected is enable").isTrue(); + } + + @Test(groups = "smoke") + @Description("Add device with label") + public void createDeviceWithLabel() { + deviceName = ENTITY_NAME + random(); + String deviceLabel = "device label " + random(); + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.enterLabel(deviceLabel); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.deviceLabelOnPage(deviceName)); + assertThat(devicePage.deviceLabelOnPage(deviceName).getText()).as("Label added correctly").isEqualTo(deviceLabel); + } + + @Test(groups = "smoke") + @Description("Add device with assignee on customer") + public void createDeviceWithAssignee() { + deviceName = ENTITY_NAME + random(); + String customer = "Customer A"; + + sideBarMenuView.goToDevicesPage(); + devicePage.openCreateDeviceView(); + devicePage.enterName(deviceName); + devicePage.assignOnCustomer(customer); + devicePage.addBtnC().click(); + + assertIsDisplayed(devicePage.deviceCustomerOnPage(deviceName)); + assertThat(devicePage.deviceCustomerOnPage(deviceName).getText()) + .as("Customer added correctly").isEqualTo(customer); + } + + @Test(groups = "smoke") + @Description("Go to devices documentation page") + public void documentation() { + String urlPath = "docs/user-guide/ui/devices/"; + + sideBarMenuView.goToDevicesPage(); + devicePage.entity("Thermostat T1").click(); + devicePage.goToHelpPage(); + + assertThat(urlContains(urlPath)).as("Redirected URL contains " + urlPath).isTrue(); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteDeviceTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteDeviceTest.java new file mode 100644 index 0000000000..76028f0bc0 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteDeviceTest.java @@ -0,0 +1,75 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.devicessmoke; + +import io.qameta.allure.Description; +import io.qameta.allure.Feature; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.common.data.Device; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; + +@Feature("Delete device") +public class DeleteDeviceTest extends AbstractDeviceTest { + + @BeforeMethod + public void createDevice() { + Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); + deviceName = device.getName(); + } + + @Test(groups = "smoke") + @Description("Remove the device by clicking on the trash icon in the right side of device") + public void deleteDeviceByRightSideBtn() { + sideBarMenuView.goToDevicesPage(); + devicePage.deleteDeviceByRightSideBtn(deviceName); + devicePage.refreshBtn().click(); + + devicePage.assertEntityIsNotPresent(deviceName); + } + + @Test(groups = "smoke") + @Description("Remove device by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") + public void deleteSelectedDevice() { + sideBarMenuView.goToDevicesPage(); + devicePage.deleteSelected(deviceName); + devicePage.refreshBtn().click(); + + devicePage.assertEntityIsNotPresent(deviceName); + } + + @Test(groups = "smoke") + @Description("Remove the device by clicking on the 'Delete device' btn in the entity view") + public void deleteDeviceFromDetailsTab() { + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.deleteDeviceFromDetailsTab(); + devicePage.refreshBtn(); + + devicePage.assertEntityIsNotPresent(deviceName); + } + + @Test(groups = "smoke") + @Description("Remove the device by clicking on the trash icon in the right side of device without refresh") + public void deleteDeviceWithoutRefresh() { + sideBarMenuView.goToDevicesPage(); + devicePage.deleteDeviceByRightSideBtn(deviceName); + + devicePage.assertEntityIsNotPresent(deviceName); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteSeveralDevicesTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteSeveralDevicesTest.java new file mode 100644 index 0000000000..48df384c63 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeleteSeveralDevicesTest.java @@ -0,0 +1,84 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.devicessmoke; + +import io.qameta.allure.Description; +import io.qameta.allure.Feature; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.common.data.Device; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; + +@Feature("Delete several devices") +public class DeleteSeveralDevicesTest extends AbstractDeviceTest { + + private String deviceName1; + private String deviceName2; + + @BeforeMethod + public void createDevices() { + Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); + Device device1 = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); + deviceName1 = device.getName(); + deviceName2 = device1.getName(); + } + + @AfterMethod + public void deleteDevices() { + deleteDeviceByName(deviceName1); + deleteDeviceByName(deviceName2); + } + + @Test(groups = "smoke") + @Description("Remove several devices by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top") + public void deleteSeveralDevicesByTopBtn() { + sideBarMenuView.goToDevicesPage(); + devicePage.deleteSelected(2); + devicePage.refreshBtn().click(); + + devicePage.assertEntityIsNotPresent(deviceName1); + devicePage.assertEntityIsNotPresent(deviceName2); + } + + @Test(groups = "smoke") + @Description("Remove several devices by mark all the devices on the page by clicking in the topmost checkbox" + + " and then clicking on the trash icon in the menu that appears") + public void selectAllDevices() { + sideBarMenuView.goToDevicesPage(); + devicePage.selectAllCheckBox().click(); + devicePage.deleteSelectedBtn().click(); + + assertIsDisplayed(devicePage.warningPopUpTitle()); + assertThat(devicePage.warningPopUpTitle().getText()).as("Warning title contains true correct of selected devices") + .contains(String.valueOf(devicePage.markCheckbox().size())); + } + + @Test(groups = "smoke") + @Description("Remove several devices by mark in the checkbox and then click on the trash can icon in the menu " + + "that appears at the top without refresh") + public void deleteSeveralWithoutRefresh() { + sideBarMenuView.goToDevicesPage(); + devicePage.deleteSelected(2); + + devicePage.assertEntityIsNotPresent(deviceName1); + devicePage.assertEntityIsNotPresent(deviceName2); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/EditDeviceTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/EditDeviceTest.java new file mode 100644 index 0000000000..77bb209485 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/EditDeviceTest.java @@ -0,0 +1,179 @@ +/** + * Copyright © 2016-2023 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.devicessmoke; + +import io.qameta.allure.Description; +import io.qameta.allure.Feature; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.utils.DataProviderCredential; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomNumber; +import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; + +@Feature("Edit device") +public class EditDeviceTest extends AbstractDeviceTest { + + @Test(groups = "smoke") + @Description("Change name by edit menu") + public void changeName() { + String newDeviceName = "Changed" + getRandomNumber(); + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.setHeaderName(); + String nameBefore = devicePage.getHeaderName(); + devicePage.editPencilBtn().click(); + devicePage.changeNameEditMenu(newDeviceName); + devicePage.doneBtnEditView().click(); + deviceName = newDeviceName; + devicePage.setHeaderName(); + String nameAfter = devicePage.getHeaderName(); + + assertThat(nameAfter).as("The name has changed").isNotEqualTo(nameBefore); + assertThat(nameAfter).as("The name has changed correctly").isEqualTo(newDeviceName); + } + + @Test(groups = "smoke") + @Description("Delete name and save") + public void deleteName() { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.changeNameEditMenu(""); + + assertIsDisable(devicePage.doneBtnEditViewVisible()); + } + + @Test(groups = "smoke") + @Description("Save only with space") + public void saveOnlyWithSpace() { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.changeNameEditMenu(" "); + devicePage.doneBtnEditView().click(); + + assertIsDisplayed(devicePage.warningMessage()); + assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(EMPTY_DEVICE_MESSAGE); + } + + @Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") + @Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") + public void editDescription(String description, String newDescription, String finalDescription) { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, description)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.descriptionEntityView().sendKeys(newDescription); + devicePage.doneBtnEditView().click(); + devicePage.setDescription(); + + assertThat(devicePage.getDescription()).as("The description changed correctly").isEqualTo(finalDescription); + } + + @Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "enable") + @Description("Enable gateway mode/Disable gateway") + public void isGateway(boolean isGateway) { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, isGateway)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.checkboxGatewayEdit().click(); + devicePage.doneBtnEditView().click(); + + if (isGateway) { + assertThat(devicePage.checkboxGatewayDetailsTab().getAttribute("class").contains("selected")) + .as("Gateway is disable").isFalse(); + } else { + assertThat(devicePage.checkboxGatewayDetailsTab().getAttribute("class").contains("selected")) + .as("Gateway is enable").isTrue(); + } + } + + @Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "enable") + @Description("Enable overwrite activity time for connected/Disable overwrite activity time for connected") + public void isOverwriteActivityTimeForConnectedDevice(boolean isOverwriteActivityTimeForConnected) { + deviceName = testRestClient.postDevice("", + EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, true, isOverwriteActivityTimeForConnected)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.checkboxOverwriteActivityTimeEdit().click(); + devicePage.doneBtnEditView().click(); + + if (isOverwriteActivityTimeForConnected) { + assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) + .as("Overwrite activity time for connected is disable").isFalse(); + } else { + assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) + .as("Overwrite activity time for connected is enable").isTrue(); + } + } + + @Test(groups = "smoke") + @Description("Change device profile") + public void changeDeviceProfile() { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.changeDeviceProfile("DEFAULT"); + devicePage.doneBtnEditView().click(); + + assertIsDisplayed(devicePage.deviceProfileRedirectedBtn()); + assertThat(devicePage.deviceProfileRedirectedBtn().getText()).as("Profile changed correctly").isEqualTo("DEFAULT"); + } + + @Test(groups = "smoke") + @Description("Save without device profile") + public void saveWithoutDeviceProfile() { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.clearProfileFieldBtn().click(); + + assertIsDisable(devicePage.doneBtnEditViewVisible()); + } + + @Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editDeviceLabel") + @Description("Write the label and save the changes/Change the label and save the changes/Delete the label and save the changes") + public void editLabel(String label, String newLabel, String finalLabel) { + deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, "", label)).getName(); + + sideBarMenuView.goToDevicesPage(); + devicePage.entity(deviceName).click(); + devicePage.editPencilBtn().click(); + devicePage.deviceLabelEditField().sendKeys(newLabel); + devicePage.doneBtnEditView().click(); + devicePage.setLabel(); + + assertThat(devicePage.getLabel()).as("The label changed correctly").isEqualTo(finalLabel); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/rulechainssmoke/RuleChainEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/rulechainssmoke/RuleChainEditMenuTest.java index eaeaa6e61f..5882556ff8 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/rulechainssmoke/RuleChainEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/rulechainssmoke/RuleChainEditMenuTest.java @@ -99,7 +99,7 @@ public class RuleChainEditMenuTest extends AbstractRuleChainTest { assertThat(ruleChainsPage.getDescription()).as("The description changed correctly").isEqualTo(finalDescription); } - @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "debugMode") + @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "enable") @Description("Enable debug mode/Disable debug mode") public void debugMode(boolean debugMode) { ruleChainName = ENTITY_NAME + random(); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java index 7b64eaa1b4..28bdac556f 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java @@ -36,10 +36,13 @@ public class Const { public static final String EMPTY_CUSTOMER_MESSAGE = "Customer title should be specified!"; public static final String EMPTY_DEVICE_PROFILE_MESSAGE = "Device profile name should be specified!"; public static final String EMPTY_ASSET_PROFILE_MESSAGE = "Asset profile name should be specified!"; + public static final String EMPTY_DEVICE_MESSAGE = "Device name should be specified!"; public static final String DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE = "The rule chain referenced by the device profiles cannot be deleted!"; public static final String SAME_NAME_WARNING_CUSTOMER_MESSAGE = "Customer with such title already exists!"; public static final String SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE = "Device profile with such name already exists!"; public static final String SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE = "Asset profile with such name already exists!"; + public static final String SAME_NAME_WARNING_DEVICE_MESSAGE = "Device with such name already exists!"; public static final String PHONE_NUMBER_ERROR_MESSAGE = "Phone number is invalid or not possible"; public static final String NAME_IS_REQUIRED_MESSAGE = "Name is required."; -} \ No newline at end of file + public static final String DEVICE_PROFILE_IS_REQUIRED_MESSAGE = "Device profile is required"; +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java index 6e56abff2e..e7ee242cab 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java @@ -151,9 +151,19 @@ public class DataProviderCredential { } @DataProvider - public static Object[][] debugMode() { + public static Object[][] enable() { return new Object[][]{ {false}, {true}}; } + + @DataProvider + public static Object[][] editDeviceLabel() { + String newLabel = "Label" + getRandomNumber(); + String label = "Label"; + return new Object[][]{ + {"", newLabel, newLabel}, + {label, newLabel, label + newLabel}, + {label, Keys.CONTROL + "A" + Keys.BACK_SPACE, ""}}; + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java index 6f2d9560f4..ec66442bd2 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java @@ -192,6 +192,41 @@ public class EntityPrototypes { return device; } + public static Device defaultDevicePrototype(String name, String description) { + Device device = new Device(); + device.setName(name + RandomStringUtils.randomAlphanumeric(7)); + device.setType("DEFAULT"); + device.setAdditionalInfo(JacksonUtil.newObjectNode().put("description", description)); + return device; + } + + public static Device defaultDevicePrototype(String name, String description, String label) { + Device device = new Device(); + device.setName(name + RandomStringUtils.randomAlphanumeric(7)); + device.setType("DEFAULT"); + device.setAdditionalInfo(JacksonUtil.newObjectNode().put("description", description)); + device.setLabel(label); + return device; + } + + public static Device defaultDevicePrototype(String name, boolean gateway) { + Device device = new Device(); + device.setName(name + RandomStringUtils.randomAlphanumeric(7)); + device.setType("DEFAULT"); + device.setAdditionalInfo(JacksonUtil.newObjectNode().put("gateway", gateway)); + return device; + } + + public static Device defaultDevicePrototype(String name, boolean gateway, boolean overwriteActivityTime) { + Device device = new Device(); + device.setName(name + RandomStringUtils.randomAlphanumeric(7)); + device.setType("DEFAULT"); + device.setAdditionalInfo(JacksonUtil.newObjectNode() + .put("gateway", gateway) + .put("overwriteActivityTime", overwriteActivityTime)); + return device; + } + public static Asset defaultAssetPrototype(String name, CustomerId id) { Asset asset = new Asset(); asset.setName(name + RandomStringUtils.randomAlphanumeric(7)); diff --git a/msa/black-box-tests/src/test/resources/all.xml b/msa/black-box-tests/src/test/resources/all.xml index 155aac38e1..95248a6fe6 100644 --- a/msa/black-box-tests/src/test/resources/all.xml +++ b/msa/black-box-tests/src/test/resources/all.xml @@ -67,4 +67,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/msa/black-box-tests/src/test/resources/smokeDevices.xml b/msa/black-box-tests/src/test/resources/smokeDevices.xml new file mode 100644 index 0000000000..c255f9ed53 --- /dev/null +++ b/msa/black-box-tests/src/test/resources/smokeDevices.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/msa/black-box-tests/src/test/resources/uiTests.xml b/msa/black-box-tests/src/test/resources/uiTests.xml index 9dbf8dfc0c..9de384d15c 100644 --- a/msa/black-box-tests/src/test/resources/uiTests.xml +++ b/msa/black-box-tests/src/test/resources/uiTests.xml @@ -62,4 +62,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/msa/js-executor/package.json b/msa/js-executor/package.json index add59eb610..a5b4f3ec13 100644 --- a/msa/js-executor/package.json +++ b/msa/js-executor/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-js-executor", "private": true, - "version": "3.5.0", + "version": "3.5.1", "description": "ThingsBoard JavaScript Executor Microservice", "main": "server.ts", "bin": "server.js", diff --git a/msa/js-executor/pom.xml b/msa/js-executor/pom.xml index 05775ef137..10a418642d 100644 --- a/msa/js-executor/pom.xml +++ b/msa/js-executor/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/monitoring/pom.xml b/msa/monitoring/pom.xml index 09b492f759..1fe43219a0 100644 --- a/msa/monitoring/pom.xml +++ b/msa/monitoring/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa diff --git a/msa/pom.xml b/msa/pom.xml index 6b76f974f1..26550ca386 100644 --- a/msa/pom.xml +++ b/msa/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard msa diff --git a/msa/tb-node/pom.xml b/msa/tb-node/pom.xml index 8779dd6dd1..ad8563b6b8 100644 --- a/msa/tb-node/pom.xml +++ b/msa/tb-node/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/tb/docker-cassandra/Dockerfile b/msa/tb/docker-cassandra/Dockerfile index 896825ffd0..2f23aec399 100644 --- a/msa/tb/docker-cassandra/Dockerfile +++ b/msa/tb/docker-cassandra/Dockerfile @@ -47,7 +47,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends wget nmap procps gnupg2 \ && echo "deb http://apt.postgresql.org/pub/repos/apt/ $(. /etc/os-release && echo -n $VERSION_CODENAME)-pgdg main" | tee --append /etc/apt/sources.list.d/pgdg.list > /dev/null \ && wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O- | apt-key add - \ - && echo 'deb http://downloads.apache.org/cassandra/debian 40x main' | tee --append /etc/apt/sources.list.d/cassandra.list > /dev/null \ + && echo "deb https://debian.cassandra.apache.org 40x main" | tee -a /etc/apt/sources.list.d/cassandra.sources.list > /dev/null \ && wget -q https://downloads.apache.org/cassandra/KEYS -O- | apt-key add - \ && apt-get update \ && apt-get install -y --no-install-recommends cassandra cassandra-tools postgresql-${PG_MAJOR} \ diff --git a/msa/tb/pom.xml b/msa/tb/pom.xml index f4dfdc1abc..5da00fb066 100644 --- a/msa/tb/pom.xml +++ b/msa/tb/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/transport/coap/pom.xml b/msa/transport/coap/pom.xml index 6a4ce4dd69..ae9b193b3c 100644 --- a/msa/transport/coap/pom.xml +++ b/msa/transport/coap/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.msa - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/http/pom.xml b/msa/transport/http/pom.xml index 37fe6efc91..5101795ea4 100644 --- a/msa/transport/http/pom.xml +++ b/msa/transport/http/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.msa - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/lwm2m/pom.xml b/msa/transport/lwm2m/pom.xml index 77f5a1e2fd..6738926d3f 100644 --- a/msa/transport/lwm2m/pom.xml +++ b/msa/transport/lwm2m/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.msa - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/mqtt/pom.xml b/msa/transport/mqtt/pom.xml index 962025a917..a640eb9548 100644 --- a/msa/transport/mqtt/pom.xml +++ b/msa/transport/mqtt/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard.msa - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/pom.xml b/msa/transport/pom.xml index 8f6acf590e..ed4d7c6ecb 100644 --- a/msa/transport/pom.xml +++ b/msa/transport/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/transport/snmp/pom.xml b/msa/transport/snmp/pom.xml index 6353419382..578a1c0c29 100644 --- a/msa/transport/snmp/pom.xml +++ b/msa/transport/snmp/pom.xml @@ -21,7 +21,7 @@ org.thingsboard.msa transport - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT org.thingsboard.msa.transport diff --git a/msa/vc-executor-docker/pom.xml b/msa/vc-executor-docker/pom.xml index b076cf14cb..05dd13c831 100644 --- a/msa/vc-executor-docker/pom.xml +++ b/msa/vc-executor-docker/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/vc-executor/pom.xml b/msa/vc-executor/pom.xml index 37ba0da564..bf10f409f4 100644 --- a/msa/vc-executor/pom.xml +++ b/msa/vc-executor/pom.xml @@ -21,7 +21,7 @@ org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/web-ui/package.json b/msa/web-ui/package.json index 18cc80481f..746c9c1277 100644 --- a/msa/web-ui/package.json +++ b/msa/web-ui/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-web-ui", "private": true, - "version": "3.5.0", + "version": "3.5.1", "description": "ThingsBoard Web UI Microservice", "main": "server.ts", "bin": "server.js", diff --git a/msa/web-ui/pom.xml b/msa/web-ui/pom.xml index fd73ce686c..f4f5ff6808 100644 --- a/msa/web-ui/pom.xml +++ b/msa/web-ui/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT msa org.thingsboard.msa diff --git a/netty-mqtt/pom.xml b/netty-mqtt/pom.xml index b15e8235b4..60883f4b34 100644 --- a/netty-mqtt/pom.xml +++ b/netty-mqtt/pom.xml @@ -19,11 +19,11 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard netty-mqtt - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT jar Netty MQTT Client diff --git a/pom.xml b/pom.xml index 4fa780b3d3..cee8107e30 100755 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT pom Thingsboard diff --git a/rest-client/pom.xml b/rest-client/pom.xml index 1bf93e4dc4..839fa076ca 100644 --- a/rest-client/pom.xml +++ b/rest-client/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard rest-client diff --git a/rule-engine/pom.xml b/rule-engine/pom.xml index e005b5a543..2930ab0cee 100644 --- a/rule-engine/pom.xml +++ b/rule-engine/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard rule-engine diff --git a/rule-engine/rule-engine-api/pom.xml b/rule-engine/rule-engine-api/pom.xml index 5a200fc14a..a44331aa1a 100644 --- a/rule-engine/rule-engine-api/pom.xml +++ b/rule-engine/rule-engine-api/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT rule-engine org.thingsboard.rule-engine diff --git a/rule-engine/rule-engine-components/pom.xml b/rule-engine/rule-engine-components/pom.xml index e85f0094b5..e010a7f95b 100644 --- a/rule-engine/rule-engine-components/pom.xml +++ b/rule-engine/rule-engine-components/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT rule-engine org.thingsboard.rule-engine diff --git a/security.md b/security.md new file mode 100644 index 0000000000..9f917e5f00 --- /dev/null +++ b/security.md @@ -0,0 +1,17 @@ +# Security Policy + +## Reporting a Vulnerability + +Security is of the highest importance and all security vulnerabilities or suspected security vulnerabilities should be reported to Thingsboard privately, +to minimize attacks against current users of Thingsboard before they are fixed. Vulnerabilities will be investigated and release as soon as possible. + +To report a vulnerability or a security-related issue, please email the private address security@thingsboard.io with the details of the vulnerability. +Emails will be addressed within 3 business days, including a detailed plan to investigate the issue and any potential workarounds to perform in the meantime. +Do not report non-security-impacting bugs through this channel. Use GitHub issues instead. + +**Proposed Email Content** +Provide a descriptive subject line and in the body of the email include the following information: + +- Basic identity information, such as your name and your affiliation or company. +- Detailed steps to reproduce the vulnerability (log errors, screenshots are all helpful to us). +- Description of the effects of the vulnerability on Thingsboard. \ No newline at end of file diff --git a/tools/pom.xml b/tools/pom.xml index ae6eb95a15..345655d0c3 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard tools diff --git a/transport/coap/pom.xml b/transport/coap/pom.xml index 5cc87640d7..e3cf6d1b46 100644 --- a/transport/coap/pom.xml +++ b/transport/coap/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/http/pom.xml b/transport/http/pom.xml index d685b8d1ab..ef8150ce5f 100644 --- a/transport/http/pom.xml +++ b/transport/http/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/lwm2m/pom.xml b/transport/lwm2m/pom.xml index dcdfaac0c8..5f079ad429 100644 --- a/transport/lwm2m/pom.xml +++ b/transport/lwm2m/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/mqtt/pom.xml b/transport/mqtt/pom.xml index 11a73d7e51..f91549de8f 100644 --- a/transport/mqtt/pom.xml +++ b/transport/mqtt/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/pom.xml b/transport/pom.xml index 3e14199411..0d7abf53b2 100644 --- a/transport/pom.xml +++ b/transport/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard transport diff --git a/transport/snmp/pom.xml b/transport/snmp/pom.xml index 8ba98a9924..e8516f5bb7 100644 --- a/transport/snmp/pom.xml +++ b/transport/snmp/pom.xml @@ -21,7 +21,7 @@ org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT transport diff --git a/ui-ngx/package.json b/ui-ngx/package.json index 2c29990466..9cf84a26b6 100644 --- a/ui-ngx/package.json +++ b/ui-ngx/package.json @@ -1,6 +1,6 @@ { "name": "thingsboard", - "version": "3.5.0", + "version": "3.5.1", "scripts": { "ng": "ng", "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open", diff --git a/ui-ngx/pom.xml b/ui-ngx/pom.xml index 01d0ece37d..6619d6903a 100644 --- a/ui-ngx/pom.xml +++ b/ui-ngx/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.thingsboard - 3.5.0-SNAPSHOT + 3.5.1-SNAPSHOT thingsboard org.thingsboard diff --git a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.html b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.html index f01043ebc4..d64bfdccdc 100644 --- a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.html +++ b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.html @@ -15,17 +15,17 @@ limitations under the License. --> -
+
{{displayValue}} diff --git a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.scss b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.scss index 0e2a0d6775..52271bc631 100644 --- a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.scss +++ b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.scss @@ -16,9 +16,11 @@ @import "../../../../../scss/constants"; :host { - min-width: 52px; - + &.tb-hide { + display: none; + } section.tb-aliases-entity-select { + min-width: 52px; min-height: 32px; padding: 0 6px; diff --git a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts index 983b5f31f3..b34b5619ba 100644 --- a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts +++ b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts @@ -16,7 +16,7 @@ import { ChangeDetectorRef, - Component, + Component, HostBinding, Injector, Input, OnDestroy, @@ -47,6 +47,9 @@ import { AliasFilterType } from '@shared/models/alias.models'; }) export class AliasesEntitySelectComponent implements OnInit, OnDestroy { + @HostBinding('class') + aliasesEntitySelectClass = 'tb-hide'; + aliasControllerValue: IAliasController; @Input() @@ -188,12 +191,14 @@ export class AliasesEntitySelectComponent implements OnInit, OnDestroy { const allEntityAliases = this.aliasController.getEntityAliases(); this.entityAliasesInfo = {}; this.hasSelectableAliasEntities = false; + this.aliasesEntitySelectClass = 'tb-hide'; for (const aliasId of Object.keys(allEntityAliases)) { const aliasInfo = this.aliasController.getInstantAliasInfo(aliasId); if (aliasInfo && !aliasInfo.resolveMultiple && aliasInfo.currentEntity && aliasInfo.entityFilter && aliasInfo.entityFilter.type !== AliasFilterType.singleEntity) { this.entityAliasesInfo[aliasId] = deepClone(aliasInfo); this.hasSelectableAliasEntities = true; + this.aliasesEntitySelectClass = ''; } } } diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html index 6a9ce1f657..7ff3f08a0e 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html @@ -26,26 +26,41 @@
+ fxLayoutAlign.gt-sm="end center" fxLayoutAlign="space-between center" fxLayoutGap.lt-lg="6px" fxLayoutGap.gt-md="12px"> -
- - -
+ +
+ + + + +
+
+ fxLayoutAlign.gt-sm="start center" fxLayoutAlign="space-between center" fxLayoutGap.lt-lg="6px" fxLayoutGap.gt-md="12px"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + @@ -117,24 +245,6 @@ tooltipPosition="below" [aliasController]="dashboardCtx.aliasController"> - - -

{{ translatedDashboardTitle }}

- + dashboard.title -
+ +
query_builder - diff --git a/ui-ngx/src/app/shared/components/time/timewindow.component.scss b/ui-ngx/src/app/shared/components/time/timewindow.component.scss index 6e9e837283..695362197d 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow.component.scss +++ b/ui-ngx/src/app/shared/components/time/timewindow.component.scss @@ -14,7 +14,7 @@ * limitations under the License. */ :host { - min-width: 52px; + min-width: 48px; margin: 8px 0; max-width: 100%; .mdc-button { @@ -22,7 +22,7 @@ } section.tb-timewindow { min-height: 32px; - padding: 0 6px; + padding: 0 8px; span { overflow: hidden; diff --git a/ui-ngx/src/app/shared/components/time/timewindow.component.ts b/ui-ngx/src/app/shared/components/time/timewindow.component.ts index 4532b7eeae..6a723c73bb 100644 --- a/ui-ngx/src/app/shared/components/time/timewindow.component.ts +++ b/ui-ngx/src/app/shared/components/time/timewindow.component.ts @@ -45,8 +45,6 @@ import { TimewindowPanelComponent, TimewindowPanelData } from '@shared/components/time/timewindow-panel.component'; -import { MediaBreakpoints } from '@shared/models/constants'; -import { BreakpointObserver } from '@angular/cdk/layout'; import { TimeService } from '@core/services/time.service'; import { TooltipPosition } from '@angular/material/tooltip'; import { deepClone, isDefinedAndNotNull } from '@core/utils'; @@ -135,17 +133,6 @@ export class TimewindowComponent implements OnInit, OnDestroy, ControlValueAcces return this.timezoneValue; } - isToolbarValue = false; - - @Input() - set isToolbar(val) { - this.isToolbarValue = coerceBooleanProperty(val); - } - - get isToolbar() { - return this.isToolbarValue; - } - asButtonValue = false; @Input() @@ -161,6 +148,18 @@ export class TimewindowComponent implements OnInit, OnDestroy, ControlValueAcces @coerceBoolean() strokedButton = false; + @Input() + @coerceBoolean() + flatButton = false; + + @Input() + @coerceBoolean() + displayTimewindowValue = true; + + @Input() + @coerceBoolean() + hideLabel = false; + isEditValue = false; @Input() @@ -194,8 +193,7 @@ export class TimewindowComponent implements OnInit, OnDestroy, ControlValueAcces private datePipe: DatePipe, private cd: ChangeDetectorRef, private nativeElement: ElementRef, - public viewContainerRef: ViewContainerRef, - public breakpointObserver: BreakpointObserver) { + public viewContainerRef: ViewContainerRef) { } ngOnInit(): void { @@ -300,6 +298,10 @@ export class TimewindowComponent implements OnInit, OnDestroy, ControlValueAcces this.propagateChange(cloneSelectedTimewindow(this.innerValue)); } + displayValue(): string { + return this.displayTimewindowValue ? this.innerValue?.displayValue : this.translate.instant('timewindow.timewindow'); + } + updateDisplayValue() { if (this.innerValue.selectedTab === TimewindowType.REALTIME && !this.historyOnly) { this.innerValue.displayValue = this.translate.instant('timewindow.realtime') + ' - '; @@ -334,10 +336,6 @@ export class TimewindowComponent implements OnInit, OnDestroy, ControlValueAcces this.cd.detectChanges(); } - hideLabel() { - return this.isToolbar && !this.breakpointObserver.isMatched(MediaBreakpoints['gt-md']); - } - private isTimewindowDisabled(): boolean { return this.disabled || (!this.isEdit && (!this.innerValue || this.innerValue.hideInterval && diff --git a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js index c309eb38aa..bc22e806c3 100644 --- a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js +++ b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js @@ -5026,6 +5026,21 @@ var JSHINT = (function() { return that; }, 20); } + function nullSafeProperty(s) { + console.log("test " + s); + symbol(s, 20).exps = true; + return infix(s, function(context, left, that) { + if (state.option.bitwise) { + warning("W016", that, that.id); + } + + checkLeftSideAssign(context, left, that); + + that.right = expression(context, 10); + + return that; + }, 20); + } function suffix(s) { var x = symbol(s, 150); @@ -5539,6 +5554,9 @@ var JSHINT = (function() { bitwiseassignop("<<="); bitwiseassignop(">>="); bitwiseassignop(">>>="); + + nullSafeProperty(".?"); + infix(",", function(context, left, that) { if (state.option.nocomma) { warning("W127", that); @@ -9450,6 +9468,12 @@ Lexer.prototype = { switch (ch1) { case ".": + if (ch1 === "." && this.peek(1) === "?") { + return { + type: Token.Punctuator, + value: ".?" + }; + } if ((/^[0-9]$/).test(this.peek(1))) { return null; } diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 67732324b5..f6be7645d4 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -930,6 +930,7 @@ "no-dashboards-text": "No dashboards found", "no-widgets": "No widgets configured", "add-widget": "Add new widget", + "add-widget-button-text": "Add widget", "title": "Title", "image": "Dashboard image", "mobile-app-settings": "Mobile application settings", @@ -1058,6 +1059,7 @@ "public-link-copied-message": "Dashboard public link has been copied to clipboard", "manage-states": "Manage dashboard states", "states": "Dashboard states", + "states-short": "States", "search-states": "Search dashboard states", "selected-states": "{ count, plural, =1 {1 dashboard state} other {# dashboard states} } selected", "edit-state": "Edit dashboard state", @@ -1086,7 +1088,8 @@ "unassign-dashboards-from-edge-text": "After the confirmation all selected dashboards will be unassigned and won't be accessible by the edge.", "assign-dashboard-to-edge": "Assign Dashboard(s) To Edge", "assign-dashboard-to-edge-text": "Please select the dashboards to assign to the edge", - "non-existent-dashboard-state-error": "Dashboard state with id \"{{ stateId }}\" is not found" + "non-existent-dashboard-state-error": "Dashboard state with id \"{{ stateId }}\" is not found", + "edit-mode": "Edit mode" }, "datakey": { "settings": "Settings", @@ -1937,6 +1940,7 @@ "entities-count": "Entities count", "alarms-count": "Alarms count", "aliases": "Entity aliases", + "aliases-short": "Aliases", "entity-alias": "Entity alias", "unable-delete-entity-alias-title": "Unable to delete entity alias", "unable-delete-entity-alias-text": "Entity alias '{{entityAlias}}' can't be deleted as it used by the following widget(s):
{{widgetsList}}", @@ -2698,6 +2702,7 @@ }, "layout": { "layout": "Layout", + "layouts": "Layouts", "manage": "Manage layouts", "settings": "Layout settings", "color": "Color", @@ -3754,6 +3759,7 @@ "days": "Days" }, "timewindow": { + "timewindow": "Timewindow", "years": "{ years, plural, =1 { year } other {# years } }", "months": "{ months, plural, =1 { month } other {# months } }", "weeks": "{ weeks, plural, =1 { week } other {# weeks } }", diff --git a/ui-ngx/src/theme-overwrites.scss b/ui-ngx/src/theme-overwrites.scss index 394e4f0f12..6b4995664e 100644 --- a/ui-ngx/src/theme-overwrites.scss +++ b/ui-ngx/src/theme-overwrites.scss @@ -17,6 +17,7 @@ @mixin theme-overwrites($primary, $config-or-theme) { @include _mat-form-field-overwrites($primary, $config-or-theme); + @include _mat-button-overwrites($primary, $config-or-theme); } @mixin _mat-form-field-overwrites($primary, $config-or-theme) { @@ -52,3 +53,14 @@ } } } + +@mixin _mat-button-overwrites($primary, $config-or-theme) { + .mat-toolbar { + .mat-mdc-outlined-button { + --mdc-outlined-button-outline-color: inherit; + &:not(:disabled) { + border-color: var(--mdc-outlined-button-outline-color, inherit); + } + } + } +}