@Test public void shouldGetDeliveryZoneByCode() throws Exception { DeliveryZone expectedZone = new DeliveryZone(); expectedZone.setCode("code"); DeliveryZone existingZone = new DeliveryZone(); existingZone.setCode("existing code"); when(service.getByCode(existingZone.getCode())).thenReturn(expectedZone); BaseModel returnedZone = handler.getExisting(existingZone); assertThat((DeliveryZone) returnedZone, is(expectedZone)); }
@Override protected BaseModel getExisting(BaseModel record) { return service.getByCode(((DeliveryZone) record).getCode()); }
DeliveryZoneHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { return service.getByCode(((DeliveryZone) record).getCode()); } }
DeliveryZoneHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { return service.getByCode(((DeliveryZone) record).getCode()); }  }
DeliveryZoneHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { return service.getByCode(((DeliveryZone) record).getCode()); }  @Override String getMessageKey(); }
DeliveryZoneHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { return service.getByCode(((DeliveryZone) record).getCode()); }  @Override String getMessageKey();  }