@Test
  public void testSetServicePropertiesAfterPropertyListSet() {
    // Given
    ServicePropertyInfo p1 = new ServicePropertyInfo();
    p1.setName("PROP1");
    p1.setValue("V1");

    ServicePropertyInfo p2 = new ServicePropertyInfo();
    p2.setName("PROP2");
    p2.setValue("V2");

    List<ServicePropertyInfo> servicePropertyList = Lists.newArrayList(p1, p2);

    ServiceInfo serviceInfo = new ServiceInfo();
    serviceInfo.setName("TEST_NAME");
    serviceInfo.setVersion("TEST_VERSION");
    serviceInfo.setServicePropertyList(servicePropertyList);

    // When
    Map<String, String> serviceProperties = serviceInfo.getServiceProperties();

    // Then
    assertTrue(serviceProperties.containsKey("PROP1"));
    assertEquals("V1", serviceProperties.get("PROP1"));

    assertTrue(serviceProperties.containsKey("PROP2"));
    assertEquals("V2", serviceProperties.get("PROP2"));

    assertTrue("true".equals(serviceProperties.get(ServiceInfo.DEFAULT_SERVICE_INSTALLABLE_PROPERTY.getKey())));
    assertTrue("true".equals(serviceProperties.get(ServiceInfo.DEFAULT_SERVICE_MANAGED_PROPERTY.getKey())));
    assertTrue("true".equals(serviceProperties.get(ServiceInfo.DEFAULT_SERVICE_MONITORED_PROPERTY.getKey())));
  }
Tests the presence and absence of the credential-store block.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceInfoTest.java