@Test(description = "Testing getting device features when unable to get the feature manager")
public void testGetFeaturesException() throws DeviceManagementException {

    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
            .toReturn(this.deviceManagementProviderService);
    Mockito.when(this.deviceManagementProviderService.getFeatureManager(Mockito.anyString()))
            .thenThrow(new DeviceManagementException());
    Response response = this.deviceManagementService
            .getFeaturesOfDevice(TEST_DEVICE_TYPE, UUID.randomUUID().toString(), null);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
    Mockito.reset(this.deviceManagementProviderService);
}