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 shouldAddMachineTimeBalanceAndLaborTimeBalanceIfTypeIsHourlyAndForEach() throws Exception { String typeOfProductionRecording = TypeOfProductionRecording.FOR_EACH.getStringValue(); String calculateOperationCostMode = CalculateOperationCostMode.HOURLY.getStringValue(); given(order.getStringField(OrderFi...
@Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
@Test public void shouldCallProductAndOperationNormsPrintingMethodNoMatterWhatIncludingrHourlyAndForEachType() throws Exception { String typeOfProductionRecording = TypeOfProductionRecording.FOR_EACH.getStringValue(); String calculateOperationCostMode = CalculateOperationCostMode.HOURLY.getStringValue(); given(order.ge...
@Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
@Test public void shouldCallProductAndOperationNormsPrintingMethodNoMatterWhatIncludingPieceworkAndCumulatedType() throws Exception { given(productionBalance.getStringField(ProductionBalanceFields.CALCULATE_OPERATION_COST_MODE)).willReturn( CalculateOperationCostMode.PIECEWORK.getStringValue()); given(order.getStringFi...
@Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", locale); String documentAuthor = translationService.translate("smartR...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
ProductionBalanceWithCostsPdfService extends PdfDocumentService { @Override protected void buildPdfContent(final Document document, final Entity productionBalance, final Locale locale) throws DocumentException { String documentTitle = translationService.translate("productionCounting.productionBalance.report.title", loc...
@Test public void shouldntAddTechnologyGroupIfProductIsntSaved() { given(product.getId()).willReturn(null); String url = "../page/technologies/technologyGroupDetails.html"; productDetailsListenersT.addTechnologyGroup(view, null, null); verify(view, never()).redirectTo(url, false, true, parameters); }
public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } Map<String, Object> parame...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
@Test public void shouldReturnWhenOperationIsNull() throws Exception { costNormsForOperationService.copyCostValuesFromOperation(view, state, null); }
public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equals(operationLookupState.getNam...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
@Test public void shouldAddTechnologyGroupIfProductIsSaved() { given(product.getId()).willReturn(L_ID); parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologyGroups"); String url = "../page/technologies/technologyGroupDetails.html"; productDetailsListenersT.addTechnologyGroup(view, null, null); verify(view).redire...
public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } Map<String, Object> parame...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
ProductDetailsListenersT { public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; }...
@Test public void shouldntShowTechnologiesWithTechnologyGroupIfProductIsntSaved() { given(product.getId()).willReturn(null); String url = "../page/technologies/technologiesList.html"; productDetailsListenersT.showTechnologiesWithTechnologyGroup(view, null, null); verify(view, never()).redirectTo(url, false, true, param...
public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } Entity te...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
@Test public void shouldntShowTechnologiesWithTechnologyGroupIfProductIsSavedAndTechnologyGroupIsNull() { given(product.getId()).willReturn(L_ID); given(product.getBelongsToField("technologyGroup")).willReturn(null); String url = "../page/technologies/technologiesList.html"; productDetailsListenersT.showTechnologiesWit...
public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } Entity te...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
@Test public void shouldShowTechnologiesWithTechnologyGroupIfProductIsSavedAndTechnologyGroupIsntNull() { given(product.getId()).willReturn(L_ID); given(product.getBelongsToField("technologyGroup")).willReturn(technologyGroup); given(technologyGroup.getStringField(NUMBER)).willReturn(L_TECHNOLOGY_GROUP_NUMBER); filters...
public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } Entity te...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
ProductDetailsListenersT { public final void showTechnologiesWithTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == ...
@Test public void shouldntShowTechnologiesWithProductIfProductIsntSaved() { given(product.getId()).willReturn(null); String url = "../page/technologies/technologiesList.html"; productDetailsListenersT.showTechnologiesWithProduct(view, null, null); verify(view, never()).redirectTo(url, false, true, parameters); }
public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } String productNum...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
@Test public void shouldntShowTechnologiesWithProductIfProductIsntSavedAndProductNameIsNull() { given(product.getId()).willReturn(1L); given(product.getStringField(NAME)).willReturn(null); String url = "../page/technologies/technologiesList.html"; productDetailsListenersT.showTechnologiesWithProduct(view, null, null); ...
public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } String productNum...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
@Test public void shouldShowTechnologiesWithProductIfProductIsSavedAndProductNameIsntNull() { given(product.getId()).willReturn(L_ID); given(product.getStringField(NUMBER)).willReturn(L_PRODUCT_NUMBER); filters.put("productNumber", "["+ L_PRODUCT_NUMBER + "]"); gridOptions.put(L_FILTERS, filters); parameters.put(L_GRID...
public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { return; } String productNum...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
ProductDetailsListenersT { public final void showTechnologiesWithProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent productForm = (FormComponent) view.getComponentByReference(L_FORM); Entity product = productForm.getEntity(); if (product.getId() == null) { ...
@Test @Ignore public void shouldntUpdateRibbonStateIfProductIsntSaved() { given(product.getId()).willReturn(null); given(view.getComponentByReference("window")).willReturn((ComponentState) window); given(window.getRibbon()).willReturn(ribbon); given(ribbon.getGroupByName("technologies")).willReturn(technologies); given...
public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")) { view.getComponentByRefe...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
@Test @Ignore public void shouldUpdateRibbonStateIfProductIsSavedAndTechnologyGroupIsNull() { given(product.getId()).willReturn(L_ID); given(product.getBelongsToField("technologyGroup")).willReturn(null); given(view.getComponentByReference("window")).willReturn((ComponentState) window); given(window.getRibbon()).willRe...
public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")) { view.getComponentByRefe...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
@Ignore @Test public void shouldUpdateRibbonStateIfProductIsSavedAndTechnologyGroupIsntNull() { given(product.getId()).willReturn(L_ID); given(product.getBelongsToField("technologyGroup")).willReturn(technologyGroup); given(view.getComponentByReference("window")).willReturn((ComponentState) window); given(window.getRib...
public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")) { view.getComponentByRefe...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
ProductDetailsViewHooksT { public void updateRibbonState(final ViewDefinitionState view) { Entity loggedUser = dataDefinitionService .get(QcadooSecurityConstants.PLUGIN_IDENTIFIER, QcadooSecurityConstants.MODEL_USER) .get(securityService.getCurrentUserId()); if (!securityService.hasRole(loggedUser, "ROLE_TECHNOLOGIES")...
@Test public void shouldApplyCostNormsForGivenSource() throws Exception { when(state.getFieldValue()).thenReturn(1L); Long operationId = 1L; when(operationDD.get(operationId)).thenReturn(operationEntity); when(operationEntity.getField("pieceworkCost")).thenReturn(obj1); when(operationEntity.getField("numberOfOperations...
public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equals(operationLookupState.getNam...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
CostNormsForOperationService { public void copyCostValuesFromOperation(final ViewDefinitionState view, final ComponentState operationLookupState, final String[] args) { ComponentState operationLookup = view.getComponentByReference(OPERATION_FIELD); if (operationLookup.getFieldValue() == null) { if (!OPERATION_FIELD.equ...
@Test public void shouldntAddTechnologyGroupToProductIfTechnologyGroupIsntSaved() { given(technologyGroup.getId()).willReturn(null); technologyGroupDetailsViewHooks.addTechnologyGroupToProduct(view, null, null); verify(product, never()).setField("technologyGroup", technologyGroup); verify(productDD, never()).save(produ...
public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (technologyGroup.getId() == null) { r...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
@Test public void shouldntAddTechnologyGroupToProductIfTechnologyGroupIsSavedAndProductIsNull() { given(technologyGroup.getId()).willReturn(L_ID); given(product.getId()).willReturn(null); technologyGroupDetailsViewHooks.addTechnologyGroupToProduct(view, null, null); verify(product, never()).setField("technologyGroup", ...
public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (technologyGroup.getId() == null) { r...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
@Test public void shouldAddTechnologyGroupToProductIfTechnologyGroupIsSavedAndProductIsntNull() { given(technologyGroup.getId()).willReturn(L_ID); given(product.getId()).willReturn(L_ID); given(product.getDataDefinition()).willReturn(productDD); given(dataDefinitionService.get(BasicConstants.PLUGIN_IDENTIFIER, BasicCon...
public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (technologyGroup.getId() == null) { r...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
TechnologyGroupDetailsViewHooks { public void addTechnologyGroupToProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) { FormComponent technologyGroupForm = (FormComponent) view.getComponentByReference("form"); Entity technologyGroup = technologyGroupForm.getEntity(); if (te...
@Test public void shouldAddMessagesCorrectly() { String messageKey = "technologies.technology.validate.global.error.subOperationsProduceTheSameProductThatIsConsumed"; String parentNode = "1."; String productName = "name"; String productNumber = "abc123"; Long techId = 1L; given(technology.getStringField("state")).willR...
public boolean checkConsumingTheSameProductFromManySubOperations(final DataDefinition technologyDD, final Entity technology, final boolean autoCloseMessage) { Entity techFromDB = technologyDD.get(technology.getId()); EntityTree tree = techFromDB.getTreeField(TechnologyFields.OPERATION_COMPONENTS); Map<String, Set<Entit...
TechnologyTreeValidators { public boolean checkConsumingTheSameProductFromManySubOperations(final DataDefinition technologyDD, final Entity technology, final boolean autoCloseMessage) { Entity techFromDB = technologyDD.get(technology.getId()); EntityTree tree = techFromDB.getTreeField(TechnologyFields.OPERATION_COMPONE...
TechnologyTreeValidators { public boolean checkConsumingTheSameProductFromManySubOperations(final DataDefinition technologyDD, final Entity technology, final boolean autoCloseMessage) { Entity techFromDB = technologyDD.get(technology.getId()); EntityTree tree = techFromDB.getTreeField(TechnologyFields.OPERATION_COMPONE...
TechnologyTreeValidators { public boolean checkConsumingTheSameProductFromManySubOperations(final DataDefinition technologyDD, final Entity technology, final boolean autoCloseMessage) { Entity techFromDB = technologyDD.get(technology.getId()); EntityTree tree = techFromDB.getTreeField(TechnologyFields.OPERATION_COMPONE...
TechnologyTreeValidators { public boolean checkConsumingTheSameProductFromManySubOperations(final DataDefinition technologyDD, final Entity technology, final boolean autoCloseMessage) { Entity techFromDB = technologyDD.get(technology.getId()); EntityTree tree = techFromDB.getTreeField(TechnologyFields.OPERATION_COMPONE...
@Test public final void shouldInvalidateAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(existingTechnology.g...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldInvalidateAlreadyAcceptedInactiveTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(existingTech...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldInvalidateAlreadyAcceptedActiveTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(existingTechno...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateAcceptedTechnologyDuringEntityActivation() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(existin...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateAcceptedTechnologyDuringEntityDeactivation() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(exist...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateJustCreatedTechnology() { given(technology.getId()).willReturn(null); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.DRAFT.getStringValue()); final boolean isValid = technologyTreeValidators.invalidateIfBelongsToAcceptedTechnology(techDataDefini...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public void shouldFillCurrencyFields() throws Exception { String currency = "PLN"; when(currencyService.getCurrencyAlphabeticCode()).thenReturn(currency); when(view.getComponentByReference("pieceworkCostCURRENCY")).thenReturn(field1); when(view.getComponentByReference("laborHourlyCostCURRENCY")).thenReturn(field2...
public void fillCurrencyFields(final ViewDefinitionState view) { String currencyStringCode = currencyService.getCurrencyAlphabeticCode(); FieldComponent component = null; for (String componentReference : Sets.newHashSet("pieceworkCostCURRENCY", "laborHourlyCostCURRENCY", "machineHourlyCostCURRENCY")) { component = (Fie...
CostNormsForOperationService { public void fillCurrencyFields(final ViewDefinitionState view) { String currencyStringCode = currencyService.getCurrencyAlphabeticCode(); FieldComponent component = null; for (String componentReference : Sets.newHashSet("pieceworkCostCURRENCY", "laborHourlyCostCURRENCY", "machineHourlyCos...
CostNormsForOperationService { public void fillCurrencyFields(final ViewDefinitionState view) { String currencyStringCode = currencyService.getCurrencyAlphabeticCode(); FieldComponent component = null; for (String componentReference : Sets.newHashSet("pieceworkCostCURRENCY", "laborHourlyCostCURRENCY", "machineHourlyCos...
CostNormsForOperationService { public void fillCurrencyFields(final ViewDefinitionState view) { String currencyStringCode = currencyService.getCurrencyAlphabeticCode(); FieldComponent component = null; for (String componentReference : Sets.newHashSet("pieceworkCostCURRENCY", "laborHourlyCostCURRENCY", "machineHourlyCos...
CostNormsForOperationService { public void fillCurrencyFields(final ViewDefinitionState view) { String currencyStringCode = currencyService.getCurrencyAlphabeticCode(); FieldComponent component = null; for (String componentReference : Sets.newHashSet("pieceworkCostCURRENCY", "laborHourlyCostCURRENCY", "machineHourlyCos...
@Test public final void shouldValidateTechnologyDuringAccepting() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given(existingTechnology.get...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateTechnologyDuringWithdrawing() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.OUTDATED.getStringValue()); given(existingTechnology.g...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateTechnologyDraft() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.DRAFT.getStringValue()); given(existingTechnology.getStringField(T...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateTechnologyIfNotChanged() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(technology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); final boolean isValid = technologyTreeV...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateTocBelongingToDraftTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.DRAFT.getStringValue()); given(existingTechnology.ge...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateUnchangedTocBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldInvalidateChangedTocBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); given...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateOpicBelongingToDraftTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.DRAFT.getStringValue()); given(existingTechnology.g...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateOpocBelongingToDraftTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.DRAFT.getStringValue()); given(existingTechnology.g...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldValidateUnchangedOpicBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); give...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public void shouldReturnFalseAndAddErrorWhenValidateStockCorrectionIfLocationIsntNullAndLocationTypeIsntControlPoint() { given(stockCorrection.getBelongsToField(LOCATION)).willReturn(location); given(location.getStringField(TYPE)).willReturn("otherLocation"); boolean result = stockCorrectionModelValidators.valida...
public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue().equals(locationType)) { stockCorr...
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
@Test public final void shouldValidateUnchangedOpocBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); give...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldInvalidateChangedOpicBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); give...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test public final void shouldInvalidateChangedOpocBelongingToAlreadyAcceptedTechnology() { given(technology.getId()).willReturn(101L); given(techDataDefinition.get(101L)).willReturn(existingTechnology); given(technology.getStringField(TechnologyFields.STATE)).willReturn(TechnologyState.ACCEPTED.getStringValue()); give...
public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(dataDefinition.getName())) { te...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
TechnologyTreeValidators { public boolean invalidateIfBelongsToAcceptedTechnology(final DataDefinition dataDefinition, final Entity entity) { Entity technology = null; String errorMessageKey = "technologies.technology.state.error.modifyBelongsToAcceptedTechnology"; if (TechnologiesConstants.MODEL_TECHNOLOGY.equals(data...
@Test(expected = IllegalStateException.class) public void shouldReturnIllegalStateExceptionIfTheresNoTechnology() { when(order.getBelongsToField("technology")).thenReturn(null); productQuantitiesService.getProductComponentQuantities(order); }
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test public void shouldReturnCorrectQuantities() { OperationProductComponentWithQuantityContainer productQuantities = productQuantitiesService .getProductComponentQuantities(order); assertEquals(new BigDecimal(50), productQuantities.get(productInComponent1)); assertEquals(new BigDecimal(10), productQuantities.get(prod...
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test @Ignore public void shouldReturnCorrectQuantitiesOfInputProductsForTechnology() { Map<Long, BigDecimal> productQuantities = productQuantitiesService.getNeededProductQuantities(technology, plannedQty, MrpAlgorithm.ALL_PRODUCTS_IN); assertEquals(3, productQuantities.size()); assertEquals(new BigDecimal(50), product...
@Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> nonComponents = Sets.newHashSet(); OperationProductComponentWithQuan...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
@Test public void shouldReturnQuantitiesOfInputProductsForOrdersAndIfToldCountOnlyComponents() { Map<Long, BigDecimal> productQuantities = productQuantitiesService.getNeededProductQuantities(order, MrpAlgorithm.ONLY_COMPONENTS); assertEquals(2, productQuantities.size()); assertEquals(new BigDecimal(50), productQuantiti...
@Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> nonComponents = Sets.newHashSet(); OperationProductComponentWithQuan...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
@Test public void shouldReturnQuantitiesAlsoForListOfComponents() { Entity component = mock(Entity.class); when(component.getBelongsToField("order")).thenReturn(order); Map<Long, BigDecimal> productQuantities = productQuantitiesService.getNeededProductQuantitiesForComponents( Arrays.asList(component), MrpAlgorithm.ALL_...
@Override public Map<Long, BigDecimal> getNeededProductQuantitiesForComponents(final List<Entity> components, final MrpAlgorithm mrpAlgorithm) { return getNeededProductQuantitiesForComponents(components, mrpAlgorithm, false); }
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantitiesForComponents(final List<Entity> components, final MrpAlgorithm mrpAlgorithm) { return getNeededProductQuantitiesForComponents(components, mrpAlgorithm, false); } }
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantitiesForComponents(final List<Entity> components, final MrpAlgorithm mrpAlgorithm) { return getNeededProductQuantitiesForComponents(components, mrpAlgorithm, false); } }
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantitiesForComponents(final List<Entity> components, final MrpAlgorithm mrpAlgorithm) { return getNeededProductQuantitiesForComponents(components, mrpAlgorithm, false); } @Override ProductQuantit...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantitiesForComponents(final List<Entity> components, final MrpAlgorithm mrpAlgorithm) { return getNeededProductQuantitiesForComponents(components, mrpAlgorithm, false); } @Override ProductQuantit...
@Test public void shouldReturnOperationRuns() { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); productQuantitiesService.getNeededProductQuantities(orders, MrpAlgorithm.ALL_PRODUCTS_IN, operationRuns); assertEquals(2, operationRuns.size()); assertEquals(new BigDecimal(5), operationRuns.get(operationComponent2....
@Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> nonComponents = Sets.newHashSet(); OperationProductComponentWithQuan...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
@Test public void shouldReturnOperationRunsAlsoForComponents() { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); productQuantitiesService.getProductComponentQuantities(order, operationRuns); assertEquals(2, operationRuns.size()); assertEquals(new BigDecimal(5), operationRuns.get(operationComponent2.getId())); ...
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test public void shouldReturnTrueWhenValidateStockCorrectionIfLocationIsntNullAndLocationTypeIsControlPoint() { given(stockCorrection.getBelongsToField(LOCATION)).willReturn(location); given(location.getStringField(TYPE)).willReturn(CONTROL_POINT.getStringValue()); boolean result = stockCorrectionModelValidators.valid...
public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue().equals(locationType)) { stockCorr...
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
@Test public void shouldReturnOperationRunsAlsoForPlainTechnology() { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); productQuantitiesService.getProductComponentQuantities(technology, plannedQty, operationRuns); assertEquals(2, operationRuns.size()); assertEquals(new BigDecimal(5), operationRuns.get(operation...
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test public void shouldTraverseAlsoThroughReferencedTechnologies() { Entity refTech = mock(Entity.class); Entity someOpComp = mock(Entity.class); EntityList child = mockEntityListIterator(asList(someOpComp)); when(operationComponent2.getHasManyField("children")).thenReturn(child); when(someOpComp.getStringField("entit...
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test public void shouldNotRoundOperationRunsIfTjIsDivisable() { when(operationComponent1.getBooleanField("areProductQuantitiesDivisible")).thenReturn(true); when(operationComponent2.getBooleanField("areProductQuantitiesDivisible")).thenReturn(true); when(operationComponent1.getBooleanField("isTjDivisible")).thenReturn...
@Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> nonComponents = Sets.newHashSet(); OperationProductComponentWithQuan...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public Map<Long, BigDecimal> getNeededProductQuantities(final Entity technology, final BigDecimal givenQuantity, final MrpAlgorithm mrpAlgorithm) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); Set<OperationProductComponentHolder> n...
@Test public void shouldNotRoundToTheIntegerOperationRunsIfOperationComponentHasDivisableProductQuantities() { when(operationComponent1.getBooleanField("areProductQuantitiesDivisible")).thenReturn(true); when(operationComponent2.getBooleanField("areProductQuantitiesDivisible")).thenReturn(true); OperationProductCompone...
@Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities = getProductComponentQuantities(technology, givenQuantity, operation...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
ProductQuantitiesServiceImpl implements ProductQuantitiesService { @Override public ProductQuantitiesHolder getProductComponentQuantities(final Entity technology, final BigDecimal givenQuantity) { Map<Long, BigDecimal> operationRuns = Maps.newHashMap(); OperationProductComponentWithQuantityContainer productQuantities =...
@Test public void shouldReturnCorrectWorkstationCount() { given(operation.getBelongsToField("workstationType")).willReturn(work2); Integer workstationCount = productionLinesServiceImpl.getWorkstationTypesCount(opComp1, productionLine); assertEquals(Integer.valueOf(234), workstationCount); }
@Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkstation = operationComponent.getBelongsToField(TechnologyOperatio...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
@Test public void shouldReturnSpecifiedQuantityIfNoWorkstationIsFound() { given(productionLine.getIntegerField("quantityForOtherWorkstationTypes")).willReturn(456); given(operation.getBelongsToField("workstationType")).willReturn(work3); Integer workstationCount = productionLinesServiceImpl.getWorkstationTypesCount(opC...
@Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkstation = operationComponent.getBelongsToField(TechnologyOperatio...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
ProductionLinesServiceImpl implements ProductionLinesService { @Override public Integer getWorkstationTypesCount(final Entity operationComponent, final Entity productionLine) { List<Entity> workstationTypeComponents = productionLine.getHasManyField(ProductionLineFields.WORKSTATION_TYPE_COMPONENTS); Entity desiredWorkst...
@Test public final void shouldReturnTechnology() { Entity technologyFromDb = mockEntity(); stubDataDefGetResult(technologyFromDb); Optional<Entity> res = technologyDataProvider.tryFind(1L); Assert.assertEquals(Optional.of(technologyFromDb), res); }
public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
@Test public final void shouldReturnEmptyIfIdIsMissing() { Optional<Entity> res = technologyDataProvider.tryFind(null); Assert.assertEquals(Optional.<Entity> empty(), res); }
public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
@Test public final void shouldReturnEmptyIfEntityCannotBeFound() { stubDataDefGetResult(null); Optional<Entity> res = technologyDataProvider.tryFind(1L); Assert.assertEquals(Optional.<Entity> empty(), res); }
public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
TechnologyDataProviderImpl implements TechnologyDataProvider { public Optional<Entity> tryFind(final Long id) { return Optional.ofNullable(id).map(i -> getDataDefinition().get(i)); } Optional<Entity> tryFind(final Long id); }
@Test public final void shouldGenerateNumber() { Entity product = mockEntity(); stubStringField(product, ProductFields.NUMBER, "SomeProductNumber"); technologyNameAndNumberGenerator.generateNumber(product); verify(numberGeneratorService).generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesCons...
public String generateNumber(final Entity product) { String numberPrefix = product.getField(ProductFields.NUMBER) + "-"; return numberGeneratorService.generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY, 3, numberPrefix); }
TechnologyNameAndNumberGenerator { public String generateNumber(final Entity product) { String numberPrefix = product.getField(ProductFields.NUMBER) + "-"; return numberGeneratorService.generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY, 3, numberPrefix); } }
TechnologyNameAndNumberGenerator { public String generateNumber(final Entity product) { String numberPrefix = product.getField(ProductFields.NUMBER) + "-"; return numberGeneratorService.generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY, 3, numberPrefix); } }
TechnologyNameAndNumberGenerator { public String generateNumber(final Entity product) { String numberPrefix = product.getField(ProductFields.NUMBER) + "-"; return numberGeneratorService.generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY, 3, numberPrefix); } String ...
TechnologyNameAndNumberGenerator { public String generateNumber(final Entity product) { String numberPrefix = product.getField(ProductFields.NUMBER) + "-"; return numberGeneratorService.generateNumberWithPrefix(TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_TECHNOLOGY, 3, numberPrefix); } String ...
@Test public void shouldReturnTrueWhenValidateStockCorrectionIfLocationIsNull() { given(stockCorrection.getBelongsToField(LOCATION)).willReturn(null); boolean result = stockCorrectionModelValidators.validateStockCorrection(stockCorrectionDD, stockCorrection); assertTrue(result); verify(stockCorrection, never()).addErro...
public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue().equals(locationType)) { stockCorr...
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
StockCorrectionModelValidators { public boolean validateStockCorrection(final DataDefinition stockCorrectionDD, final Entity stockCorrection) { Entity location = stockCorrection.getBelongsToField(LOCATION); if (location != null) { String locationType = location.getStringField(TYPE); if (!CONTROL_POINT.getStringValue()....
@Test public final void shouldGenerateName() { String productNumber = "SomeProductNumber"; String productName = "Some product name"; Entity product = mockEntity(); stubStringField(product, ProductFields.NUMBER, productNumber); stubStringField(product, ProductFields.NAME, productName); technologyNameAndNumberGenerator.g...
public String generateName(final Entity product) { LocalDate date = LocalDate.now(); String currentDateString = String.format("%s.%s", date.getYear(), date.getMonthValue()); String productName = product.getStringField(ProductFields.NAME); String productNumber = product.getStringField(ProductFields.NUMBER); return trans...
TechnologyNameAndNumberGenerator { public String generateName(final Entity product) { LocalDate date = LocalDate.now(); String currentDateString = String.format("%s.%s", date.getYear(), date.getMonthValue()); String productName = product.getStringField(ProductFields.NAME); String productNumber = product.getStringField(...
TechnologyNameAndNumberGenerator { public String generateName(final Entity product) { LocalDate date = LocalDate.now(); String currentDateString = String.format("%s.%s", date.getYear(), date.getMonthValue()); String productName = product.getStringField(ProductFields.NAME); String productNumber = product.getStringField(...
TechnologyNameAndNumberGenerator { public String generateName(final Entity product) { LocalDate date = LocalDate.now(); String currentDateString = String.format("%s.%s", date.getYear(), date.getMonthValue()); String productName = product.getStringField(ProductFields.NAME); String productNumber = product.getStringField(...
TechnologyNameAndNumberGenerator { public String generateName(final Entity product) { LocalDate date = LocalDate.now(); String currentDateString = String.format("%s.%s", date.getYear(), date.getMonthValue()); String productName = product.getStringField(ProductFields.NAME); String productNumber = product.getStringField(...
@Test public final void shouldThrowExceptionWhenTryToAddProductWithIncorrectTypeToOutputProductComponent() { performWrongTypeProductTest(buildOpoc()); verify(wrappedEntity, Mockito.never()).setField(OperationProductInComponentFields.PRODUCT, product); }
@Override public void setField(final String name, final Object value) { entity.setField(name, value); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
@Test public final void shouldThrowExceptionWhenTryToAddProductWithIncorrectTypeToInputProductComponent() { performWrongTypeProductTest(buildOpic()); verify(wrappedEntity, Mockito.never()).setField(OperationProductOutComponentFields.PRODUCT, product); }
@Override public void setField(final String name, final Object value) { entity.setField(name, value); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
@Test public final void shouldNotThrowExceptionWhenAddingProductWithCorrectTypeToOutputProductComponent() { performCorrectTypeProductTest(buildOpoc()); verify(wrappedEntity).setField(OperationProductOutComponentFields.PRODUCT, product); }
@Override public void setField(final String name, final Object value) { entity.setField(name, value); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
@Test public final void shouldNotThrowExceptionWhenAddingProductWithCorrectTypeToInputProductComponent() { performCorrectTypeProductTest(buildOpic()); verify(wrappedEntity).setField(OperationProductInComponentFields.PRODUCT, product); }
@Override public void setField(final String name, final Object value) { entity.setField(name, value); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); }
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
OperationProductComponentImpl implements InternalOperationProductComponent { @Override public void setField(final String name, final Object value) { entity.setField(name, value); } OperationProductComponentImpl(final OperationCompType operationType, final DataDefinition opcDataDef); @Override void setField(final String...
@Test public final void shouldBuildTree() { TocHolder customTreeRoot = mockCustomTreeRepresentation(); EntityTree tree = treeBuildService.build(customTreeRoot, new TestTreeAdapter()); EntityTreeNode root = tree.getRoot(); assertNotNull(root); Entity toc1 = extractEntity(root); verify(toc1).setField(TechnologyOperationC...
@Override public <T, P> EntityTree build(final T from, final TechnologyTreeAdapter<T, P> transformer) { TechnologyTreeBuilder<T, P> builder = new TechnologyTreeBuilder<T, P>(componentsFactory, transformer); Entity root = builder.build(from, numberService); return EntityTreeUtilsService.getDetachedEntityTree(Lists.newAr...
TechnologyTreeBuildServiceImpl implements TechnologyTreeBuildService { @Override public <T, P> EntityTree build(final T from, final TechnologyTreeAdapter<T, P> transformer) { TechnologyTreeBuilder<T, P> builder = new TechnologyTreeBuilder<T, P>(componentsFactory, transformer); Entity root = builder.build(from, numberSe...
TechnologyTreeBuildServiceImpl implements TechnologyTreeBuildService { @Override public <T, P> EntityTree build(final T from, final TechnologyTreeAdapter<T, P> transformer) { TechnologyTreeBuilder<T, P> builder = new TechnologyTreeBuilder<T, P>(componentsFactory, transformer); Entity root = builder.build(from, numberSe...
TechnologyTreeBuildServiceImpl implements TechnologyTreeBuildService { @Override public <T, P> EntityTree build(final T from, final TechnologyTreeAdapter<T, P> transformer) { TechnologyTreeBuilder<T, P> builder = new TechnologyTreeBuilder<T, P>(componentsFactory, transformer); Entity root = builder.build(from, numberSe...
TechnologyTreeBuildServiceImpl implements TechnologyTreeBuildService { @Override public <T, P> EntityTree build(final T from, final TechnologyTreeAdapter<T, P> transformer) { TechnologyTreeBuilder<T, P> builder = new TechnologyTreeBuilder<T, P>(componentsFactory, transformer); Entity root = builder.build(from, numberSe...
@Test public final void shouldReturnEmptyMapForNullTree() { resultMap = technologyTreeValidationService.checkConsumingManyProductsFromOneSubOp(null); assertNotNull(resultMap); assertTrue(resultMap.isEmpty()); }
@Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChil...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
@Test public final void shouldReturnEmptyMapForEmptyTree() { given(tree.isEmpty()).willReturn(true); resultMap = technologyTreeValidationService.checkConsumingManyProductsFromOneSubOp(tree); assertNotNull(resultMap); assertTrue(resultMap.isEmpty()); }
@Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChil...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
@Test public final void shouldReturnNotEmptyMapIfParentOpConsumeManyOutputsFromOneSubOp() { Entity product1 = mockProductComponent(1L); Entity product2 = mockProductComponent(2L); Entity product3 = mockProductComponent(3L); Entity product4 = mockProductComponent(4L); Entity product5 = mockProductComponent(5L); Entity p...
@Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChil...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
@Test public final void shouldReturnNotEmptyMapIfSubOpsProduceTheSameOutputsWhichAreConsumed() { Entity product1 = mockProductComponent(1L); Entity product2 = mockProductComponent(2L); Entity product3 = mockProductComponent(3L); Entity product4 = mockProductComponent(4L); Entity product5 = mockProductComponent(5L); Ent...
@Override public Map<String, Set<Entity>> checkConsumingTheSameProductFromManySubOperations(final EntityTree technologyTree) { Map<String, Set<Entity>> parentToProductsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChi...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public Map<String, Set<Entity>> checkConsumingTheSameProductFromManySubOperations(final EntityTree technologyTree) { Map<String, Set<Entity>> parentToProductsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree....
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public Map<String, Set<Entity>> checkConsumingTheSameProductFromManySubOperations(final EntityTree technologyTree) { Map<String, Set<Entity>> parentToProductsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree....
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public Map<String, Set<Entity>> checkConsumingTheSameProductFromManySubOperations(final EntityTree technologyTree) { Map<String, Set<Entity>> parentToProductsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree....
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public Map<String, Set<Entity>> checkConsumingTheSameProductFromManySubOperations(final EntityTree technologyTree) { Map<String, Set<Entity>> parentToProductsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree....
@Test public void shouldReturnFalseWhenCheckIfTransfersAreValidAndTransfersArentNull() { Entity transferConsumption = mockTransfer(null, null, null); Entity transferProduction = mockTransfer(null, null, null); stubHasManyField(transformations, TRANSFERS_CONSUMPTION, Lists.newArrayList(transferConsumption)); stubHasMany...
public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUCTION); Iterable<Boolean> validati...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
@Test public final void shouldReturnNotEmptyMapIfManyParentOpConsumesManyOutputsFromOneSubOp() { Entity product1 = mockProductComponent(1L); Entity product2 = mockProductComponent(2L); Entity product3 = mockProductComponent(3L); Entity product4 = mockProductComponent(4L); Entity product5 = mockProductComponent(5L); Ent...
@Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChil...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
@Test public final void shouldReturnEmptyMapIfParentOpNotConsumeManyOutputsFromOneSubOp() { Entity product1 = mockProductComponent(1L); Entity product2 = mockProductComponent(2L); Entity product3 = mockProductComponent(3L); Entity product4 = mockProductComponent(4L); Entity product5 = mockProductComponent(5L); Entity p...
@Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.isEmpty()) { final EntityTreeNode rootNode = technologyTree.getRoot(); collectChil...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
TechnologyTreeValidationServiceImpl implements TechnologyTreeValidationService { @Override public final Map<String, Set<String>> checkConsumingManyProductsFromOneSubOp(final EntityTree technologyTree) { final Map<String, Set<String>> parentToChildsMap = Maps.newHashMap(); if (technologyTree != null && !technologyTree.i...
@Test public void shouldReturnOutputProductCountForOperationComponent() { BigDecimal count = technologyService.getProductCountForOperationComponent(opComp2); assertEquals(new BigDecimal(10), count); }
public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
@Test public void shouldThrowAnExceptionIfThereAreNoProductsOrIntermediates() { EntityList opComp2prodOuts = mockEntityIterator(asList(prodOutComp2)); when(opComp2.getHasManyField("operationProductOutComponents")).thenReturn(opComp2prodOuts); try { technologyService.getProductCountForOperationComponent(opComp2); fail()...
public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
@Test public void shouldReturnOutputProductCountForOperationComponentAlsoForTechnologyInstanceOperationComponent() { when(dataDefinition.getName()).thenReturn("technologyInstanceOperationComponent"); when(opComp2.getBelongsToField("technologyOperationComponent")).thenReturn(opComp2); when(opComp1.getBelongsToField("tec...
public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
@Test public void shouldReturnOutputProductCountForOperationComponentAlsoForReferenceTechnology() { when(opComp2.getStringField("entityType")).thenReturn("referenceTechnology"); Entity refTech = mock(Entity.class); when(opComp2.getBelongsToField("referenceTechnology")).thenReturn(refTech); EntityTree tree = mock(Entity...
public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
@Test public void shouldReturnOutputProductCountForOperationComponentAlsoIfParentOperationIsNull() { when(opComp2.getBelongsToField("parent")).thenReturn(null); when(prodOutComp2.getBelongsToField("product")).thenReturn(product2); when(prodOutComp1.getBelongsToField("product")).thenReturn(product1); when(technology.get...
public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } }
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
TechnologyService { public BigDecimal getProductCountForOperationComponent(final Entity operationComponent) { return getMainOutputProductComponent(operationComponent).getDecimalField(L_QUANTITY); } void copyCommentAndAttachmentFromLowerInstance(final Entity technologyOperationComponent, final String belongsToName); bo...
@Test public void shouldRedirectToProductionPerShiftView() { Long givenOrderId = 1L; Long expectedPpsId = 50L; given(state.getFieldValue()).willReturn(givenOrderId); given(ppsHelper.getPpsIdForOrder(givenOrderId)).willReturn(expectedPpsId); orderDetailsListenersPPS.redirectToProductionPerShift(view, state, new String[]...
public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.createPpsForOrderAndReturnId(...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
@Test public void shouldRedirectToJustCreatedProductionPerShiftView() { Long givenOrderId = 1L; Long expectedPpsId = 50L; given(state.getFieldValue()).willReturn(givenOrderId); given(ppsHelper.getPpsIdForOrder(givenOrderId)).willReturn(null); given(ppsHelper.createPpsForOrderAndReturnId(givenOrderId)).willReturn(expect...
public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.createPpsForOrderAndReturnId(...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
@Test public void shouldThrowExceptionIfProductionPerShiftCanNotBeSaved() { Long givenOrderId = 1L; given(state.getFieldValue()).willReturn(givenOrderId); given(ppsHelper.getPpsIdForOrder(givenOrderId)).willReturn(null); given(ppsHelper.createPpsForOrderAndReturnId(givenOrderId)).willReturn(null); try { orderDetailsLis...
public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.createPpsForOrderAndReturnId(...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
OrderDetailsListenersPPS { public void redirectToProductionPerShift(final ViewDefinitionState view, final ComponentState state, final String[] args) { Long orderId = (Long) state.getFieldValue(); if (orderId == null) { return; } Long ppsId = ppsHelper.getPpsIdForOrder(orderId); if (ppsId == null) { ppsId = ppsHelper.cr...
@Test public void shouldReturnFalseWhenCheckIfTransfersAreValidAndTransferProductAlreadyAdded() { Entity transferConsumption1 = mockTransfer(L_NUMBER_CONSUMPTION_1, productConsumption, BigDecimal.ONE); Entity transferConsumption2 = mockTransfer(L_NUMBER_CONSUMPTION_2, productProduction, BigDecimal.ONE); stubHasManyFiel...
public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUCTION); Iterable<Boolean> validati...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
@Test public void shouldAddErrorForEntityWhenNotUnique() { Long id = 1L; String changeoverNumber = "0002"; given(changeoverNorm.getId()).willReturn(id); given(changeoverNorm.getBelongsToField(FROM_TECHNOLOGY)).willReturn(fromTechnology); given(changeoverNorm.getBelongsToField(TO_TECHNOLOGY)).willReturn(toTechnology); g...
public boolean checkUniqueNorms(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService .get(LineChangeoverNormsConstants.PLUGIN_IDENTIFIER, LineChangeoverNormsConstants.MODEL_LINE_CHANGEOVER_NORMS) .find() .add(SearchRestrictions.belongs...
LineChangeoverNormsHooks { public boolean checkUniqueNorms(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService .get(LineChangeoverNormsConstants.PLUGIN_IDENTIFIER, LineChangeoverNormsConstants.MODEL_LINE_CHANGEOVER_NORMS) .find() .add...
LineChangeoverNormsHooks { public boolean checkUniqueNorms(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService .get(LineChangeoverNormsConstants.PLUGIN_IDENTIFIER, LineChangeoverNormsConstants.MODEL_LINE_CHANGEOVER_NORMS) .find() .add...
LineChangeoverNormsHooks { public boolean checkUniqueNorms(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService .get(LineChangeoverNormsConstants.PLUGIN_IDENTIFIER, LineChangeoverNormsConstants.MODEL_LINE_CHANGEOVER_NORMS) .find() .add...
LineChangeoverNormsHooks { public boolean checkUniqueNorms(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { SearchCriteriaBuilder searchCriteriaBuilder = dataDefinitionService .get(LineChangeoverNormsConstants.PLUGIN_IDENTIFIER, LineChangeoverNormsConstants.MODEL_LINE_CHANGEOVER_NORMS) .find() .add...
@Test public final void shouldFillNewlyAddedRowsAccordingToPlannedDaysAndDates() { stubRealizationDaysStream(PLANNED_ORDER_START, Sets.newHashSet(0, 1, 2, 3, 4, 5, 8, 9, 10), shifts); stubRealizationDaysStream(CORRECTED_ORDER_START, Sets.newHashSet(1, 2, 3, 6, 7, 8, 9, 10), shifts); stubProgressType(ProgressType.PLANNE...
public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = resolveOrderDates(order); if (...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
@Test public final void shouldFillNewlyAddedRowsAccordingToCorrectedDaysAndDates() { stubRealizationDaysStream(PLANNED_ORDER_START, Sets.newHashSet(1, 2, 3, 4, 5, 8, 9, 10), shifts); stubRealizationDaysStream(CORRECTED_ORDER_START, Sets.newHashSet(1, 2, 3, 6, 7, 8, 9, 10), shifts); stubProgressType(ProgressType.CORRECT...
public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = resolveOrderDates(order); if (...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
@Test public final void shouldDoNothingIfPlannedDateIsNotPresent() { stubOrderStartDates(null, null, null); stubProgressType(ProgressType.PLANNED); FieldComponent day1 = mockFieldComponent(null); FieldComponent date1 = mockFieldComponent(null); FormComponent row1 = mockFormComponent(day1, date1); AwesomeDynamicListComp...
public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = resolveOrderDates(order); if (...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
@Test public final void shouldFillFirstDayForShiftThatStartsWorkDayBefore() { stubRealizationDaysStream(PLANNED_ORDER_START, Sets.newHashSet(0, 1, 2, 3, 4, 5, 8, 9, 10), shifts); stubRealizationDaysStream(CORRECTED_ORDER_START, Sets.newHashSet(1, 2, 3, 6, 7, 8, 9, 10), shifts); stubProgressType(ProgressType.PLANNED); F...
public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = resolveOrderDates(order); if (...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
ProductionPerShiftListeners { public void updateProgressForDays(final ViewDefinitionState view, final ComponentState state, final String[] args) { ProgressType progressType = detailsHooks.resolveProgressType(view); Entity order = getEntityFromLookup(view, ORDER_LOOKUP_REF).get(); Optional<OrderDates> maybeOrderDates = ...
@Test public final void shouldFailDueToMissingPpsId() { Either<String, Entity> res = ppsCorrectionReasonAppender.append(null, CORRECTION_REASON); Assert.assertTrue(res.isLeft()); Assert.assertEquals("Missing pps id!", res.getLeft()); verify(correctionReasonDataDef, never()).save(newlyCreatedReasonEntity); }
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldFailDueToMissingReason() { Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_ID, null); Assert.assertTrue(res.isLeft()); Assert.assertEquals("Missing or blank reason type value!", res.getLeft()); verify(correctionReasonDataDef, never()).save(newlyCreatedReasonEntity); }
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldFailDueToMissingReasonValue() { Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_ID, new PpsCorrectionReason(null)); Assert.assertTrue(res.isLeft()); Assert.assertEquals("Missing or blank reason type value!", res.getLeft()); verify(correctionReasonDataDef, never()).save(...
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldFailDueToEmptyReasonValue() { Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_ID, new PpsCorrectionReason("")); Assert.assertTrue(res.isLeft()); Assert.assertEquals("Missing or blank reason type value!", res.getLeft()); verify(correctionReasonDataDef, never()).save(newl...
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldFailDueToBlankReasonValue() { Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_ID, new PpsCorrectionReason(" ")); Assert.assertTrue(res.isLeft()); Assert.assertEquals("Missing or blank reason type value!", res.getLeft()); verify(correctionReasonDataDef, never()).save(new...
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldFailDueToValidationErrors() { Entity invalidEntity = mockEntity(null, correctionReasonDataDef); given(invalidEntity.isValid()).willReturn(false); given(correctionReasonDataDef.save(anyEntity())).willReturn(invalidEntity); Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_...
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public void shouldReturnFalseWhenCheckIfTransfersAreValidAndTransfersNumersArentDistinct() { Entity transferConsumption1 = mockTransfer(L_NUMBER_CONSUMPTION_1, productConsumption, BigDecimal.ONE); Entity transferConsumption2 = mockTransfer(L_NUMBER_CONSUMPTION_1, productProduction, BigDecimal.ONE); stubHasManyFie...
public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUCTION); Iterable<Boolean> validati...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
TransformationsModelValidators { public boolean checkIfTransfersAreValid(final DataDefinition transformationsDD, final Entity transformations) { List<Entity> transfersConsumption = transformations.getHasManyField(TRANSFERS_CONSUMPTION); List<Entity> transfersProduction = transformations.getHasManyField(TRANSFERS_PRODUC...
@Test public final void shouldAppendReason() { Entity validSavedEntity = mockEntity(null, correctionReasonDataDef); given(validSavedEntity.isValid()).willReturn(true); given(correctionReasonDataDef.save(anyEntity())).willReturn(validSavedEntity); Either<String, Entity> res = ppsCorrectionReasonAppender.append(PPS_ID, C...
public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } return trySave(createCorrection...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
PpsCorrectionReasonAppender { public Either<String, Entity> append(final ProductionPerShiftId ppsId, final PpsCorrectionReason reason) { if (ppsId == null) { return Either.left("Missing pps id!"); } if (reason == null || StringUtils.isBlank(reason.get())) { return Either.left("Missing or blank reason type value!"); } r...
@Test public final void shouldNotify() { LocalDate mondayDate = new LocalDate(2014, 9, 1); LocalDate tuesdayDate = new LocalDate(2014, 9, 2); DateTime orderStartDateTime = mondayDate.toDateTime(new LocalTime(23, 0, 0)); Entity shift1 = mockShiftEntity("firstShift", ImmutableSet.of(DateTimeConstants.MONDAY, DateTimeCons...
public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = getShiftAndDates(technology...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
@Test public final void shouldNotifyAboutZeroDay() { LocalDate mondayDate = new LocalDate(2014, 9, 1); LocalDate tuesdayDate = new LocalDate(2014, 9, 2); DateTime orderStartDateTime = tuesdayDate.toDateTime(new LocalTime(2, 0, 0)); Entity shift1 = mockShiftEntity("firstShift", ImmutableSet.of(DateTimeConstants.MONDAY, ...
public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = getShiftAndDates(technology...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
@Test public final void shouldNotNotify() { LocalDate mondayDate = new LocalDate(2014, 9, 1); LocalDate tuesdayDate = new LocalDate(2014, 9, 2); DateTime orderStartDateTime = mondayDate.toDateTime(new LocalTime(9, 0, 0)); Entity shift1 = mockShiftEntity("firstShift", ImmutableSet.of(DateTimeConstants.MONDAY, DateTimeCo...
public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = getShiftAndDates(technology...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
NonWorkingShiftsNotifier { public void checkAndNotify(final ViewDefinitionState view, final DateTime orderStartDateTime, final Entity technologyOperation, final ProgressType progressType) { for (FormComponent form : view.<FormComponent> tryFindComponentByReference("form").asSet()) { List<ShiftAndDate> shiftsAndDates = ...
@Test public void shouldReturnFalseWhenCheckIfIsMoreThatFiveDays() { given(ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report)).willReturn(10); boolean result = hooks.checkIfIsMoreThatFiveDays(reportDD, report); Assert.assertFalse(result); verify(report, times(2)).addError(Mockito.any(FieldDefinition.class), Mo...
public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError(reportDD.getFiel...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
@Test public void shouldReturnTrueWhenCheckIfIsMoreThatFiveDays() { given(ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report)).willReturn(3); boolean result = hooks.checkIfIsMoreThatFiveDays(reportDD, report); Assert.assertTrue(result); verify(report, never()).addError(Mockito.any(FieldDefinition.class), Mockit...
public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError(reportDD.getFiel...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...
PPSReportHooks { public boolean checkIfIsMoreThatFiveDays(final DataDefinition reportDD, final Entity report) { int days = ppsReportXlsHelper.getNumberOfDaysBetweenGivenDates(report); if (days > 7) { report.addError(reportDD.getField(PPSReportFields.DATE_FROM), "productionPerShift.report.onlyFiveDays"); report.addError...