|
|
|
@ -125,6 +125,16 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController |
|
|
|
Assert.assertEquals(savedDeviceProfile, foundDeviceProfile); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void whenGetDeviceProfileById_thenPermissionsAreChecked() throws Exception { |
|
|
|
DeviceProfile deviceProfile = createDeviceProfile("Device profile 1", null); |
|
|
|
deviceProfile = doPost("/api/deviceProfile", deviceProfile, DeviceProfile.class); |
|
|
|
|
|
|
|
loginDifferentTenant(); |
|
|
|
doGet("/api/deviceProfile/" + deviceProfile.getId()) |
|
|
|
.andExpect(status().isForbidden()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testFindDeviceProfileInfoById() throws Exception { |
|
|
|
DeviceProfile deviceProfile = this.createDeviceProfile("Device Profile", null); |
|
|
|
@ -136,6 +146,16 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController |
|
|
|
Assert.assertEquals(savedDeviceProfile.getType(), foundDeviceProfileInfo.getType()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void whenGetDeviceProfileInfoById_thenPermissionsAreChecked() throws Exception { |
|
|
|
DeviceProfile deviceProfile = createDeviceProfile("Device profile 1", null); |
|
|
|
deviceProfile = doPost("/api/deviceProfile", deviceProfile, DeviceProfile.class); |
|
|
|
|
|
|
|
loginDifferentTenant(); |
|
|
|
doGet("/api/deviceProfileInfo/" + deviceProfile.getId()) |
|
|
|
.andExpect(status().isForbidden()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testFindDefaultDeviceProfileInfo() throws Exception { |
|
|
|
DeviceProfileInfo foundDefaultDeviceProfileInfo = doGet("/api/deviceProfileInfo/default", DeviceProfileInfo.class); |
|
|
|
|