@Test public void testUpdate() throws AmbariException { KerberosServiceDescriptor serviceDescriptor = createFromJSON(); KerberosServiceDescriptor updatedServiceDescriptor = createFromMap(); Assert.assertNotNull(serviceDescriptor); Assert.assertNotNull(updatedServiceDescriptor); serviceDescriptor.update(updatedServiceDescriptor); validateUpdatedData(serviceDescriptor); }
public void update(KerberosServiceDescriptor updates) { if (updates != null) { Map<String, KerberosComponentDescriptor> updatedComponents = updates.getComponents(); if (updatedComponents != null) { for (Map.Entry<String, KerberosComponentDescriptor> entry : updatedComponents.entrySet()) { KerberosComponentDescriptor existing = getComponent(entry.getKey()); if (existing == null) { putComponent(entry.getValue()); } else { existing.update(entry.getValue()); } } } } super.update(updates); }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { public void update(KerberosServiceDescriptor updates) { if (updates != null) { Map<String, KerberosComponentDescriptor> updatedComponents = updates.getComponents(); if (updatedComponents != null) { for (Map.Entry<String, KerberosComponentDescriptor> entry : updatedComponents.entrySet()) { KerberosComponentDescriptor existing = getComponent(entry.getKey()); if (existing == null) { putComponent(entry.getValue()); } else { existing.update(entry.getValue()); } } } } super.update(updates); } }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { public void update(KerberosServiceDescriptor updates) { if (updates != null) { Map<String, KerberosComponentDescriptor> updatedComponents = updates.getComponents(); if (updatedComponents != null) { for (Map.Entry<String, KerberosComponentDescriptor> entry : updatedComponents.entrySet()) { KerberosComponentDescriptor existing = getComponent(entry.getKey()); if (existing == null) { putComponent(entry.getValue()); } else { existing.update(entry.getValue()); } } } } super.update(updates); } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { public void update(KerberosServiceDescriptor updates) { if (updates != null) { Map<String, KerberosComponentDescriptor> updatedComponents = updates.getComponents(); if (updatedComponents != null) { for (Map.Entry<String, KerberosComponentDescriptor> entry : updatedComponents.entrySet()) { KerberosComponentDescriptor existing = getComponent(entry.getKey()); if (existing == null) { putComponent(entry.getValue()); } else { existing.update(entry.getValue()); } } } } super.update(updates); } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); Map<String, KerberosComponentDescriptor> getComponents(); KerberosComponentDescriptor getComponent(String name); void putComponent(KerberosComponentDescriptor component); void update(KerberosServiceDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object); }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { public void update(KerberosServiceDescriptor updates) { if (updates != null) { Map<String, KerberosComponentDescriptor> updatedComponents = updates.getComponents(); if (updatedComponents != null) { for (Map.Entry<String, KerberosComponentDescriptor> entry : updatedComponents.entrySet()) { KerberosComponentDescriptor existing = getComponent(entry.getKey()); if (existing == null) { putComponent(entry.getValue()); } else { existing.update(entry.getValue()); } } } } super.update(updates); } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); Map<String, KerberosComponentDescriptor> getComponents(); KerberosComponentDescriptor getComponent(String name); void putComponent(KerberosComponentDescriptor component); void update(KerberosServiceDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }