@Test public void shouldNotDisplayPhysicalInventoryAndDefaultReasonOnMenu() throws MovementReasonNotFoundException{ assertThat(reasonManager.queryByCode(MovementReasonManager.INVENTORY).canBeDisplayOnMovementMenu(), is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.DEFAULT_ISSUE).canBeDisplayOnMovementMenu(), is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.DEFAULT_RECEIVE).canBeDisplayOnMovementMenu(), is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.DEFAULT_NEGATIVE_ADJUSTMENT).canBeDisplayOnMovementMenu(), is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.DEFAULT_POSITIVE_ADJUSTMENT).canBeDisplayOnMovementMenu(), is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.DONATION).canBeDisplayOnMovementMenu(),is(false)); assertThat(reasonManager.queryByCode(MovementReasonManager.UNPACK_KIT).canBeDisplayOnMovementMenu(),is(false)); }
public MovementReason queryByCode(final String code) throws MovementReasonNotFoundException{ Optional<MovementReason> matched = FluentIterable.from(currentReasonList).firstMatch(movementReason -> movementReason.getCode().equalsIgnoreCase(code)); if (!matched.isPresent()){ throw new MovementReasonNotFoundException(code); } return matched.get(); }
MovementReasonManager { public MovementReason queryByCode(final String code) throws MovementReasonNotFoundException{ Optional<MovementReason> matched = FluentIterable.from(currentReasonList).firstMatch(movementReason -> movementReason.getCode().equalsIgnoreCase(code)); if (!matched.isPresent()){ throw new MovementReasonNotFoundException(code); } return matched.get(); } }
MovementReasonManager { public MovementReason queryByCode(final String code) throws MovementReasonNotFoundException{ Optional<MovementReason> matched = FluentIterable.from(currentReasonList).firstMatch(movementReason -> movementReason.getCode().equalsIgnoreCase(code)); if (!matched.isPresent()){ throw new MovementReasonNotFoundException(code); } return matched.get(); } @Inject private  MovementReasonManager(Context context); }
MovementReasonManager { public MovementReason queryByCode(final String code) throws MovementReasonNotFoundException{ Optional<MovementReason> matched = FluentIterable.from(currentReasonList).firstMatch(movementReason -> movementReason.getCode().equalsIgnoreCase(code)); if (!matched.isPresent()){ throw new MovementReasonNotFoundException(code); } return matched.get(); } @Inject private  MovementReasonManager(Context context); static MovementReasonManager getInstance(); void refresh(); List<MovementReason> buildReasonListForMovementType(final MovementType type); MovementReason queryByDesc(final String reason); MovementReason queryByDesc(final String desc, Locale locale); MovementReason queryByCode(final String code); Resources getResourceByLocal(Locale locale); List<MovementType> getMovementTypes(); }
MovementReasonManager { public MovementReason queryByCode(final String code) throws MovementReasonNotFoundException{ Optional<MovementReason> matched = FluentIterable.from(currentReasonList).firstMatch(movementReason -> movementReason.getCode().equalsIgnoreCase(code)); if (!matched.isPresent()){ throw new MovementReasonNotFoundException(code); } return matched.get(); } @Inject private  MovementReasonManager(Context context); static MovementReasonManager getInstance(); void refresh(); List<MovementReason> buildReasonListForMovementType(final MovementType type); MovementReason queryByDesc(final String reason); MovementReason queryByDesc(final String desc, Locale locale); MovementReason queryByCode(final String code); Resources getResourceByLocal(Locale locale); List<MovementType> getMovementTypes(); static final String INVENTORY_POSITIVE; static final String INVENTORY_NEGATIVE; static final String INVENTORY; static final String DEFAULT_ISSUE; static final String DEFAULT_RECEIVE; static final String DEFAULT_NEGATIVE_ADJUSTMENT; static final String DEFAULT_POSITIVE_ADJUSTMENT; static final String UNPACK_KIT; static final String DONATION; static final String DDM; static final String RETURN_TO_DDM; static final String RES_DIVIDER; }