@Test public void shouldCreateDistributionInInitiatedState() throws Exception { Distribution distribution = new Distribution(); doNothing().when(mapper).insert(distribution); Distribution initiatedDistribution = repository.create(distribution); assertThat(initiatedDistribution.getStatus(), is(INITIATED)); verify(mapper).insert(distribution); }
public Distribution create(Distribution distribution) { distribution.setStatus(DistributionStatus.INITIATED); mapper.insert(distribution); return distribution; }
DistributionRepository { public Distribution create(Distribution distribution) { distribution.setStatus(DistributionStatus.INITIATED); mapper.insert(distribution); return distribution; } }
DistributionRepository { public Distribution create(Distribution distribution) { distribution.setStatus(DistributionStatus.INITIATED); mapper.insert(distribution); return distribution; }  }
DistributionRepository { public Distribution create(Distribution distribution) { distribution.setStatus(DistributionStatus.INITIATED); mapper.insert(distribution); return distribution; }  Distribution create(Distribution distribution); Distribution get(Distribution distribution); void updateDistributionStatus(Long distributionId, DistributionStatus status, Long modifiedBy); List<Long> getSyncedPeriodsForDeliveryZoneAndProgram(Long zoneId, Long programId); Distribution getBy(Long distributionId); }
DistributionRepository { public Distribution create(Distribution distribution) { distribution.setStatus(DistributionStatus.INITIATED); mapper.insert(distribution); return distribution; }  Distribution create(Distribution distribution); Distribution get(Distribution distribution); void updateDistributionStatus(Long distributionId, DistributionStatus status, Long modifiedBy); List<Long> getSyncedPeriodsForDeliveryZoneAndProgram(Long zoneId, Long programId); Distribution getBy(Long distributionId);  }