target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void shouldAddFailureMessageOnNoValueForFormComponent() { FormComponent state = mock(FormComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); given(state.getFieldValue()).willReturn(null); given(state.getLocale()).willReturn(Locale.ENGLISH); qualityControlService.clo...
public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
@Test public void shouldAddFailureMessageOnNoValueForNonFormComponent() { GridComponent state = mock(GridComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); given(state.getFieldValue()).willReturn(null); given(state.getLocale()).willReturn(Locale.ENGLISH); qualityControlService....
public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s...
@Test public void shouldGenerateQualityControlForBatch() { DataDefinition genealogyDataDefinition = mock(DataDefinition.class); List<Entity> genealogies = new ArrayList<Entity>(); Entity genealogy = new DefaultEntity(genealogyDataDefinition); genealogy.setField("batch", "1"); genealogies.add(genealogy); GridComponent s...
public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smar...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
@Test public final void shouldDisableDeleteButtonWhenAnyOfWorkPlansIsGeneratedAndRelatesToAtLeastOneCompletedOrder() { stubGridSelectedEntities(mockWorkPlanEntity(false, OrderState.PENDING, OrderState.PENDING, OrderState.COMPLETED), mockWorkPlanEntity(true, OrderState.ABANDONED, OrderState.COMPLETED)); workPlansListHoo...
public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); }
WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } }
WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } }
WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView...
WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView...
@Test public void shouldGenerateQualityControlForUnit() { GridComponent state = mock(GridComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); DataDefinition orderDataDefinition = mock(DataDefinition.class); Entity order = mock(Entity.class); Entity technology = mock(Entity.class)...
public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smar...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
QualityControlService { public void generateQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else ...
@Test public void shouldEnableCalendarsOnPreRender() { FieldComponent dateFrom = mock(FieldComponent.class); FieldComponent dateTo = mock(FieldComponent.class); ViewDefinitionState state = mock(ViewDefinitionState.class); given(state.getComponentByReference("dateFrom")).willReturn(dateFrom); given(state.getComponentByR...
public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); dateTo.setEnabled(true); }
QualityControlService { public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); dateTo.setEnable...
QualityControlService { public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); dateTo.setEnable...
QualityControlService { public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); dateTo.setEnable...
QualityControlService { public void enableCalendarsOnRender(final ViewDefinitionState state) { FieldComponent dateFrom = (FieldComponent) state.getComponentByReference(DATE_FROM_LITERAL); FieldComponent dateTo = (FieldComponent) state.getComponentByReference(DATE_TO_LITERAL); dateFrom.setEnabled(true); dateTo.setEnable...
@Test public void shouldSetQuantitiesToDefaultsIfEmpty() { FormComponent form = mock(FormComponent.class); FieldComponent takenForControl = mock(FieldComponent.class); FieldComponent rejectedQuantity = mock(FieldComponent.class); FieldComponent acceptedDefectsQuantity = mock(FieldComponent.class); ViewDefinitionState s...
public void setQuantitiesToDefaulIfEmpty(final ViewDefinitionState state) { FieldComponent takenForControlQuantity = (FieldComponent) state .getComponentByReference(TAKEN_FOR_CONTROL_QUANTITY_LITERAL); FieldComponent rejectedQuantity = (FieldComponent) state.getComponentByReference(REJECTED_QUANTITY_LITERAL); FieldComp...
QualityControlService { public void setQuantitiesToDefaulIfEmpty(final ViewDefinitionState state) { FieldComponent takenForControlQuantity = (FieldComponent) state .getComponentByReference(TAKEN_FOR_CONTROL_QUANTITY_LITERAL); FieldComponent rejectedQuantity = (FieldComponent) state.getComponentByReference(REJECTED_QUAN...
QualityControlService { public void setQuantitiesToDefaulIfEmpty(final ViewDefinitionState state) { FieldComponent takenForControlQuantity = (FieldComponent) state .getComponentByReference(TAKEN_FOR_CONTROL_QUANTITY_LITERAL); FieldComponent rejectedQuantity = (FieldComponent) state.getComponentByReference(REJECTED_QUAN...
QualityControlService { public void setQuantitiesToDefaulIfEmpty(final ViewDefinitionState state) { FieldComponent takenForControlQuantity = (FieldComponent) state .getComponentByReference(TAKEN_FOR_CONTROL_QUANTITY_LITERAL); FieldComponent rejectedQuantity = (FieldComponent) state.getComponentByReference(REJECTED_QUAN...
QualityControlService { public void setQuantitiesToDefaulIfEmpty(final ViewDefinitionState state) { FieldComponent takenForControlQuantity = (FieldComponent) state .getComponentByReference(TAKEN_FOR_CONTROL_QUANTITY_LITERAL); FieldComponent rejectedQuantity = (FieldComponent) state.getComponentByReference(REJECTED_QUAN...
@Test public void shouldSetCommentAsRequiredOnPositiveDefectsQuantity() { ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent acceptedDefectsQuantity = mock(FieldComponent.class); FieldComponent comment = mock(FieldComponent.class); given(viewDefinitionState.getComponentByReference...
public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldComponent) state; FieldComponen...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
@Test public void shouldSetCommentAsNotRequiredOnPositiveDefectsQuantity() { ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent state = mock(FieldComponent.class); FieldComponent comment = mock(FieldComponent.class); given(viewDefinitionState.getComponentByReference("comment")).wi...
public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldComponent) state; FieldComponen...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
QualityControlService { public void checkAcceptedDefectsQuantity(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not input"); } FieldComponent acceptedDefectsQuantity = (FieldCompone...
@Test public void shouldSetQualityControlInstructionToDefaultFromTechnology() { ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent state = mock(FieldComponent.class); FieldComponent controlInstruction = mock(FieldComponent.class); DataDefinition orderDD = mock(DataDefinition.class...
public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldComponent) viewDefinitionState .getCompo...
QualityControlService { public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldComponent) viewD...
QualityControlService { public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldComponent) viewD...
QualityControlService { public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldComponent) viewD...
QualityControlService { public void setQualityControlInstruction(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { return; } FieldComponent order = (FieldComponent) state; FieldComponent controlInstruction = (FieldComponent) viewD...
@Test public void shouldSetOperationAsRequired() { ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent operation = mock(FieldComponent.class); given(viewDefinitionState.getComponentByReference("operation")).willReturn(operation); qualityControlService.setOperationAsRequired(viewDef...
public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); }
QualityControlService { public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); } }
QualityControlService { public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); } }
QualityControlService { public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); } void setTechnology(final ViewDefinitionState view); void checkIfCommentIsRequiredBasedOnResult(final...
QualityControlService { public void setOperationAsRequired(final ViewDefinitionState state) { FieldComponent operation = (FieldComponent) state.getComponentByReference(OPERATION_LITERAL); operation.setRequired(true); } void setTechnology(final ViewDefinitionState view); void checkIfCommentIsRequiredBasedOnResult(final...
@Test public void shouldSetQualityControlTypeHiddenFieldToQualityControlsForBatch() { ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FormComponent qualityControlsForm = mock(FormComponent.class); FieldComponent qualityControlType = mock(FieldComponent.class); FieldComponent closed = mock(Fie...
public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Control", "Controls"); FieldComponent qual...
QualityControlService { public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Control", "Control...
QualityControlService { public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Control", "Control...
QualityControlService { public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Control", "Control...
QualityControlService { public void setQualityControlTypeHiddenField(final ViewDefinitionState viewDefinitionState) { FormComponent qualityControlsForm = (FormComponent) viewDefinitionState.getComponentByReference(FORM_LITERAL); String qualityControlTypeString = qualityControlsForm.getName().replace("Control", "Control...
@Test public void shouldSetErrorMessageOnEmptyOperationField() { DataDefinition qualityControlDD = mock(DataDefinition.class); FieldDefinition operation = mock(FieldDefinition.class); Entity qualityControl = mock(Entity.class); given(qualityControl.getStringField("qualityControlType")).willReturn("qualityControlsForOpe...
public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity.getField(OPERATION_LITERAL); if (opera...
QualityControlService { public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity.getField(OPERA...
QualityControlService { public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity.getField(OPERA...
QualityControlService { public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity.getField(OPERA...
QualityControlService { public boolean checkIfOperationIsRequired(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (QUALITY_CONTROLS_FOR_OPERATION_LITERAL.equals(qualityControlType)) { Object operation = entity.getField(OPERA...
@Test public void shouldSetQuantitiesToDefaultValues() { DataDefinition qualityControlDD = mock(DataDefinition.class); Entity entity = mock(Entity.class); given(entity.getStringField("qualityControlType")).willReturn("qualityControlsForUnit"); given(entity.getDecimalField("controlledQuantity")).willReturn(null); given(...
public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTROLLED_QUANTITY_LITERAL);...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
@Test public void shouldClearGeneratedOnCopy() { workPlanHooks.onCopy(workPlanDD, workPlan); verify(workPlan).setField(WorkPlanFields.FILE_NAME, null); verify(workPlan).setField(WorkPlanFields.GENERATED, false); verify(workPlan).setField(WorkPlanFields.DATE, null); verify(workPlan).setField(WorkPlanFields.WORKER, null)...
public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); }
WorkPlanHooks { public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); } }
WorkPlanHooks { public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); } }
WorkPlanHooks { public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); } void onCreate(final DataDefinition workPlanDD, final Entity workPlan); void onCopy(final DataDefinition workPlanDD, final Entity workPlan); }
WorkPlanHooks { public void onCopy(final DataDefinition workPlanDD, final Entity workPlan) { clearGeneratedOnCopy(workPlan); } void onCreate(final DataDefinition workPlanDD, final Entity workPlan); void onCopy(final DataDefinition workPlanDD, final Entity workPlan); }
@Test public void shouldSetFieldsVisibleAndRequiredWhenChangeoverTypeIsForTechnology() { given(changeoverType.getFieldValue()).willReturn(FOR_TECHNOLOGY.getStringValue()); hooks.setFieldsVisibleAndRequired(view, null, null); verify(fromTechnology).setVisible(true); verify(fromTechnology).setRequired(true); verify(toTec...
public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); }
LineChangeoverNormsDetailsHooks { public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); } }
LineChangeoverNormsDetailsHooks { public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); } }
LineChangeoverNormsDetailsHooks { public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); } final void onBeforeRender(final ViewDefinitionState view); void setLineChangeoverNormsName(final ViewDefinitionState...
LineChangeoverNormsDetailsHooks { public void setFieldsVisibleAndRequired(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { setFieldsVisibleAndRequired(view); } final void onBeforeRender(final ViewDefinitionState view); void setLineChangeoverNormsName(final ViewDefinitionState...
@Test public void shouldAddErrorMessageOnTooLargeRejectedQuantity() { DataDefinition qualityControlDD = mock(DataDefinition.class); Entity entity = mock(Entity.class); given(entity.getStringField("qualityControlType")).willReturn("qualityControlsForUnit"); given(entity.getDecimalField("controlledQuantity")).willReturn(...
public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTROLLED_QUANTITY_LITERAL);...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
@Test public void shouldAddErrorMessageOnTooLargeAcceptedDefectsQuantity() { DataDefinition qualityControlDD = mock(DataDefinition.class); Entity entity = mock(Entity.class); given(entity.getStringField("qualityControlType")).willReturn("qualityControlsForUnit"); given(entity.getDecimalField("controlledQuantity")).will...
public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTROLLED_QUANTITY_LITERAL);...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
QualityControlService { public boolean checkIfQuantitiesAreCorrect(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasQuantitiesToBeChecked(qualityControlType)) { BigDecimal controlledQuantity = entity.getDecimalField(CONTR...
@Test public void shouldReturnFalseWhenUserNotLoggedIn() { given(securityService.getCurrentUserId()).willReturn(null); boolean result = draftDocumentsNotificationService.shouldNotifyCurrentUser(); verify(securityService).getCurrentUserId(); verify(securityService, never()).hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION...
public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; }
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } }
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
@Test public void shouldReturnFalseWhenUserHasNoRole() { given(securityService.getCurrentUserId()).willReturn(CURRENT_USER_ID); given(securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION)).willReturn(Boolean.FALSE); boolean result = draftDocumentsNotificationService.shouldNotifyCurrentUser(); verify(securityS...
public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; }
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } }
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
DraftDocumentsNotificationService { public boolean shouldNotifyCurrentUser() { Long currentUserId = securityService.getCurrentUserId(); return currentUserId != null && securityService.hasCurrentUserRole(ROLE_DOCUMENTS_NOTIFICATION) && countDraftDocumentsForUser(currentUserId) > 0; } @Autowired DraftDocumentsNotificati...
@Test public void shouldEnabledButtonWhenProductOnTreeIsSelected() throws Exception { when(view.getComponentByReference("window")).thenReturn((ComponentState) windowComponent); when(windowComponent.getRibbon()).thenReturn(ribbon); when(ribbon.getGroupByName("edit")).thenReturn(ribbonGroup); when(ribbonGroup.getItemByNa...
public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); }
ProductsFamiliesListeners { public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); } }
ProductsFamiliesListeners { public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); } }
ProductsFamiliesListeners { public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); } final void generateHierarchyTree(final ViewDefinitionState view, final ComponentState state, final String[] args); final void editSelect...
ProductsFamiliesListeners { public final void enabledEditButton(final ViewDefinitionState view, final ComponentState state, final String[] args) { setEditButtonEnabled(view, true); } final void generateHierarchyTree(final ViewDefinitionState view, final ComponentState state, final String[] args); final void editSelect...
@Test public void shouldPrepareViewForParameters() throws Exception { Map<String, String> arguments = ImmutableMap.of("context", "{\"form.id\":\"13\"}"); ModelAndView expectedMav = mock(ModelAndView.class); CrudService crudController = mock(CrudService.class); given( crudController.prepareView(BasicConstants.PLUGIN_IDE...
@RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("context", json.toString()); retur...
BasicController { @RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("context", json....
BasicController { @RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("context", json....
BasicController { @RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("context", json....
BasicController { @RequestMapping(value = "parameters", method = RequestMethod.GET) public ModelAndView getParameterPageView(final Locale locale) { JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); Map<String, String> arguments = ImmutableMap.of("context", json....
@Test public void shouldDisabledFormWhenExternalNumberIsNotNull() throws Exception { Long productId = 1L; given(view.getComponentByReference(L_FORM)).willReturn(productForm); given(view.getComponentByReference(ProductFields.PARENT)).willReturn(parentField); given(view.getComponentByReference(ProductFields.ENTITY_TYPE))...
public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentField = (FieldComponent) s...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
@Test public void shouldntDisabledFormWhenExternalNumberIsNull() throws Exception { Long productId = 1L; given(view.getComponentByReference(L_FORM)).willReturn(productForm); given(view.getComponentByReference(ProductFields.PARENT)).willReturn(parentField); given(view.getComponentByReference(ProductFields.ENTITY_TYPE))....
public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentField = (FieldComponent) s...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
ProductDetailsHooks { public void disableProductFormForExternalItems(final ViewDefinitionState state) { FormComponent productForm = (FormComponent) state.getComponentByReference(L_FORM); FieldComponent entityTypeField = (FieldComponent) state.getComponentByReference(ProductFields.ENTITY_TYPE); FieldComponent parentFiel...
@Test public void shouldntFillUnitIfFormIsSaved() { given(view.getComponentByReference(L_FORM)).willReturn(productForm); given(view.getComponentByReference(UNIT)).willReturn(unitField); given(productForm.getEntityId()).willReturn(L_ID); productDetailsHooks.fillUnit(view); verify(unitField, never()).setFieldValue(Mockit...
public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) { unitField.setFieldVal...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
@Test public void shouldFillUnitIfFormIsntSaved() { given(view.getComponentByReference(L_FORM)).willReturn(productForm); given(view.getComponentByReference(UNIT)).willReturn(unitField); given(productForm.getEntityId()).willReturn(null); given(unitField.getFieldValue()).willReturn(null); given(unitService.getDefaultUnit...
public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) { unitField.setFieldVal...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
ProductDetailsHooks { public void fillUnit(final ViewDefinitionState view) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent unitField = (FieldComponent) view.getComponentByReference(UNIT); if ((productForm.getEntityId() == null) && (unitField.getFieldValue() == null)) {...
@Test public final void shouldGetSelectedEntities() { List<Entity> entities = ImmutableList.of(mockEntity(), mockEntity(), mockEntity(), mockEntity()); given(workPlansGrid.getSelectedEntities()).willReturn(entities); List<Entity> result = workPlansListView.getSelectedWorkPlans(); assertEquals(entities, result); }
public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); }
WorkPlansListView { public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); } }
WorkPlansListView { public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, final GridComponent workPlansGrid); }
WorkPlansListView { public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, final GridComponent workPlansGrid); static WorkPlansListView from(final ViewDefinitionState view); void setUpDeleteButton(fi...
WorkPlansListView { public List<Entity> getSelectedWorkPlans() { return workPlansGrid.getSelectedEntities(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, final GridComponent workPlansGrid); static WorkPlansListView from(final ViewDefinitionState view); void setUpDeleteButton(fi...
@Test public void sholudReturnTrueIfProductIsNull() { given(unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT)).willReturn(null); boolean result = unitConversionItemValidatorsB.validateUnitOnConversionWithProduct(dataDefinition, unitConversionItem); assertTrue(result); }
public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConversionItemFields.UNIT_FROM); if (pr...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
@Test public void sholudReturnTrueIfProductUnitIsEqualFieldUnit() { stubConversionSourceUnit(SOME_UNIT); stubProductUnit(SOME_UNIT); boolean result = unitConversionItemValidatorsB.validateUnitOnConversionWithProduct(dataDefinition, unitConversionItem); assertTrue(result); verify(unitConversionItem, Mockito.never()).add...
public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConversionItemFields.UNIT_FROM); if (pr...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
@Test public void sholudReturnErrorIfProductUnitIsNotEqualFieldUnit() { stubConversionSourceUnit(SOME_UNIT); stubProductUnit("otherNotEqualSzt"); boolean result = unitConversionItemValidatorsB.validateUnitOnConversionWithProduct(dataDefinition, unitConversionItem); assertFalse(result); verify(unitConversionItem).addErr...
public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConversionItemFields.UNIT_FROM); if (pr...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
UnitConversionItemValidatorsB { public boolean validateUnitOnConversionWithProduct(final DataDefinition dataDefinition, final Entity unitConversionItem) { final Entity product = unitConversionItem.getBelongsToField(UnitConversionItemFieldsB.PRODUCT); final String unitFrom = unitConversionItem.getStringField(UnitConvers...
@Test public void shouldReturnWhenEntityIdIsNull() throws Exception { when(entity.getId()).thenReturn(null); productHooks.clearFamilyFromProductWhenTypeIsChanged(dataDefinition, entity); }
public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PARTICULAR_PRODUCT....
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
@Test public void shouldReturnWhenSavingEntityIsFamily() throws Exception { Long entityId = 1L; when(entity.getId()).thenReturn(entityId); when(entity.getStringField(ProductFields.ENTITY_TYPE)).thenReturn("02productsFamily"); when(entity.getDataDefinition()).thenReturn(dataDefinition); when(dataDefinition.get(entityId)...
public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PARTICULAR_PRODUCT....
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
@Test public void shouldDeleteFamilyFromProductsWhenEntityTypeIsChanged() throws Exception { Long entityId = 1L; when(entity.getId()).thenReturn(entityId); when(entity.getStringField(ProductFields.ENTITY_TYPE)).thenReturn("01particularProduct"); when(dataDefinition.get(entityId)).thenReturn(product); when(product.getSt...
public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PARTICULAR_PRODUCT....
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
ProductHooks { public void clearFamilyFromProductWhenTypeIsChanged(final DataDefinition productDD, final Entity product) { if (product.getId() == null) { return; } String entityType = product.getStringField(ENTITY_TYPE); Entity productFromDB = product.getDataDefinition().get(product.getId()); if (entityType.equals(PART...
@Test public void shouldClearExternalIdOnCopy() throws Exception { productHooks.clearExternalIdOnCopy(dataDefinition, entity); Mockito.verify(entity).setField("externalNumber", null); }
public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); }
ProductHooks { public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); } }
ProductHooks { public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); } }
ProductHooks { public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); } void generateNodeNumber(final DataDefinition productDD, final Entity product); void updateNodeNumber(final DataDefinition productDD, fi...
ProductHooks { public void clearExternalIdOnCopy(final DataDefinition dataDefinition, final Entity entity) { if (entity == null) { return; } entity.setField("externalNumber", null); } void generateNodeNumber(final DataDefinition productDD, final Entity product); void updateNodeNumber(final DataDefinition productDD, fi...
@Test public void shouldParseCorrectlyGivenExampleDocument() throws Exception { Map<String, BigDecimal> map = service.parse(inputStream, ExchangeRatesNbpService.NbpProperties.LAST_C); assertTrue(map.containsKey("USD")); assertTrue(map.containsKey("CAD")); assertTrue(map.containsKey("AUD")); assertTrue(map.containsValue...
@Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory.createXMLStreamReader(inputStream); sr.nextTag(); sr.nextTag(); ...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
@Test public void shouldParseAlwaysCloseInputStream() throws Exception { InputStream inputStreamSpied = spy(inputStream); service.parse(inputStreamSpied, ExchangeRatesNbpService.NbpProperties.LAST_C); verify(inputStreamSpied, atLeastOnce()).close(); }
@Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory.createXMLStreamReader(inputStream); sr.nextTag(); sr.nextTag(); ...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
ExchangeRatesNbpServiceImpl implements ExchangeRatesNbpService { @Override public Map<String, BigDecimal> parse(InputStream inputStream, NbpProperties nbpProperties) { Map<String, BigDecimal> exRates = new HashMap<>(); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader sr = inputFactory...
@Test public final void shouldCheckEanUniquenessJustReturnTrueIfNewEanIsEmpty() { String oldVal = "123456"; String newVal = ""; boolean isValid = productValidators.checkEanUniqueness(dataDefinition, fieldDefinition, entity, oldVal, newVal); assertTrue(isValid); verify(entity, never()).addError(any(FieldDefinition.class...
public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return true; } if (productWit...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
@Test public final void shouldSetUpDeleteButton() { boolean isEnabled = true; String message = "some arbitrary mesage"; workPlansListView.setUpDeleteButton(isEnabled, message); verify(deleteButton).setEnabled(isEnabled); verify(deleteButton).setMessage(message); verify(deleteButton).requestUpdate(true); verify(windowCo...
public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); }
WorkPlansListView { public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); } }
WorkPlansListView { public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, ...
WorkPlansListView { public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, ...
WorkPlansListView { public void setUpDeleteButton(final boolean isEnabled, final String message) { deleteButton.setEnabled(isEnabled); deleteButton.setMessage(message); deleteButton.requestUpdate(true); window.requestRibbonRender(); } WorkPlansListView(final WindowComponent window, final RibbonActionItem deleteButton, ...
@Test public final void shouldCheckEanUniquenessJustReturnTrueIfNewEanIsNull() { String oldVal = "123456"; String newVal = null; boolean isValid = productValidators.checkEanUniqueness(dataDefinition, fieldDefinition, entity, oldVal, newVal); assertTrue(isValid); verify(entity, never()).addError(any(FieldDefinition.clas...
public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return true; } if (productWit...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
@Test public final void shouldCheckEanUniquenessReturnTrueIfThereIsNoExistingProductsWithGivenId() { String oldVal = "123456"; String newVal = "654321"; ArgumentCaptor<SearchCriterion> criterionCaptor = ArgumentCaptor.forClass(SearchCriterion.class); stubSearchCriteriaWith(null); boolean isValid = productValidators.che...
public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return true; } if (productWit...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
@Test public final void shouldCheckEanUniquenessReturnFalsAndMarkFieldAsInvalidIfProductsWithGivenIdExists() { String oldVal = "123456"; String newVal = "654321"; ArgumentCaptor<SearchCriterion> criterionCaptor = ArgumentCaptor.forClass(SearchCriterion.class); Entity resultEntity = mock(Entity.class); stubSearchCriteri...
public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return true; } if (productWit...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
ProductValidators { public boolean checkEanUniqueness(final DataDefinition productDD, final FieldDefinition eanFieldDefinition, final Entity product, final Object eanOldValue, final Object eanNewValue) { String ean = (String) eanNewValue; if (StringUtils.isEmpty(ean) || ObjectUtils.equals(eanOldValue, ean)) { return tr...
@Test public void shouldReturnExistingCompanyEntityId() throws Exception { Entity company = Mockito.mock(Entity.class); given(company.getId()).willReturn(13L); given(parameterService.getParameter()).willReturn(parameter); given(parameter.getBelongsToField(ParameterFields.COMPANY)).willReturn(company); Long id = company...
public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } }
CompanyService { public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } } }
CompanyService { public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } } }
CompanyService { public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean isCompanyOwner(final Entity company); void disabledGridWhenComp...
CompanyService { public Long getCompanyId() { if (getCompany() == null) { return null; } else { return getCompany().getId(); } } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean isCompanyOwner(final Entity company); void disabledGridWhenComp...
@Test public void shouldReturnExistingCompanyEntity() throws Exception { given(parameterService.getParameter()).willReturn(parameter); given(parameter.getBelongsToField(ParameterFields.COMPANY)).willReturn(company); given(company.isValid()).willReturn(true); Entity existingcompany = companyService.getCompany(); assertE...
@Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); }
CompanyService { @Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); } }
CompanyService { @Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); } }
CompanyService { @Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean isCompanyOwner(f...
CompanyService { @Transactional public Entity getCompany() { Entity parameter = parameterService.getParameter(); return parameter.getBelongsToField(ParameterFields.COMPANY); } Long getCompanyId(); @Transactional Entity getCompany(); @Transactional Entity getCompany(final Long companyId); final Boolean isCompanyOwner(f...
@Test public final void shouldReturnWorkingHoursForDay() { String hours = "6:00-12:00, 21:30-2:30"; given(shiftEntity.getStringField(ShiftFields.MONDAY_HOURS)).willReturn(hours); given(shiftEntity.getBooleanField(ShiftFields.MONDAY_WORKING)).willReturn(true); LocalDate mondayDate = new LocalDate(2013, 9, 2); Shift shif...
public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRange timeRangeFromPlan :...
Shift { public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRange timeRangeFr...
Shift { public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRange timeRangeFr...
Shift { public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRange timeRangeFr...
Shift { public Optional<DateRange> findWorkTimeAt(final Date date) { if (timetableExceptions.hasFreeTimeAt(date)) { return Optional.absent(); } DateTime dateTime = new DateTime(date); Optional<TimeRange> maybeTimeRangeFromPlan = findWorkTimeAt(dateTime.getDayOfWeek(), dateTime.toLocalTime()); for (TimeRange timeRangeFr...
@Test public final void shouldBuildWorkingHoursFromSingleTimeRangeWithTwoDigitsHour() { String timeRangeString = "09:00-17:00"; WorkingHours workingHours = new WorkingHours(timeRangeString); assertEquals(1, workingHours.getTimeRanges().size()); TimeRange timeRange = workingHours.getTimeRanges().iterator().next(); asser...
public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); boolean isEmpty(); boolean contains(final LocalTime time); Optional<TimeRange> findRangeFor(final LocalTime time); Set<TimeRange> getTimeRanges()...
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); boolean isEmpty(); boolean contains(final LocalTime time); Optional<TimeRange> findRangeFor(final LocalTime time); Set<TimeRange> getTimeRanges()...
@Test public final void shouldBuildWorkingHoursFromSingleTimeRangeWithOneDigitsHour() { String timeRangeString = "9:00-17:00"; WorkingHours workingHours = new WorkingHours(timeRangeString); assertEquals(1, workingHours.getTimeRanges().size()); TimeRange timeRange = workingHours.getTimeRanges().iterator().next(); assert...
public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); }
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); boolean isEmpty(); boolean contains(final LocalTime time); Optional<TimeRange> findRangeFor(final LocalTime time); Set<TimeRange> getTimeRanges()...
WorkingHours implements Comparable<WorkingHours> { public Set<TimeRange> getTimeRanges() { return Collections.unmodifiableSet(hours); } WorkingHours(final String hourRanges); boolean isEmpty(); boolean contains(final LocalTime time); Optional<TimeRange> findRangeFor(final LocalTime time); Set<TimeRange> getTimeRanges()...
@Test public void shouldReturnTreeWithoutChildrenWhenDoesnotExists() throws Exception { EntityList emptyList = mockEntityList(new LinkedList<Entity>()); when(productDsk.getHasManyField(PRODUCT_FAMILY_CHILDRENS)).thenReturn(emptyList); List<Entity> tree = productsFamiliesTreeService.getHierarchyProductsTree(productDsk);...
public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
@Test public void shouldReturnTreeWithTwoLevel() throws Exception { List<Entity> tree = productsFamiliesTreeService.getHierarchyProductsTree(productDsk); assertEquals(4, tree.size()); assertEquals(productDsk3, tree.get(2)); assertEquals(productDsk2, tree.get(3)); }
public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
@Test public void shouldReturnNullWhenGetProductCatalogNumber() { given(productCatalogNumbersDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.add(Mockito.any(SearchCriterion.class))).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.setMaxResults(1)).willReturn(searchCriteriaBuilde...
@Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find() .add(SearchRestrictions.belongsTo(PRODUCT, product)).add(SearchRestricti...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
@Test public void shouldReturnTreeWithOneLevel() throws Exception { EntityList emptyList = mockEntityList(new LinkedList<Entity>()); when(productDsk1.getHasManyField(PRODUCT_FAMILY_CHILDRENS)).thenReturn(emptyList); List<Entity> tree = productsFamiliesTreeService.getHierarchyProductsTree(productDsk); assertEquals(3, tr...
public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
ProductsFamiliesTreeService { public List<Entity> getHierarchyProductsTree(final Entity product) { List<Entity> tree = new ArrayList<Entity>(); addProduct(tree, product); generateTree(product, tree); return tree; } List<Entity> getHierarchyProductsTree(final Entity product); }
@Test public void shouldReturnTrueWhenCheckIfProductEntityTypeIsCorrect() throws Exception { given(product.getStringField(ENTITY_TYPE)).willReturn(PARTICULAR_PRODUCT.getStringValue()); boolean result = productService.checkIfProductEntityTypeIsCorrect(product, PARTICULAR_PRODUCT); assertTrue(result); }
public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order);...
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order);...
@Test public void shouldReturnFalseWhenCheckIfProductEntityTypeIsCorrect() throws Exception { given(product.getStringField(ENTITY_TYPE)).willReturn(PARTICULAR_PRODUCT.getStringValue()); boolean result = productService.checkIfProductEntityTypeIsCorrect(product, PRODUCTS_FAMILY); assertFalse(result); }
public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } }
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order);...
ProductService { public boolean checkIfProductEntityTypeIsCorrect(final Entity product, final ProductFamilyElementType entityType) { return entityType.getStringValue().equals(product.getStringField(ENTITY_TYPE)); } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order);...
@Test public void shouldReturnTrueWhenProductIsNotRemoved() throws Exception { boolean result = productService.checkIfProductIsNotRemoved(productDD, product); assertTrue(result); }
public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIF...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
@Test public void shouldReturnFalseWhenEntityDoesnotExists() throws Exception { DataDefinition productDD = Mockito.mock(DataDefinition.class); Long productId = 1L; given(substitute.getBelongsToField(SubstituteFields.PRODUCT)).willReturn(product); given(dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIFIER, BasicCo...
public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIF...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
@Test public void shouldReturnTrueWhenProductExists() throws Exception { DataDefinition productDD = Mockito.mock(DataDefinition.class); Long productId = 1L; given(substitute.getBelongsToField(SubstituteFields.PRODUCT)).willReturn(product); given(dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIFIER, BasicConstants...
public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIF...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
ProductService { public boolean checkIfProductIsNotRemoved(final DataDefinition substituteDD, final Entity substitute) { Entity product = substitute.getBelongsToField(SubstituteFields.PRODUCT); if (product == null || product.getId() == null) { return true; } Entity productEntity = dataDefinitionService.get(BasicConstan...
@Test public void shouldReturnFalseWhenSubstituteDoesnotExists() throws Exception { DataDefinition substituteDD = Mockito.mock(DataDefinition.class); Long substituteId = 1L; given(substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE)).willReturn(substitute); given(dataDefinitionService.get(BasicCo...
public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity substituteEntity = d...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
@Test public void shouldReturnTrueWhenEntityDoesnotHaveBTSubstitute() throws Exception { boolean result = productService.checkIfSubstituteIsNotRemoved(substituteComponentDD, substituteComponent); assertTrue(result); }
public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity substituteEntity = d...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
@Test public void shouldReturnTrueWhenSubstitueExists() throws Exception { DataDefinition substituteDD = Mockito.mock(DataDefinition.class); Long substituteId = 1L; given(substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE)).willReturn(substitute); given(dataDefinitionService.get(BasicConstants.P...
public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity substituteEntity = d...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
ProductService { public boolean checkIfSubstituteIsNotRemoved(final DataDefinition substituteComponentDD, final Entity substituteComponent) { Entity substitute = substituteComponent.getBelongsToField(SubstituteComponentFields.SUBSTITUTE); if (substitute == null || substitute.getId() == null) { return true; } Entity sub...
@Test public void shouldntFillUnitIfUnitIsntNull() { Entity product = mock(Entity.class); DataDefinition productDD = mock(DataDefinition.class); given(product.getField(UNIT)).willReturn(L_SZT); productService.fillUnit(productDD, product); verify(product, never()).setField(Mockito.anyString(), Mockito.anyString()); }
public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order); List...
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order); List...
@Test public void shouldReturnProductCatalogNumberWhenFetProductCatalogNumber() { given(productCatalogNumbersDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.add(Mockito.any(SearchCriterion.class))).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.setMaxResults(1)).willReturn(sear...
@Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find() .add(SearchRestrictions.belongsTo(PRODUCT, product)).add(SearchRestricti...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
ProductCatalogNumbersServiceImpl implements ProductCatalogNumbersService { @Override public Entity getProductCatalogNumber(final Entity product, final Entity supplier) { return dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find...
@Test public void shouldFillUnitIfUnitIsNull() { Entity product = mock(Entity.class); DataDefinition productDD = mock(DataDefinition.class); given(product.getField(UNIT)).willReturn(null); given(unitService.getDefaultUnitFromSystemParameters()).willReturn(L_SZT); productService.fillUnit(productDD, product); verify(prod...
public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } }
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order); List...
ProductService { public void fillUnit(final DataDefinition productDD, final Entity product) { if (product.getField(UNIT) == null) { product.setField(UNIT, unitService.getDefaultUnitFromSystemParameters()); } } Entity find(final SearchProjection projection, final SearchCriterion criteria, final SearchOrder order); List...
@Test public void shouldReturnWhenEntityIdIsNull() throws Exception { Long technologyOperationComponentId = null; String comment = "comment"; given(technologyOperationComponent.getId()).willReturn(technologyOperationComponentId); technologyOperationComponentHooksOTFO.changeDescriptionInOperationalTasksWhenChanged(techn...
public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { return; } Entity technologyOperationCompo...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
@Test public void shouldReturnWhenTechnologyOperationComponentCommentIsTheSame() throws Exception { Long technologyOperationComponentId = 1L; String comment = "comment"; String technologyOperationComponentComment = "comment"; given(technologyOperationComponent.getId()).willReturn(technologyOperationComponentId); given(...
public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { return; } Entity technologyOperationCompo...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
@Ignore @Test public void shouldChangeOperationalTasksDescriptionWhenTechnologyOperationComponentCommentWasChanged() throws Exception { Long technologyOperationComponentId = 1L; String comment = "comment"; String technologyOperationComponentComment = "comment2"; given(technologyOperationComponent.getId()).willReturn(te...
public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { return; } Entity technologyOperationCompo...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
TechnologyOperationComponentHooksOTFO { public void changeDescriptionInOperationalTasksWhenChanged(final DataDefinition technologyOperationComponentDD, final Entity technologyOperationComponent) { Long technologyOperationComponentId = technologyOperationComponent.getId(); if (technologyOperationComponentId == null) { r...
@Test public void shouldReturnIfEntityIdIsNull() throws Exception { Long operationId = null; String name = "name"; given(operation.getId()).willReturn(operationId); operationHooksOTFO.changedNameInOperationalTasksWhenChanged(operationDD, operation); Mockito.verify(operationalTask, Mockito.never()).setField(OperationalT...
public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.NAME); String operatio...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
@Test public void shouldReturnWhenEntityNameIsTheSame() throws Exception { Long operationId = 1L; String name = "name"; String operationName = "name"; given(operation.getId()).willReturn(operationId); given(operationDD.get(operationId)).willReturn(operationFromDB); given(operation.getStringField(OperationFields.NAME))....
public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.NAME); String operatio...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
@Ignore @Test public void shouldChangeOperationalTaskNameWhenOperationNameWasChanged() throws Exception { Long operationId = 1L; String name = "name"; String operationName = "name2"; given(operation.getId()).willReturn(operationId); given(operationDD.get(operationId)).willReturn(operationFromDB); given(operation.getStr...
public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.NAME); String operatio...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
OperationHooksOTFO { public void changedNameInOperationalTasksWhenChanged(final DataDefinition operationDD, final Entity operation) { Long operationId = operation.getId(); if (operationId == null) { return; } Entity operationFromDB = operationDD.get(operationId); String name = operation.getStringField(OperationFields.N...
@Test public void shouldDisabledFieldWhenTypeForOrderIsSelected() throws Exception { String typeTask = OperationalTaskTypeTaskOTFO.EXECUTION_OPERATION_IN_ORDER.getStringValue(); given(typeTaskField.getFieldValue()).willReturn(typeTask); given(operationalTasksForOrdersService.isOperationalTaskTypeTaskOtherCase(typeTask)...
public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields = Lists.newArrayList(OperationalTa...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
@Test public void shouldEnabledFieldWhenTypeOtherCaseIsSelected() throws Exception { String typeTask = OperationalTaskTypeTask.OTHER_CASE.getStringValue(); given(typeTaskField.getFieldValue()).willReturn(typeTask); given(operationalTasksForOrdersService.isOperationalTaskTypeTaskOtherCase(typeTask)).willReturn(true); op...
public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields = Lists.newArrayList(OperationalTa...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
OperationalTaskDetailsHooksOTFO { public void disableFieldsWhenOrderTypeIsSelected(final ViewDefinitionState view) { FieldComponent typeTaskField = (FieldComponent) view.getComponentByReference(OperationalTaskFields.TYPE_TASK); String typeTask = (String) typeTaskField.getFieldValue(); List<String> referenceBasicFields ...
@Test public void shouldReturnWhenEntityIdIsNull() throws Exception { Long orderId = null; given(order.getId()).willReturn(orderId); orderHooksOTFO.changedProductionLineInOperationalTasksWhenChanged(orderDD, order); }
public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Entity orderProductio...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
@Test public void shouldReturnTrueWhenEntityWithGivenNumberAndCompanyDoesnotExistsInDB() throws Exception { SearchCriterion criterion1 = SearchRestrictions.eq(CATALOG_NUMBER, entity.getStringField(CATALOG_NUMBER)); SearchCriterion criterion2 = SearchRestrictions.belongsTo(ProductCatalogNumberFields.COMPANY, company); g...
public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find() .add(SearchRestrict...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
@Test public void shouldReturnWhenProductionLineIsTheSame() throws Exception { Long orderId = 1L; Long productionLineId = 1L; given(order.getId()).willReturn(orderId); given(orderDD.get(orderId)).willReturn(orderFromDB); given(order.getBelongsToField(OrderFields.PRODUCTION_LINE)).willReturn(productionLine); given(order...
public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Entity orderProductio...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
@Test public void shouldReturneWhenProductionLineIsNull() throws Exception { Long orderId = 1L; Long productionLineId = 1L; given(order.getId()).willReturn(orderId); given(orderDD.get(orderId)).willReturn(orderFromDB); given(order.getBelongsToField(OrderFields.PRODUCTION_LINE)).willReturn(productionLine); given(orderFr...
public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Entity orderProductio...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
@Ignore @Test public void shouldChangeProductionLineWhenProductionLineWasChanged() throws Exception { Long orderId = 1L; Long productionLineId = 1L; Long orderProductionLineId = 2L; given(order.getId()).willReturn(orderId); given(orderDD.get(orderId)).willReturn(orderFromDB); given(order.getBelongsToField(OrderFields.P...
public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Entity orderProductio...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
OrderHooksOTFO { public void changedProductionLineInOperationalTasksWhenChanged(final DataDefinition orderDD, final Entity order) { Long orderId = order.getId(); if (orderId == null) { return; } Entity orderFromDB = orderDD.get(orderId); Entity productionLine = order.getBelongsToField(OrderFields.PRODUCTION_LINE); Enti...
@Test public void shouldEnableButtonWhenIsGeneratedAndOrderStateIsAccepted() throws Exception { String generatedEndDate = "01-02-2012"; given(generatedEndDateField.getFieldValue()).willReturn(generatedEndDate); given(order.getStringField(OrderFields.STATE)).willReturn(OrderStateStringValues.ACCEPTED); given(order.getBe...
public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperationalTasks = operationalTasks.getItemByName(L_CREATE_OP...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
@Test public void shouldDisableButtonWhenIsNotGeneratedAndOrderStateIsInProgress() throws Exception { String generatedEndDate = ""; given(generatedEndDateField.getFieldValue()).willReturn(generatedEndDate); given(order.getStringField(OrderFields.STATE)).willReturn(OrderStateStringValues.IN_PROGRESS); given(order.getBel...
public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperationalTasks = operationalTasks.getItemByName(L_CREATE_OP...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
@Test public void shouldDisableButtonWhenIsNotGeneratedAndOrderStateIsIncorrect() throws Exception { String generatedEndDate = ""; given(generatedEndDateField.getFieldValue()).willReturn(generatedEndDate); given(order.getStringField(OrderFields.STATE)).willReturn(OrderStateStringValues.ABANDONED); given(order.getBelong...
public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperationalTasks = operationalTasks.getItemByName(L_CREATE_OP...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
@Test public void shouldDisableFieldWhenIsGeneratedAndOrderStateIsIncorrect() throws Exception { String generatedEndDate = "01-02-2012"; given(generatedEndDateField.getFieldValue()).willReturn(generatedEndDate); given(order.getStringField(OrderFields.STATE)).willReturn(OrderStateStringValues.DECLINED); given(order.getB...
public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperationalTasks = operationalTasks.getItemByName(L_CREATE_OP...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
OperationDurationDetailsInOrderDetailsHooksOTFO { public void disableCreateButton(final ViewDefinitionState view) { WindowComponent window = (WindowComponent) view.getComponentByReference(L_WINDOW); RibbonGroup operationalTasks = window.getRibbon().getGroupByName(L_OPERATIONAL_TASKS); RibbonActionItem createOperational...
@Test public void shouldReturnTrueWhenOrderIsNotSave() throws Exception { given(operationalTask.getBelongsToField(OperationalTaskFieldsOTFO.ORDER)).willReturn(null); boolean result = operationalTaskValidatorsOTFO.validatesWith(operationalTaskDD, operationalTask); Assert.assertTrue(result); }
public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
@Test public void shouldReturnFalseWhenOrderDoesNotHaveTechnology() throws Exception { given(operationalTask.getBelongsToField(OperationalTaskFieldsOTFO.ORDER)).willReturn(order); given(order.getBelongsToField(OrderFields.TECHNOLOGY)).willReturn(null); boolean result = operationalTaskValidatorsOTFO.validatesWith(operat...
public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
@Test public void shouldReturnTrueWhenOrderHaveTechnology() throws Exception { when(operationalTask.getBelongsToField(OperationalTaskFieldsOTFO.ORDER)).thenReturn(order); when(order.getBelongsToField(OrderFields.TECHNOLOGY)).thenReturn(technology); boolean result = operationalTaskValidatorsOTFO.validatesWith(operationa...
public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
OperationalTaskValidatorsOTFO { public boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask) { return checkIfOrderHasTechnology(operationalTaskDD, operationalTask); } boolean validatesWith(final DataDefinition operationalTaskDD, final Entity operationalTask); }
@Test public void shouldReturnFalseWhenEntityWithGivenNumberAndCompanyDoesExistsInDB() throws Exception { SearchCriterion criterion1 = SearchRestrictions.eq(CATALOG_NUMBER, entity.getStringField(CATALOG_NUMBER)); SearchCriterion criterion2 = SearchRestrictions.belongsTo(ProductCatalogNumberFields.COMPANY, company); giv...
public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find() .add(SearchRestrict...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithNumberAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBER...
@Test public void shouldNotRedirectToPreviousOrderIfPreviousOrderIsNull() { stubLookup(previousOrderLookup, null); lineChangeoverNormsForOrderDetailsListeners.showPreviousOrder(view, null, null); verify(view, never()).redirectTo(anyString(), anyBoolean(), anyBoolean(), anyMap()); }
public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Long) previousOrderLookup.getFieldValue(); if (pr...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
@Test public void shouldRedirectToPreviousOrderIfPreviousOrderIsNotNull() { stubLookup(previousOrderLookup, entityWithId); lineChangeoverNormsForOrderDetailsListeners.showPreviousOrder(view, null, null); String url = "../page/orders/orderDetails.html"; verify(view).redirectTo(eq(url), anyBoolean(), anyBoolean(), parame...
public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Long) previousOrderLookup.getFieldValue(); if (pr...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
LineChangeoverNormsForOrderDetailsListeners { public final void showPreviousOrder(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Long previousOrderId = (Lon...
@Test public void shouldNotRedirectToBestFittingLineChangeoverNormIfLineChangeoverIsNull() { stubLookup(lineChangeoverNormLookup, null); lineChangeoverNormsForOrderDetailsListeners.showBestFittingLineChangeoverNorm(view, null, null); verify(view, never()).redirectTo(anyString(), anyBoolean(), anyBoolean(), anyMap()); }
public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Long lineChangeoverNormId = (Long) lineChangeove...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
@Test public void shouldRedirectToBestFittingLineChangeoverNormIfLineChangeoverNormIsNotNull() { stubLookup(lineChangeoverNormLookup, entityWithId); lineChangeoverNormsForOrderDetailsListeners.showBestFittingLineChangeoverNorm(view, null, null); String url = "../page/lineChangeoverNorms/lineChangeoverNormsDetails.html"...
public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Long lineChangeoverNormId = (Long) lineChangeove...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
LineChangeoverNormsForOrderDetailsListeners { public final void showBestFittingLineChangeoverNorm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent lineChangeoverNormField = (FieldComponent) view .getComponentByReference(OrderFieldsLCNFO.LINE_CHANGEOVER_NORM); Lo...
@Test public void shouldNotRedirectToLineChangeoverNormForGroupIfTechnologyGroupNumbersAreEmpty() { given(previousOrderTechnologyGroupNumberField.getFieldValue()).willReturn(null); given(technologyGroupNumberField.getFieldValue()).willReturn(null); lineChangeoverNormsForOrderDetailsListeners.showLineChangeoverNormForGr...
public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroupNumber"); FieldComponent technologyGroupNumber...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
@Test public void shouldRedirectToLineChangeoverNormForGroupIfTechnologyGroupNumbersAreNotEmpty() { given(previousOrderTechnologyGroupNumberField.getFieldValue()).willReturn(L_TECHNOLOGY_GROUP_NUMBER); given(technologyGroupNumberField.getFieldValue()).willReturn(L_TECHNOLOGY_GROUP_NUMBER); lineChangeoverNormsForOrderDe...
public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroupNumber"); FieldComponent technologyGroupNumber...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyGroupNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyGroup...
@Test public void shouldNotRedirectToLineChangeoverNormsForTechnologyIfTechnologyNumbersAreEmpty() { given(previousOrderTechnologyNumberField.getFieldValue()).willReturn(null); given(technologyNumberField.getFieldValue()).willReturn(null); lineChangeoverNormsForOrderDetailsListeners.showLineChangeoverNormForTechnology(...
public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumber"); FieldComponent technologyNumberField = (F...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
@Test public void shouldRedirectToLineChangeoverNormsForTechnologyIfTechnologyNumbersAreNotEmpty() { given(previousOrderTechnologyNumberField.getFieldValue()).willReturn(L_TECHNOLOGY_NUMBER); given(technologyNumberField.getFieldValue()).willReturn(L_TECHNOLOGY_NUMBER); lineChangeoverNormsForOrderDetailsListeners.showLi...
public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumber"); FieldComponent technologyNumberField = (F...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
LineChangeoverNormsForOrderDetailsListeners { public final void showLineChangeoverNormForTechnology(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FieldComponent previousOrderTechnologyNumberField = (FieldComponent) view .getComponentByReference("previousOrderTechnologyNumbe...
@Test public void shouldNotAddMessageWhenOrdersAreNotSpecified() { stubLookup(previousOrderLookup, null); stubLookup(orderLookup, null); given(lineChangeoverNormsForOrdersService.previousOrderEndsBeforeOrIsWithdrawed(null, null)).willReturn(true); lineChangeoverNormsForOrderDetailsListeners.checkIfOrderHasCorrectStateA...
public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); LookupComponent orderLookup = (LookupComponent) vi...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
@Test public void shouldNotAddMessageWhenPreviousOrderIsCorrect() { stubLookup(previousOrderLookup, entityWithId); stubLookup(orderLookup, entityWithId); given(lineChangeoverNormsForOrdersService.previousOrderEndsBeforeOrIsWithdrawed(entityWithId, entityWithId)).willReturn( true); lineChangeoverNormsForOrderDetailsList...
public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); LookupComponent orderLookup = (LookupComponent) vi...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
@Test public void shouldReturnTrueWhenEntityWithGivenProductAndCompanyDoesnotExistsInDB() throws Exception { SearchCriterion criterion1 = SearchRestrictions.eq(CATALOG_NUMBER, entity.getStringField(CATALOG_NUMBER)); SearchCriterion criterion2 = SearchRestrictions.belongsTo(PRODUCT, entity.getBelongsToField(PRODUCT)); g...
public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBERS).find() .add(SearchRestric...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBE...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBE...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBE...
ProductCatalogNumbersHooks { public boolean checkIfExistsCatalogNumberWithProductAndCompany(final DataDefinition dataDefinition, final Entity entity) { SearchCriteriaBuilder criteria = dataDefinitionService .get(ProductCatalogNumbersConstants.PLUGIN_IDENTIFIER, ProductCatalogNumbersConstants.MODEL_PRODUCT_CATALOG_NUMBE...
@Test public void shouldAddMessageWhenPreviousOrderIsIncorrect() { stubLookup(previousOrderLookup, entityWithId); stubLookup(orderLookup, entityWithId); given(lineChangeoverNormsForOrdersService.previousOrderEndsBeforeOrIsWithdrawed(entityWithId, entityWithId)).willReturn( false); lineChangeoverNormsForOrderDetailsList...
public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); LookupComponent orderLookup = (LookupComponent) vi...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
LineChangeoverNormsForOrderDetailsListeners { public final void checkIfOrderHasCorrectStateAndIsPrevious(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { LookupComponent previousOrderLookup = (LookupComponent) view.getComponentByReference(OrderFieldsLCNFO.PREVIOUS_ORDER); Look...
@Test public final void shouldFillPreviousOrderForm() { lineChangeoverNormsForOrderDetailsListeners.fillPreviousOrderForm(view, null, null); verify(lineChangeoverNormsForOrdersService).fillOrderForm(view, PREVIOUS_ORDER_FIELDS); }
public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); }
LineChangeoverNormsForOrderDetailsListeners { public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); } }
LineChangeoverNormsForOrderDetailsListeners { public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); } }
LineChangeoverNormsForOrderDetailsListeners { public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); } final void showPrevio...
LineChangeoverNormsForOrderDetailsListeners { public final void fillPreviousOrderForm(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { lineChangeoverNormsForOrdersService.fillOrderForm(view, LineChangeoverNormsForOrdersConstants.PREVIOUS_ORDER_FIELDS); } final void showPrevio...
@Test public void shouldShowOwnLineChangeoverDurationField() { lineChangeoverNormsForOrderDetailsListeners.showOwnLineChangeoverDurationField(view, null, null); verify(orderService).changeFieldState(view, OWN_LINE_CHANGEOVER, OWN_LINE_CHANGEOVER_DURATION); }
public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); }
LineChangeoverNormsForOrderDetailsListeners { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); } }
LineChangeoverNormsForOrderDetailsListeners { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); } }
LineChangeoverNormsForOrderDetailsListeners { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); } final void...
LineChangeoverNormsForOrderDetailsListeners { public void showOwnLineChangeoverDurationField(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { orderService.changeFieldState(view, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER, OrderFieldsLCNFO.OWN_LINE_CHANGEOVER_DURATION); } final void...
@Test public void shouldntShowChangeoverIfOrderIdIsNull() { given(componentState.getFieldValue()).willReturn(null); String url = "/page/lineChangeoverNormsForOrders/lineChangeoverNormsForOrderDetails.html"; orderDetailsListenersLCNFO.showChangeover(view, componentState, null); verify(view, never()).redirectTo(url, fals...
public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.id", orderId); String url = "/...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
@Test public void shouldShowChangeoverIfOrderIdIsntNull() { given(componentState.getFieldValue()).willReturn(L_ID); parameters.put("form.id", L_ID); String url = "/page/lineChangeoverNormsForOrders/lineChangeoverNormsForOrderDetails.html"; orderDetailsListenersLCNFO.showChangeover(view, componentState, null); verify(vi...
public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.id", orderId); String url = "/...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
OrderDetailsListenersLCNFO { public final void showChangeover(final ViewDefinitionState viewState, final ComponentState componentState, final String[] args) { Long orderId = (Long) componentState.getFieldValue(); if (orderId == null) { return; } Map<String, Object> parameters = Maps.newHashMap(); parameters.put("form.i...
@Test public void shouldReturnFalseWhenPreviousOrderIsNotCorrect() { given(lineChangeoverNormsForOrdersService.previousOrderEndsBeforeOrIsWithdrawed(previousOrderDB, orderDB)).willReturn( false); boolean result = orderModelValidatorsLCNFO.checkIfOrderHasCorrectStateAndIsPrevious(orderDD, order); assertFalse(result); ve...
public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOrdersService.previousOrderEnd...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
@Test public void shouldReturnTrueWhenPreviousOrderIsCorrect() { given(lineChangeoverNormsForOrdersService.previousOrderEndsBeforeOrIsWithdrawed(previousOrderDB, orderDB)).willReturn( true); boolean result = orderModelValidatorsLCNFO.checkIfOrderHasCorrectStateAndIsPrevious(orderDD, order); assertTrue(result); verify(o...
public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOrdersService.previousOrderEnd...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...
OrderModelValidatorsLCNFO { public final boolean checkIfOrderHasCorrectStateAndIsPrevious(final DataDefinition orderDD, final Entity order) { Entity previousOrderDB = order.getBelongsToField(OrderFieldsLCNFO.PREVIOUS_ORDER); Entity orderDB = order.getBelongsToField(OrderFieldsLCNFO.ORDER); if (!lineChangeoverNormsForOr...