@Test public void shouldGetExisting() throws Exception { FacilityFtpDetails facilityFtpDetails = new FacilityFtpDetails(); Facility facility = new Facility(); facility.setCode("F10"); facilityFtpDetails.setFacility(facility); when(facilityFtpDetailsService.getByFacilityCode(facility)).thenReturn(facilityFtpDetails); BaseModel result = persistenceHandler.getExisting(facilityFtpDetails); assertThat((FacilityFtpDetails)result, is(facilityFtpDetails)); }
@Override protected BaseModel getExisting(BaseModel record) { FacilityFtpDetails facilityFtpDetails = (FacilityFtpDetails) record; return facilityFtpDetailsService.getByFacilityCode(facilityFtpDetails.getFacility()); }
FacilityFtpDetailsPersistenceHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { FacilityFtpDetails facilityFtpDetails = (FacilityFtpDetails) record; return facilityFtpDetailsService.getByFacilityCode(facilityFtpDetails.getFacility()); } }
FacilityFtpDetailsPersistenceHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { FacilityFtpDetails facilityFtpDetails = (FacilityFtpDetails) record; return facilityFtpDetailsService.getByFacilityCode(facilityFtpDetails.getFacility()); }  }
FacilityFtpDetailsPersistenceHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { FacilityFtpDetails facilityFtpDetails = (FacilityFtpDetails) record; return facilityFtpDetailsService.getByFacilityCode(facilityFtpDetails.getFacility()); }  @Override String getMessageKey(); }
FacilityFtpDetailsPersistenceHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { FacilityFtpDetails facilityFtpDetails = (FacilityFtpDetails) record; return facilityFtpDetailsService.getByFacilityCode(facilityFtpDetails.getFacility()); }  @Override String getMessageKey();  }