### Question:
AbstractResourceProvider extends BaseProvider implements ResourceProvider, ObservableResourceProvider { protected RequestStatus getRequestStatus(RequestStatusResponse response, Set<Resource> associatedResources) { return getRequestStatus(response, associatedResources, null); } protected  AbstractResourceProvider(Set<String> propertyIds,
                                     Map<Resource.Type, String> keyPropertyIds); @Override Map<Resource.Type, String> getKeyPropertyIds(); @Override void updateObservers(ResourceProviderEvent event); @Override void addObserver(ResourceProviderObserver observer); static List<ConfigurationRequest> getConfigurationRequests(String parentCategory, Map<String, Object> properties); static void parseProperties(ConfigurationRequest config, String absCategory, String propName, String propValue); static Pattern propertiesAttributesPattern; }### Answer:
@Test public void testGetRequestStatus() { AmbariManagementController managementController = createMock(AmbariManagementController.class); MaintenanceStateHelper maintenanceStateHelper = createNiceMock(MaintenanceStateHelper.class); RepositoryVersionDAO repositoryVersionDAO = createNiceMock(RepositoryVersionDAO.class); replay(maintenanceStateHelper, repositoryVersionDAO); AbstractResourceProvider provider = new ServiceResourceProvider(managementController, maintenanceStateHelper, repositoryVersionDAO); RequestStatus status = provider.getRequestStatus(null); Assert.assertNull(status.getRequestResource()); Assert.assertEquals(Collections.emptySet(), status.getAssociatedResources()); RequestStatusResponse response = new RequestStatusResponse(99L); status = provider.getRequestStatus(response); Resource resource = status.getRequestResource(); Assert.assertEquals(99L, resource.getPropertyValue("Requests/id")); Assert.assertEquals(Collections.emptySet(), status.getAssociatedResources()); status = provider.getRequestStatus(response, null); resource = status.getRequestResource(); Assert.assertEquals(99L, resource.getPropertyValue("Requests/id")); Assert.assertEquals(Collections.emptySet(), status.getAssociatedResources()); Resource associatedResource = new ResourceImpl(Resource.Type.Service); Set<Resource> associatedResources = Collections.singleton(associatedResource); status = provider.getRequestStatus(response, associatedResources); resource = status.getRequestResource(); Assert.assertEquals(99L, resource.getPropertyValue("Requests/id")); Assert.assertEquals(associatedResources, status.getAssociatedResources()); }