@Test
public void testGetVisibilityServiceProperties() throws Exception {

  // Given
  AmbariManagementController managementController = createNiceMock(AmbariManagementController.class);
  Resource.Type type = Resource.Type.StackService;
  ServiceInfo serviceInfo = new ServiceInfo() ;
  serviceInfo.setServicePropertyList(TEST_SERVICE_PROPERTY_LIST);
  StackServiceResponse stackServiceResponse = new StackServiceResponse(serviceInfo);
  expect(managementController.getStackServices(EasyMock.<Set<StackServiceRequest>>anyObject()))
    .andReturn(ImmutableSet.of(stackServiceResponse));
  replay(managementController);
  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);
  Map<String, String> expectedServiceProperties = ImmutableMap.<String, String>builder()
    .putAll(TEST_SERVICE_PROPERTIES)
    .put(ServiceInfo.DEFAULT_SERVICE_INSTALLABLE_PROPERTY)
    .put(ServiceInfo.DEFAULT_SERVICE_MANAGED_PROPERTY)
    .put(ServiceInfo.DEFAULT_SERVICE_MONITORED_PROPERTY)
    .build();
  // Then
  Resource expected =  new ResourceImpl(type);
  BaseProvider.setResourceProperty(expected, SERVICE_PROPERTIES_PROPERTY_ID, expectedServiceProperties, ImmutableSet.of(SERVICE_PROPERTIES_PROPERTY_ID));
  assertEquals(ImmutableSet.of(expected), resources);
  verify(managementController);
}