@Test public void shouldGetDZProgramScheduleByDeliveryZoneCodeAndProgramCode() throws Exception { DeliveryZoneProgramSchedule schedule = make(a(DeliveryZoneProgramScheduleBuilder.defaultDZProgramSchedule)); DeliveryZoneProgramSchedule expectedDZPS = new DeliveryZoneProgramSchedule(); when(service.getByDeliveryZoneCodeAndProgramCode(schedule.getDeliveryZone().getCode(), schedule.getProgram().getCode())) .thenReturn(expectedDZPS); BaseModel returned = handler.getExisting(schedule); verify(service).getByDeliveryZoneCodeAndProgramCode(schedule.getDeliveryZone().getCode(), schedule.getProgram().getCode()); assertThat(expectedDZPS, is((DeliveryZoneProgramSchedule)returned)); }
@Override protected BaseModel getExisting(BaseModel record) { DeliveryZoneProgramSchedule deliveryZoneProgramSchedule = (DeliveryZoneProgramSchedule) record; return service.getByDeliveryZoneCodeAndProgramCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode(), deliveryZoneProgramSchedule.getProgram().getCode()); }
DeliveryZoneProgramScheduleHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { DeliveryZoneProgramSchedule deliveryZoneProgramSchedule = (DeliveryZoneProgramSchedule) record; return service.getByDeliveryZoneCodeAndProgramCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode(), deliveryZoneProgramSchedule.getProgram().getCode()); } }
DeliveryZoneProgramScheduleHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { DeliveryZoneProgramSchedule deliveryZoneProgramSchedule = (DeliveryZoneProgramSchedule) record; return service.getByDeliveryZoneCodeAndProgramCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode(), deliveryZoneProgramSchedule.getProgram().getCode()); }  }
DeliveryZoneProgramScheduleHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { DeliveryZoneProgramSchedule deliveryZoneProgramSchedule = (DeliveryZoneProgramSchedule) record; return service.getByDeliveryZoneCodeAndProgramCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode(), deliveryZoneProgramSchedule.getProgram().getCode()); }  @Override String getMessageKey(); }
DeliveryZoneProgramScheduleHandler extends AbstractModelPersistenceHandler { @Override protected BaseModel getExisting(BaseModel record) { DeliveryZoneProgramSchedule deliveryZoneProgramSchedule = (DeliveryZoneProgramSchedule) record; return service.getByDeliveryZoneCodeAndProgramCode(deliveryZoneProgramSchedule.getDeliveryZone().getCode(), deliveryZoneProgramSchedule.getProgram().getCode()); }  @Override String getMessageKey();  }