source: class KerberosServiceDescriptorTest {
  
    public static final String JSON_VALUE;
    public static final String JSON_VALUE_SERVICES;
    public static final Map<String, Object> MAP_VALUE;
    private static final KerberosServiceDescriptorFactory KERBEROS_SERVICE_DESCRIPTOR_FACTORY;
  
    @Test
    public void testJSONWithOnlyServiceNameAndConfigurations() throws AmbariException {
  
target:     String JSON_VALUE_ONLY_NAME_AND_CONFIGS =
          "{" +
              "  \"name\": \"SERVICE_NAME\"," +
              "  \"configurations\": [" +
              "    {" +
              "      \"service-site\": {" +
              "        \"service.property1\": \"value1\"," +
              "        \"service.property2\": \"value2\"" +
              "      }" +
              "    }" +
              "  ]" +
              "}";
  
      TreeMap<String, Object> CHANGE_NAME = new TreeMap<String, Object>() {{
        put("name", "A_DIFFERENT_SERVICE_NAME");
      }};
  
      KerberosServiceDescriptor serviceDescriptor = KERBEROS_SERVICE_DESCRIPTOR_FACTORY.createInstance("SERVICE_NAME", JSON_VALUE_ONLY_NAME_AND_CONFIGS);
      KerberosServiceDescriptor updatedServiceDescriptor = new KerberosServiceDescriptor(CHANGE_NAME);
  
      Assert.assertNotNull(serviceDescriptor);
      Assert.assertNotNull(updatedServiceDescriptor);
  
      // Update
      serviceDescriptor.update(updatedServiceDescriptor);
  
      // Validate
      Assert.assertNotNull(serviceDescriptor);
      Assert.assertEquals("A_DIFFERENT_SERVICE_NAME", serviceDescriptor.getName());
    }
  
  }