@Test public void testUpdateResources() throws Exception { Resource.Type type = Resource.Type.ClientConfig; AmbariManagementController managementController = createMock(AmbariManagementController.class); RequestStatusResponse response = createNiceMock(RequestStatusResponse.class); replay(managementController, response); ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider( type, PropertyHelper.getPropertyIds(type), PropertyHelper.getKeyPropertyIds(type), managementController); Map<String, Object> properties = new LinkedHashMap<String, Object>(); Request request = PropertyHelper.getUpdateRequest(properties, null); Predicate predicate = new PredicateBuilder().property( ClientConfigResourceProvider.COMPONENT_CLUSTER_NAME_PROPERTY_ID).equals("c1").toPredicate(); try { provider.updateResources(request, predicate); Assert.fail("Expected an UnsupportedOperationException"); } catch (SystemException e) { } verify(managementController, response); }
@Override public RequestStatus updateResources(final Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new SystemException("The request is not supported"); }
ClientConfigResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(final Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new SystemException("The request is not supported"); } }
ClientConfigResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(final Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new SystemException("The request is not supported"); } @AssistedInject  ClientConfigResourceProvider(@Assisted Set<String> propertyIds,
                               @Assisted Map<Resource.Type, String> keyPropertyIds,
                               @Assisted AmbariManagementController managementController); }
ClientConfigResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(final Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new SystemException("The request is not supported"); } @AssistedInject  ClientConfigResourceProvider(@Assisted Set<String> propertyIds,
                               @Assisted Map<Resource.Type, String> keyPropertyIds,
                               @Assisted AmbariManagementController managementController); @Override RequestStatus createResources(Request request); @Override @Transactional Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(final Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate); }
ClientConfigResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(final Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { throw new SystemException("The request is not supported"); } @AssistedInject  ClientConfigResourceProvider(@Assisted Set<String> propertyIds,
                               @Assisted Map<Resource.Type, String> keyPropertyIds,
                               @Assisted AmbariManagementController managementController); @Override RequestStatus createResources(Request request); @Override @Transactional Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(final Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate);  }