@Test public void saveUpdatesOnlySpecifiedPropertiesWhenPolicyIsMerge() { final Map<String, String> result = new LinkedHashMap<>(); result.put(FIRST_NAME, FIRST_NAME); final PatientData<String> data = spy(new DictionaryPatientData<>(this.component.getName(), result)); doReturn(data).when(this.patient).getData(this.component.getName()); when(data.isNamed()).thenReturn(true); this.component.save(this.patient, PatientWritePolicy.MERGE); verify(data, times(1)).isNamed(); verify(data, times(1)).containsKey(FIRST_NAME); verify(data, times(1)).containsKey(LAST_NAME); verify(data, times(1)).get(FIRST_NAME); verify(data, never()).get(LAST_NAME); verifyNoMoreInteractions(data); verify(this.doc, times(1)).getXObject(eq(Patient.CLASS_REFERENCE), eq(true), any()); verifyNoMoreInteractions(this.doc); verify(this.dataHolder, times(1)).setStringValue(FIRST_NAME, FIRST_NAME); verifyNoMoreInteractions(this.dataHolder); }
@Override public String getName() { return "patientName"; }
PatientNameController extends AbstractSimpleController { @Override public String getName() { return "patientName"; } }
PatientNameController extends AbstractSimpleController { @Override public String getName() { return "patientName"; }  }
PatientNameController extends AbstractSimpleController { @Override public String getName() { return "patientName"; }  @Override String getName(); }
PatientNameController extends AbstractSimpleController { @Override public String getName() { return "patientName"; }  @Override String getName();  }