@Test
public void testGetServiceProperties() throws Exception {

  // Given
  AmbariManagementController managementController = createNiceMock(AmbariManagementController.class);
  Resource.Type type = Resource.Type.StackService;
  StackServiceResponse stackServiceResponse = createNiceMock(StackServiceResponse.class);
  expect(stackServiceResponse.getServiceProperties()).andReturn(TEST_SERVICE_PROPERTIES);
  expect(managementController.getStackServices(EasyMock.<Set<StackServiceRequest>>anyObject()))
    .andReturn(ImmutableSet.of(stackServiceResponse));
  replay(managementController, stackServiceResponse);
  Request request = PropertyHelper.getReadRequest(SERVICE_PROPERTIES_PROPERTY_ID);
  ResourceProvider stackServiceResourceProvider = AbstractControllerResourceProvider.getResourceProvider(type,
    PropertyHelper.getPropertyIds(type),
    PropertyHelper.getKeyPropertyIds(type),
    managementController);
  // When
  Set<Resource> resources = stackServiceResourceProvider.getResources(request, null);
  // Then
  Resource expected =  new ResourceImpl(type);
  BaseProvider.setResourceProperty(expected, SERVICE_PROPERTIES_PROPERTY_ID, TEST_SERVICE_PROPERTIES, ImmutableSet.of(SERVICE_PROPERTIES_PROPERTY_ID));
  assertEquals(ImmutableSet.of(expected), resources);
  verify(managementController, stackServiceResponse);
}