Browse Source
Rename JavaClientTest classes to ApiClientTest
pull/15264/head
Viacheslav Klimov
7 months ago
Failed to extract signature
33 changed files with
36 additions and
36 deletions
-
application/src/test/java/org/thingsboard/server/client/AIModelApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AbstractApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AdminApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AlarmApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AlarmCommentApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AssetApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/AssetProfileApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/CalculatedFieldApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/CustomerApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/DashboardApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/DeviceApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/DeviceConnectivityApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/DeviceProfileApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/DomainApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/EdgeApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/EntityQueryApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/EntityRelationApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/EntityViewApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/MobileAppApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/NotificationApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/Oauth2ApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/OtaPackageApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/RpcV1ApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/RpcV2ApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/RuleChainApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TbImageApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TbResourceApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TelemetryApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TenantApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TenantProfileApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/TwoFactorAuthApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/UserApiClientTest.java
-
application/src/test/java/org/thingsboard/server/client/WidgetTypeApiClientTest.java
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AIModelJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AIModelApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String AI_PREFIX = "AiTest_"; |
|
|
|
|
|
|
|
@ -33,13 +33,13 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.fail; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
public abstract class AbstractJavaClientTest extends AbstractControllerTest { |
|
|
|
public abstract class AbstractApiClientTest extends AbstractControllerTest { |
|
|
|
|
|
|
|
protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); |
|
|
|
protected static final ObjectMapper MAPPER = new ObjectMapper(); |
|
|
|
|
|
|
|
protected static final String TEST_PREFIX = "JavaClientTestDevice_"; |
|
|
|
protected static final String TEST_PREFIX_2 = "JavaClientTestDevice2_"; |
|
|
|
protected static final String TEST_PREFIX = "ApiClientTestDevice_"; |
|
|
|
protected static final String TEST_PREFIX_2 = "ApiClientTestDevice2_"; |
|
|
|
protected static final String CUSTOMER_USERNAME = "javaClientCustomer@thingsboard.org"; |
|
|
|
protected static final String TENANT_ADMIN_USERNAME = "javaClientTenant@thingsboard.org"; |
|
|
|
protected static final String TEST_PASSWORD = "password123"; |
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AdminJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AdminApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testAdminSettingsLifecycle() throws Exception { |
|
|
|
@ -38,7 +38,7 @@ import static org.junit.Assert.assertNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AlarmJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AlarmApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testAlarmLifecycle() throws Exception { |
|
|
|
@ -34,7 +34,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AlarmCommentJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AlarmCommentApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testAlarmComments() throws Exception { |
|
|
|
@ -28,7 +28,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AssetJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AssetApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testAssetLifecycle() throws Exception { |
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class AssetProfileJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class AssetProfileApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testAssetProfileLifecycle() throws Exception { |
|
|
|
@ -46,7 +46,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class CalculatedFieldJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class CalculatedFieldApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testCalculatedFieldLifecycle() throws Exception { |
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class CustomerJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class CustomerApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testCustomerLifecycle() throws Exception { |
|
|
|
@ -52,7 +52,7 @@ public class CustomerJavaClientTest extends AbstractJavaClientTest { |
|
|
|
createdCustomers.add(createdCustomer); |
|
|
|
} |
|
|
|
|
|
|
|
// find all, check count (includes savedClientCustomer from AbstractJavaClientTest setup)
|
|
|
|
// find all, check count (includes savedClientCustomer from AbstractApiClientTest setup)
|
|
|
|
PageDataCustomer allCustomers = client.getCustomers(100, 0, null, null, null); |
|
|
|
assertNotNull(allCustomers); |
|
|
|
assertNotNull(allCustomers.getData()); |
|
|
|
@ -29,7 +29,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class DashboardJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class DashboardApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testDashboardLifecycle() throws Exception { |
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class DeviceJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class DeviceApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testDeviceLifecycle() throws Exception { |
|
|
|
@ -25,7 +25,7 @@ import java.util.UUID; |
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class DeviceConnectivityJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class DeviceConnectivityApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testGetDevicePublishTelemetryCommands() throws Exception { |
|
|
|
@ -38,7 +38,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class DeviceProfileJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class DeviceProfileApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testDeviceProfileLifecycle() throws Exception { |
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class DomainJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class DomainApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
List<Domain> createdDomains = new ArrayList<>(); |
|
|
|
|
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class EdgeJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class EdgeApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testEdgeLifecycle() throws Exception { |
|
|
|
@ -49,7 +49,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class EntityQueryJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class EntityQueryApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String QUERY_TEST_PREFIX = "QueryTest_"; |
|
|
|
|
|
|
|
@ -35,7 +35,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class EntityRelationJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class EntityRelationApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testEntityRelationLifecycle() throws Exception { |
|
|
|
@ -36,7 +36,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class EntityViewJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class EntityViewApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String EV_PREFIX = "EvTest_"; |
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class MobileAppJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class MobileAppApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testMobileAppLifecycle() throws Exception { |
|
|
|
@ -48,7 +48,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class NotificationJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class NotificationApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testNotificationLifecycle() throws Exception { |
|
|
|
@ -34,7 +34,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class Oauth2JavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class Oauth2ApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private OAuth2Client createOAuth2Client(String title, String clientId, String clientSecret) { |
|
|
|
OAuth2BasicMapperConfig basicConfig = new OAuth2BasicMapperConfig(); |
|
|
|
@ -37,7 +37,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class OtaPackageJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class OtaPackageApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String OTA_PREFIX = "OtaTest_"; |
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ import org.thingsboard.server.dao.service.DaoSqlTest; |
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class RpcV1JavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class RpcV1ApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String ONE_WAY_BODY = |
|
|
|
"{\"method\":\"setGpio\",\"params\":{\"pin\":7,\"value\":1},\"persistent\":true}"; |
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class RpcV2JavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class RpcV2ApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private static final String PERSISTENT_BODY = |
|
|
|
"{\"method\":\"setGpio\",\"params\":{\"pin\":7,\"value\":1},\"persistent\":true}"; |
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class RuleChainJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class RuleChainApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testRuleChainAndNodeLifecycle() throws Exception { |
|
|
|
@ -36,7 +36,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TbImageJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TbImageApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private File createTempImage(String name, Color color) throws IOException { |
|
|
|
BufferedImage img = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); |
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TbResourceJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TbResourceApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testResourceLifecycle() throws Exception { |
|
|
|
@ -30,7 +30,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TelemetryJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TelemetryApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testTelemetryLifecycle() throws Exception { |
|
|
|
@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TenantJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TenantApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testTenantLifecycle() throws Exception { |
|
|
|
@ -35,7 +35,7 @@ import static org.junit.Assert.assertNotNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TenantProfileJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TenantProfileApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testTenantProfileLifecycle() throws Exception { |
|
|
|
@ -33,7 +33,7 @@ import static org.junit.Assert.assertNull; |
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class TwoFactorAuthJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class TwoFactorAuthApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testTwoFactorAuthLifecycle() throws Exception { |
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class UserJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class UserApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testUserLifecycle() throws Exception { |
|
|
|
@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertNotNull; |
|
|
|
|
|
|
|
@DaoSqlTest |
|
|
|
public class WidgetTypeJavaClientTest extends AbstractJavaClientTest { |
|
|
|
public class WidgetTypeApiClientTest extends AbstractApiClientTest { |
|
|
|
|
|
|
|
private JsonNode createDescriptor(String type) { |
|
|
|
return OBJECT_MAPPER.createObjectNode() |