### Question:
ConfigurationResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new UnsupportedOperationException("Cannot update a Configuration resource."); } ConfigurationResourceProvider(AmbariManagementController managementController); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResourcesAuthorized(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate); @Override Set<String> checkPropertyIds(Set<String> propertyIds); static final String CONFIG; static final String CLUSTER_NAME_PROPERTY_ID; static final String STACK_ID_PROPERTY_ID; static final String TYPE_PROPERTY_ID; static final String TAG_PROPERTY_ID; static final String VERSION_PROPERTY_ID; static final String PROPERTIES_PROPERTY_ID; static final String PROPERTIES_ATTRIBUTES_PROPERTY_ID; static final String CLUSTER_NAME; static final String STACK_ID; static final String TYPE; static final String TAG; static final String VERSION; }### Answer:
@Test public void testUpdateResources() throws Exception { Resource.Type type = Resource.Type.Configuration; AmbariManagementController managementController = createMock(AmbariManagementController.class); RequestStatusResponse response = createNiceMock(RequestStatusResponse.class); replay(managementController, response); ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider( type, managementController); Map<String, Object> properties = new LinkedHashMap<>(); Request request = PropertyHelper.getUpdateRequest(properties, null); Predicate predicate = new PredicateBuilder().property( ConfigurationResourceProvider.TAG).equals("Configuration100").toPredicate(); try { provider.updateResources(request, predicate); Assert.fail("Expected an UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } verify(managementController, response); }