### Question:
RepositoryResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { final Set<RepositoryRequest> requestsToVerifyBaseURLs = new HashSet<>(); Iterator<Map<String,Object>> iterator = request.getProperties().iterator(); if (iterator.hasNext()) { for (Map<String, Object> propertyMap : getPropertyMaps(iterator.next(), predicate)) { RepositoryRequest rr = getRequest(propertyMap); if(rr.isVerifyBaseUrl()) { requestsToVerifyBaseURLs.add(rr); } } } try { getManagementController().verifyRepositories(requestsToVerifyBaseURLs); } catch (AmbariException e) { throw new SystemException("", e); } return getRequestStatus(null); } RepositoryResourceProvider(AmbariManagementController managementController); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus createResources(Request request); @Override RequestStatus deleteResources(Request request, Predicate predicate); @Override Set<String> getPKPropertyIds(); static final String REPOSITORY_REPO_NAME_PROPERTY_ID; static final String REPOSITORY_STACK_NAME_PROPERTY_ID; static final String REPOSITORY_STACK_VERSION_PROPERTY_ID; static final String REPOSITORY_CLUSTER_STACK_VERSION_PROPERTY_ID; static final String REPOSITORY_OS_TYPE_PROPERTY_ID; static final String REPOSITORY_BASE_URL_PROPERTY_ID; static final String REPOSITORY_DISTRIBUTION_PROPERTY_ID; static final String REPOSITORY_COMPONENTS_PROPERTY_ID; static final String REPOSITORY_REPO_ID_PROPERTY_ID; static final String REPOSITORY_MIRRORS_LIST_PROPERTY_ID; static final String REPOSITORY_DEFAULT_BASE_URL_PROPERTY_ID; static final String REPOSITORY_VERIFY_BASE_URL_PROPERTY_ID; static final String REPOSITORY_REPOSITORY_VERSION_ID_PROPERTY_ID; static final String REPOSITORY_VERSION_DEFINITION_ID_PROPERTY_ID; static final String REPOSITORY_UNIQUE_PROPERTY_ID; static final String REPOSITORY_TAGS_PROPERTY_ID; @Experimental(feature = ExperimentalFeature.CUSTOM_SERVICE_REPOS,
    comment = "Remove logic for handling custom service repos after enabling multi-mpack cluster deployment")
  static final String REPOSITORY_APPLICABLE_SERVICES_PROPERTY_ID; @SuppressWarnings("serial")
  static Set<String> propertyIds; @SuppressWarnings("serial")
  static Map<Type, String> keyPropertyIds; }### Answer:
@Test public void testUpdateResources() throws Exception { Resource.Type type = Resource.Type.Repository; AmbariManagementController managementController = EasyMock.createMock(AmbariManagementController.class); RepositoryResponse rr = new RepositoryResponse(VAL_BASE_URL, VAL_OS, VAL_REPO_ID, VAL_REPO_NAME, null, null, null, null , Collections.<RepoTag>emptySet(), Collections.emptyList()); Set<RepositoryResponse> allResponse = new HashSet<>(); allResponse.add(rr); expect(managementController.getRepositories(EasyMock.anyObject())).andReturn(allResponse).times(1); managementController.verifyRepositories(EasyMock.<Set<RepositoryRequest>>anyObject()); replay(managementController); ResourceProvider provider = new RepositoryResourceProvider(managementController); Map<String, Object> properties = new LinkedHashMap<>(); properties.put(RepositoryResourceProvider.REPOSITORY_BASE_URL_PROPERTY_ID, "http: Request request = PropertyHelper.getUpdateRequest(properties, null); Predicate predicate = new PredicateBuilder().property(RepositoryResourceProvider.REPOSITORY_STACK_NAME_PROPERTY_ID).equals(VAL_STACK_NAME) .and().property(RepositoryResourceProvider.REPOSITORY_STACK_VERSION_PROPERTY_ID).equals(VAL_STACK_VERSION) .toPredicate(); provider.updateResources(request, predicate); verify(managementController); }