|
|
|
@ -28,6 +28,7 @@ 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.Device; |
|
|
|
import org.thingsboard.server.common.data.DeviceProfile; |
|
|
|
import org.thingsboard.server.common.data.DeviceProfileInfo; |
|
|
|
@ -170,6 +171,25 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController |
|
|
|
Assert.assertEquals(savedDeviceProfile.getId(), foundDeviceProfileInfo.getId()); |
|
|
|
Assert.assertEquals(savedDeviceProfile.getName(), foundDeviceProfileInfo.getName()); |
|
|
|
Assert.assertEquals(savedDeviceProfile.getType(), foundDeviceProfileInfo.getType()); |
|
|
|
|
|
|
|
Customer customer = new Customer(); |
|
|
|
customer.setTitle("Customer"); |
|
|
|
customer.setTenantId(savedTenant.getId()); |
|
|
|
Customer savedCustomer = doPost("/api/customer", customer, Customer.class); |
|
|
|
|
|
|
|
User customerUser = new User(); |
|
|
|
customerUser.setAuthority(Authority.CUSTOMER_USER); |
|
|
|
customerUser.setTenantId(savedTenant.getId()); |
|
|
|
customerUser.setCustomerId(savedCustomer.getId()); |
|
|
|
customerUser.setEmail("customer2@thingsboard.org"); |
|
|
|
|
|
|
|
createUserAndLogin(customerUser, "customer"); |
|
|
|
|
|
|
|
foundDeviceProfileInfo = doGet("/api/deviceProfileInfo/" + savedDeviceProfile.getId().getId().toString(), DeviceProfileInfo.class); |
|
|
|
Assert.assertNotNull(foundDeviceProfileInfo); |
|
|
|
Assert.assertEquals(savedDeviceProfile.getId(), foundDeviceProfileInfo.getId()); |
|
|
|
Assert.assertEquals(savedDeviceProfile.getName(), foundDeviceProfileInfo.getName()); |
|
|
|
Assert.assertEquals(savedDeviceProfile.getType(), foundDeviceProfileInfo.getType()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
|