@Test(description = "Testing get devices with correct request")
public void testGetDeviceTypesByUser() throws DeviceManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
            .toReturn(this.deviceManagementProviderService);
    PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
            .toReturn(Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS));
    Response response = this.deviceManagementService.getDeviceByUser(true, 10, 5);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
    response = this.deviceManagementService.getDeviceByUser(false, 10, 5);
    Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode());
}