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 shouldRedirectToDeliveryReportOnPrintOrder() throws Exception { String stateValue = "111"; when(formComponent.getFieldValue()).thenReturn(stateValue); deliveryDetailsListeners.printOrderReport(view, formComponent, args); verify(view).redirectTo("/deliveries/orderReport." + args[0] + "?id=" + stateValu... | public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.getFieldValue(), true, fals... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... |
@Test public void shouldAddMessageWhenStateIsNotFormComponentOnPrintOrder() throws Exception { String stateValue = "111"; when(grid.getFieldValue()).thenReturn(stateValue); deliveryDetailsListeners.printOrderReport(view, grid, args); verify(grid).addMessage("deliveries.order.report.componentFormError", MessageType.FAIL... | public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.getFieldValue(), true, fals... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... | DeliveryDetailsListeners { public final void printOrderReport(final ViewDefinitionState view, final ComponentState state, final String[] args) { if (state instanceof FormComponent) { state.performEvent(view, "save", args); if (!state.isHasError()) { view.redirectTo("/deliveries/orderReport." + args[0] + "?id=" + state.... |
@Test public void shouldAddColumnsForDeliveries() { given(deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()).willReturn(true); deliveriesColumnLoader.addColumnsForDeliveries(); verify(deliveriesColumnLoaderService).fillColumnsForDeliveries(Mockito.anyString()); } | public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... |
@Test public final void shouldntSetInputProductsRequiredForTypeFromParameters() { given(inputProductsRequiredForTypeField.getFieldValue()).willReturn( InputProductsRequiredForType.START_ORDER.getStringValue()); orderDetailsHooksMR.setInputProductsRequiredForTypeFromParameters(view); verify(inputProductsRequiredForTypeF... | public void setInputProductsRequiredForTypeFromParameters(final ViewDefinitionState view) { FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM); if (orderForm.getEntityId() != null) { return; } FieldComponent inputProductsRequiredForTypeField = (FieldComponent) view .getComponentByReference(O... | OrderDetailsHooksMR { public void setInputProductsRequiredForTypeFromParameters(final ViewDefinitionState view) { FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM); if (orderForm.getEntityId() != null) { return; } FieldComponent inputProductsRequiredForTypeField = (FieldComponent) view .get... | OrderDetailsHooksMR { public void setInputProductsRequiredForTypeFromParameters(final ViewDefinitionState view) { FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM); if (orderForm.getEntityId() != null) { return; } FieldComponent inputProductsRequiredForTypeField = (FieldComponent) view .get... | OrderDetailsHooksMR { public void setInputProductsRequiredForTypeFromParameters(final ViewDefinitionState view) { FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM); if (orderForm.getEntityId() != null) { return; } FieldComponent inputProductsRequiredForTypeField = (FieldComponent) view .get... | OrderDetailsHooksMR { public void setInputProductsRequiredForTypeFromParameters(final ViewDefinitionState view) { FormComponent orderForm = (FormComponent) view.getComponentByReference(L_FORM); if (orderForm.getEntityId() != null) { return; } FieldComponent inputProductsRequiredForTypeField = (FieldComponent) view .get... |
@Test public void shouldReturnErrorWhenRequiredFieldForTechnologyGroupIsNotFill() throws Exception { given(changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE)).willReturn("02forTechnologyGroup"); given(changeoverNorm.getBelongsToField(FROM_TECHNOLOGY_GROUP)).willReturn(fromTechnologyGroup); given(c... | public boolean checkRequiredField(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { String changeoverType = changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE); if (changeoverType.equals(ChangeoverType.FOR_TECHNOLOGY.getStringValue())) { for (String reference : Arrays.asList(FRO... | LineChangeoverNormsHooks { public boolean checkRequiredField(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { String changeoverType = changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE); if (changeoverType.equals(ChangeoverType.FOR_TECHNOLOGY.getStringValue())) { for (String re... | LineChangeoverNormsHooks { public boolean checkRequiredField(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { String changeoverType = changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE); if (changeoverType.equals(ChangeoverType.FOR_TECHNOLOGY.getStringValue())) { for (String re... | LineChangeoverNormsHooks { public boolean checkRequiredField(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { String changeoverType = changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE); if (changeoverType.equals(ChangeoverType.FOR_TECHNOLOGY.getStringValue())) { for (String re... | LineChangeoverNormsHooks { public boolean checkRequiredField(final DataDefinition changeoverNormDD, final Entity changeoverNorm) { String changeoverType = changeoverNorm.getStringField(LineChangeoverNormsFields.CHANGEOVER_TYPE); if (changeoverType.equals(ChangeoverType.FOR_TECHNOLOGY.getStringValue())) { for (String re... |
@Test public void shouldntAddColumnsForDeliveries() { given(deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()).willReturn(false); deliveriesColumnLoader.addColumnsForDeliveries(); verify(deliveriesColumnLoaderService, never()).fillColumnsForDeliveries(Mockito.anyString()); } | public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... | DeliveriesColumnLoader { public void addColumnsForDeliveries() { if (!deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForDeliveries(DeliveriesConstants.PLUGIN_... |
@Test public void shouldDeleteColumnsForDeliveries() { given(deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()).willReturn(false); deliveriesColumnLoader.deleteColumnsForDeliveries(); verify(deliveriesColumnLoaderService).clearColumnsForDeliveries(Mockito.anyString()); } | public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... |
@Test public void shouldntDeleteColumnsForDeliveries() { given(deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()).willReturn(true); deliveriesColumnLoader.deleteColumnsForDeliveries(); verify(deliveriesColumnLoaderService, never()).clearColumnsForDeliveries(Mockito.anyString()); } | public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... | DeliveriesColumnLoader { public void deleteColumnsForDeliveries() { if (deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for deliveries table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForDeliveries(DeliveriesConstants.PL... |
@Test public void shouldAddColumnsForOrders() { given(deliveriesColumnLoaderService.isColumnsForOrdersEmpty()).willReturn(true); deliveriesColumnLoader.addColumnsForOrders(); verify(deliveriesColumnLoaderService).fillColumnsForOrders(Mockito.anyString()); } | public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } } | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... |
@Test public void shouldntAddColumnsForOrders() { given(deliveriesColumnLoaderService.isColumnsForOrdersEmpty()).willReturn(false); deliveriesColumnLoader.addColumnsForOrders(); verify(deliveriesColumnLoaderService, never()).fillColumnsForOrders(Mockito.anyString()); } | public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } } | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... | DeliveriesColumnLoader { public void addColumnsForOrders() { if (!deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be populated ..."); } deliveriesColumnLoaderService.fillColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } ... |
@Test public void shouldDeleteColumnsForOrders() { given(deliveriesColumnLoaderService.isColumnsForOrdersEmpty()).willReturn(false); deliveriesColumnLoader.deleteColumnsForOrders(); verify(deliveriesColumnLoaderService).clearColumnsForOrders(Mockito.anyString()); } | public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... |
@Test public void shoulntdDeleteColumnsForOrders() { given(deliveriesColumnLoaderService.isColumnsForOrdersEmpty()).willReturn(true); deliveriesColumnLoader.deleteColumnsForOrders(); verify(deliveriesColumnLoaderService, never()).clearColumnsForOrders(Mockito.anyString()); } | public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER); } | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... | DeliveriesColumnLoader { public void deleteColumnsForOrders() { if (deliveriesColumnLoaderService.isColumnsForOrdersEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug("Columns for orders table will be unpopulated ..."); } deliveriesColumnLoaderService.clearColumnsForOrders(DeliveriesConstants.PLUGIN_IDENTIFIER)... |
@Test public void shouldSetProductUnitWhenProductIsSelected() throws Exception { String unit = "szt"; when(productLookup.getEntity()).thenReturn(product); when(product.getStringField("unit")).thenReturn(unit); orderedProductDetailsHooks.fillUnitFields(view); Mockito.verify(unitField).setFieldValue("szt"); } | public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referenceNames, additionalUnitNames)... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... |
@Test public void shouldReturnWhenProductIsNull() throws Exception { when(productLookup.getEntity()).thenReturn(null); orderedProductDetailsHooks.fillUnitFields(view); Mockito.verify(unitField).setFieldValue(""); } | public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referenceNames, additionalUnitNames)... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... | OrderedProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> referenceNames = Lists.newArrayList("orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, OrderedProductFields.PRODUCT, referen... |
@Ignore @Test public void shouldReturnTrueWhenCheckIfProductIsParticularProduct() { given(companyProduct.getBelongsToField(PRODUCT)).willReturn(product); given(productService.checkIfProductEntityTypeIsCorrect(product, PARTICULAR_PRODUCT)).willReturn(true); boolean result = companyProductHooks.checkIfProductIsParticular... | public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.messag... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... |
@Test public final void shouldThrowExceptionIfArgumentsAreIncorrect() { try { DeviationsReportCriteria.forDates(null, Optional.of(DateTime.now())); Assert.fail(); } catch (IllegalArgumentException iae) { } try { DeviationsReportCriteria.forDates(DateTime.now(), null); Assert.fail(); } catch (IllegalArgumentException ia... | public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } | DeviationsReportCriteria { public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } } | DeviationsReportCriteria { public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } private DeviationsReportCriteria(final Interval searchInterval); } | DeviationsReportCriteria { public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } private DeviationsReportCriteria(final Interval searchInterval); static DateTime getDefaul... | DeviationsReportCriteria { public static DeviationsReportCriteria forDates(final LocalDate fromDate, final Optional<LocalDate> maybeToDate) { checkArguments(fromDate, maybeToDate); return fromLocalDates(fromDate, maybeToDate); } private DeviationsReportCriteria(final Interval searchInterval); static DateTime getDefaul... |
@Ignore @Test public void shouldReturnFalseWhenCheckIfProductIsParticularProduct() { given(companyProduct.getBelongsToField(PRODUCT)).willReturn(product); given(productService.checkIfProductEntityTypeIsCorrect(product, PARTICULAR_PRODUCT)).willReturn(false); boolean result = companyProductHooks.checkIfProductIsParticul... | public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.messag... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... | CompanyProductHooks { public boolean checkIfProductIsParticularProduct(final DataDefinition companyProductDD, final Entity companyProduct) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProduct.getBelongsToField(PRODUCT), PARTICULAR_PRODUCT)) { companyProduct.addError(companyProductDD.getField(PRODUCT),... |
@Ignore @Test public void shouldReturnTrueWhenCheckIfProductIsNotAlreadyUsed() { given(companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)).willReturn(true); boolean result = companyProductHooks.checkIfProductIsNotAlreadyUsed(companyProductDD, companyProduct); assertTrue(result); v... | public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.productIsAlreadyUsed");... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... |
@Ignore @Test public void shouldReturnFalseWhenCheckIfProductIsNotAlreadyUsed() { given(companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)).willReturn(false); boolean result = companyProductHooks.checkIfProductIsNotAlreadyUsed(companyProductDD, companyProduct); assertFalse(result)... | public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.productIsAlreadyUsed");... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... | CompanyProductHooks { public boolean checkIfProductIsNotAlreadyUsed(final DataDefinition companyProductDD, final Entity companyProduct) { if (!companyProductService.checkIfProductIsNotUsed(companyProduct, PRODUCT, COMPANY, PRODUCTS)) { companyProduct.addError(companyProductDD.getField(PRODUCT), "basic.company.message.p... |
@Ignore @Test public void shouldReturnFalseAndAddErrorForEntityWhenOrderedProductAlreadyExists() throws Exception { when(searchCriteriaBuilder.uniqueResult()).thenReturn(delivery); when(orderedProductDD.getField(PRODUCT)).thenReturn(productField); boolean result = orderedProductHooks.checkIfOrderedProductAlreadyExists(... | public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedProductFields.DELIVERY)))... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... |
@Ignore @Test public void shouldReturnTrue() throws Exception { when(searchCriteriaBuilder.uniqueResult()).thenReturn(null); when(orderedProductDD.getField(PRODUCT)).thenReturn(productField); boolean result = orderedProductHooks.checkIfOrderedProductAlreadyExists(orderedProductDD, orderedProduct); Assert.assertTrue(res... | public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedProductFields.DELIVERY)))... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... | OrderedProductHooks { public boolean checkIfOrderedProductAlreadyExists(final DataDefinition orderedProductDD, final Entity orderedProduct) { SearchCriteriaBuilder searchCriteriaBuilder = orderedProductDD.find() .add(SearchRestrictions.belongsTo(OrderedProductFields.DELIVERY, orderedProduct.getBelongsToField(OrderedPro... |
@Ignore @Test public void shouldReturnFalseAndAddErrorForEntityWhenDeliveredProductAlreadyExists() throws Exception { when(searchCriteriaBuilder.uniqueResult()).thenReturn(delivery); when(deliveredProductDD.getField(PRODUCT)).thenReturn(productField); boolean result = deliveredProductHooks.checkIfDeliveredProductAlread... | public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBuilder.add(SearchRestrict... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... |
@Ignore @Test public void shouldReturnTrue() throws Exception { when(searchCriteriaBuilder.uniqueResult()).thenReturn(null); when(deliveredProductDD.getField(PRODUCT)).thenReturn(productField); boolean result = deliveredProductHooks.checkIfDeliveredProductAlreadyExists(deliveredProductDD, deliveredProduct); Assert.asse... | public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBuilder.add(SearchRestrict... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... | DeliveredProductHooks { public boolean checkIfDeliveredProductAlreadyExists(final DataDefinition deliveredProductDD, final Entity deliveredProduct) { SearchCriteriaBuilder searchCriteriaBuilder = getSearchRestrictions(deliveredProductDD.find(), deliveredProduct); if (deliveredProduct.getId() != null) { searchCriteriaBu... |
@Test public void shouldFillCompanyFields() throws Exception { Integer buffer = Integer.valueOf(10); String paymentForm = "cash"; when(view.getComponentByReference(SUPPLIER)).thenReturn(supplierLookup); when(view.getComponentByReference(L_DELIVERY_DATE_BUFFER)).thenReturn(deliveryDateBufferField); when(view.getComponen... | public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE_BUFFER); FieldComponen... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... |
@Test public void shouldntFillCompanyFieldsWhenSupplierIsNotSelected() throws Exception { when(view.getComponentByReference(SUPPLIER)).thenReturn(supplierLookup); when(view.getComponentByReference(L_DELIVERY_DATE_BUFFER)).thenReturn(deliveryDateBufferField); when(view.getComponentByReference(L_PAYMENT_FORM)).thenReturn... | public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE_BUFFER); FieldComponen... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... | DeliveryDetailsHooks { public void fillCompanyFieldsForSupplier(final ViewDefinitionState view) { LookupComponent supplierLookup = (LookupComponent) view.getComponentByReference(DeliveryFields.SUPPLIER); FieldComponent deliveryDateBufferField = (FieldComponent) view .getComponentByReference(DeliveryFields.DELIVERY_DATE... |
@Test public void shouldReturnWhenEntityIdIsNull() throws Exception { final boolean enabledForm = true; final boolean enabledOrderedGrid = false; final boolean enabledDeliveredGrid = false; when(form.getEntityId()).thenReturn(null); when(stateField.getFieldValue()).thenReturn(PREPARED); deliveryDetailsHooks.changeField... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldReturnCorrectColumnValuesForOrdersTable() { List<Entity> orders = Arrays.asList(order, order2); Map<Entity, Map<String, String>> orderValues = workPlansColumnFiller.getOrderValues(orders); assertEquals(2, orderValues.size()); assertEquals(5, orderValues.get(order).size()); assertEquals(5, orderV... | @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(order, values); fillOrderPlannedEndDate(order, values); fillOr... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(order, values)... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(order, values)... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(order, values)... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getOrderValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { fillOrderNames(order, values); fillOrderNumbers(order, values)... |
@Test public void shouldDisabledFormAndOrderedFieldWhenStateIsPrepared() throws Exception { final boolean enabledForm = false; final boolean enabledOrderedGrid = false; final boolean enabledDeliveredGrid = true; when(stateField.getFieldValue()).thenReturn(PREPARED); deliveryDetailsHooks.changeFieldsEnabledDependOnState... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldDisabledFormAndOrderedFieldWhenStateIsApproved() throws Exception { final boolean enabledForm = false; final boolean enabledOrderedGrid = false; final boolean enabledDeliveredGrid = true; when(stateField.getFieldValue()).thenReturn(APPROVED); deliveryDetailsHooks.changeFieldsEnabledDependOnState... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldEnabledFieldsWhenStateIsDraft() throws Exception { final boolean enabledForm = true; final boolean enabledOrderedGrid = true; final boolean enabledDeliveredGrid = true; when(stateField.getFieldValue()).thenReturn(DRAFT); deliveryDetailsHooks.changeFieldsEnabledDependOnState(view); verify(form).s... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldDisabledFieldsWhenStateIsDeclined() throws Exception { final boolean enabledForm = false; final boolean enabledOrderedGrid = false; final boolean enabledDeliveredGrid = false; when(stateField.getFieldValue()).thenReturn(DECLINED); deliveryDetailsHooks.changeFieldsEnabledDependOnState(view); veri... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldDisabledFieldsWhenStateIsReceived() throws Exception { final boolean enabledForm = false; final boolean enabledOrderedGrid = false; final boolean enabledDeliveredGrid = false; when(stateField.getFieldValue()).thenReturn(RECEIVED); deliveryDetailsHooks.changeFieldsEnabledDependOnState(view); veri... | public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValue().toString(); if (del... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... | DeliveryDetailsHooks { public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) { FormComponent deliveryForm = (FormComponent) view.getComponentByReference(L_FORM); FieldComponent stateField = (FieldComponent) view.getComponentByReference(DeliveryFields.STATE); String state = stateField.getFieldValu... |
@Test public void shouldReturnTrueWhenCheckIfLocationIsWarehouse() { given(parameter.getBelongsToField(LOCATION)).willReturn(null); given(location.getStringField(TYPE)).willReturn(LocationType.WAREHOUSE.getStringValue()); boolean result = supplyParameterHooks.checkIfLocationIsWarehouse(parameterDD, parameter); Assert.a... | public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.global.error.locationIsNotWa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... |
@Test public void shouldReturnFalseWhenCheckIfLocationIsWarehouse() { given(parameter.getBelongsToField(LOCATION)).willReturn(location); given(location.getStringField(TYPE)).willReturn(LocationType.CONTROL_POINT.getStringValue()); boolean result = supplyParameterHooks.checkIfLocationIsWarehouse(parameterDD, parameter);... | public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.global.error.locationIsNotWa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... | SupplyParameterHooks { public boolean checkIfLocationIsWarehouse(final DataDefinition parameterDD, final Entity parameter) { Entity location = parameter.getBelongsToField(LOCATION); if ((location != null) && !isLocationIsWarehouse(location)) { parameter.addError(parameterDD.getField(LOCATION), "parameter.validate.globa... |
@Test public void shouldSetProductUnitWhenProductIsSelected() throws Exception { String unit = "szt"; when(productLookup.getEntity()).thenReturn(product); when(product.getStringField("unit")).thenReturn(unit); deliveredProductDetailsHooks.fillUnitFields(view); verify(deliveredUnitField).setFieldValue("szt"); verify(dam... | public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, DeliveredProductFields.... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... |
@Test public void shouldReturnWhenProductIsNull() throws Exception { when(productLookup.getEntity()).thenReturn(null); deliveredProductDetailsHooks.fillUnitFields(view); verify(deliveredUnitField).setFieldValue(""); verify(damagedUnitField).setFieldValue(""); verify(orderedUnitField).setFieldValue(""); } | public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitFields(view, DeliveredProductFields.... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... | DeliveredProductDetailsHooks { public void fillUnitFields(final ViewDefinitionState view) { List<String> unitNames = Lists.newArrayList("damagedQuantityUnit", "deliveredQuantityUnit", "orderedQuantityUnit"); List<String> additionalUnitNames = Lists.newArrayList("additionalQuantityUnit"); deliveriesService.fillUnitField... |
@Test public void shouldSetRequiredOnDeliveredQuantityField() throws Exception { deliveredProductDetailsHooks.setDeliveredQuantityFieldRequired(view); verify(deliveredQuantityField).setRequired(true); } | public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdateState(); } | DeliveredProductDetailsHooks { public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdateState(); } } | DeliveredProductDetailsHooks { public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdateState(); } } | DeliveredProductDetailsHooks { public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdateState(); } v... | DeliveredProductDetailsHooks { public void setDeliveredQuantityFieldRequired(final ViewDefinitionState view) { FieldComponent delivedQuantity = (FieldComponent) view.getComponentByReference(DeliveredProductFields.DELIVERED_QUANTITY); delivedQuantity.setRequired(true); delivedQuantity.requestComponentUpdateState(); } v... |
@Test public void shouldReturnCorrectColumnValuesForProducts() { EntityTree operComps = mockEntityTree(asList(operationComponent)); EntityTree operComps2 = mockEntityTree(asList(operationComponent)); given(technology.getTreeField(TechnologyFields.OPERATION_COMPONENTS)).willReturn(operComps, operComps2); given(operation... | @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer productQuantities = productQuantitiesService .getProductComponentQua... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer productQuantities = ... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer productQuantities = ... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer productQuantities = ... | WorkPlansColumnFiller implements ColumnFiller { @Override public Map<Entity, Map<String, String>> getValues(final List<Entity> orders) { Map<Entity, Map<String, String>> values = new HashMap<Entity, Map<String, String>>(); for (Entity order : orders) { OperationProductComponentWithQuantityContainer productQuantities = ... |
@Ignore @Test public void shouldReturnTrueWhenCheckIfProductIsProductsFamily() { given(companyProductsFamily.getBelongsToField(PRODUCT)).willReturn(product); given(productService.checkIfProductEntityTypeIsCorrect(product, PRODUCTS_FAMILY)).willReturn(true); boolean result = companyProductsFamilyHooks.checkIfProductIsPr... | public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(companyProductsFamilyDD.getField(PR... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... |
@Ignore @Test public void shouldReturnFalseWhenCheckIfProductIsProductsFamily() { given(companyProductsFamily.getBelongsToField(PRODUCT)).willReturn(product); given(productService.checkIfProductEntityTypeIsCorrect(product, PRODUCTS_FAMILY)).willReturn(false); boolean result = companyProductsFamilyHooks.checkIfProductIs... | public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(companyProductsFamilyDD.getField(PR... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... | CompanyProductsFamilyHooks { public boolean checkIfProductIsProductsFamily(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!productService.checkIfProductEntityTypeIsCorrect(companyProductsFamily.getBelongsToField(PRODUCT), PRODUCTS_FAMILY)) { companyProductsFamily.addError(compan... |
@Ignore @Test public void shouldReturnTrueWhenCheckIfProductsFamilyIsNotAlreadyUsed() { given(companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) .willReturn(true); boolean result = companyProductsFamilyHooks.checkIfProductsFamilyIsNotAlreadyUsed(companyProductFami... | public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyProductsFamilyDD.getField(PRODU... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... |
@Ignore @Test public void shouldReturnFalseWhenCheckIfProductsFamilyIsNotAlreadyUsed() { given(companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) .willReturn(false); boolean result = companyProductsFamilyHooks.checkIfProductsFamilyIsNotAlreadyUsed(companyProductFa... | public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyProductsFamilyDD.getField(PRODU... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... | CompanyProductsFamilyHooks { public boolean checkIfProductsFamilyIsNotAlreadyUsed(final DataDefinition companyProductsFamilyDD, final Entity companyProductsFamily) { if (!companyProductService.checkIfProductIsNotUsed(companyProductsFamily, PRODUCT, COMPANY, PRODUCTS_FAMILIES)) { companyProductsFamily.addError(companyPr... |
@Test public void shouldRetrunTrueWhenCheckIfProductIsNotUsedIfEntityIsSaved() { String belongsToProductName = "product"; String belongsToCompanyName = "company"; String hasManyName = "products"; given(companyProduct.getId()).willReturn(1L); boolean result = companyProductService.checkIfProductIsNotUsed(companyProduct,... | public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belongsToProductName); if (product == null) { return true; } else ... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... |
@Test public void shouldRetrunTrueWhenCheckIfProductIsNotUsedIfProductIsNull() { String belongsToProductName = "product"; String belongsToCompanyName = "company"; String hasManyName = "products"; given(companyProduct.getId()).willReturn(null); given(companyProduct.getBelongsToField(belongsToProductName)).willReturn(nul... | public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belongsToProductName); if (product == null) { return true; } else ... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... |
@Test public void shouldRetrunTrueWhenCheckIfProductIsNotUsedIfCompanyIsNull() { String belongsToProductName = "product"; String belongsToCompanyName = "company"; String hasManyName = "products"; given(companyProduct.getId()).willReturn(null); given(companyProduct.getBelongsToField(belongsToProductName)).willReturn(pro... | public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belongsToProductName); if (product == null) { return true; } else ... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... |
@Test public void shouldRetrunTrueWhenCheckIfProductIsNotUsedIfIsntUsed() { String belongsToProductName = "product"; String belongsToCompanyName = "company"; String hasManyName = "products"; given(companyProduct.getId()).willReturn(null); given(companyProduct.getBelongsToField(belongsToProductName)).willReturn(product)... | public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belongsToProductName); if (product == null) { return true; } else ... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... |
@Test public void shouldRetrunFalseWhenCheckIfProductIsNotUsedIfIsUsed() { String belongsToProductName = "product"; String belongsToCompanyName = "company"; String hasManyName = "products"; given(companyProduct.getId()).willReturn(null); given(companyProduct.getBelongsToField(belongsToProductName)).willReturn(product);... | public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belongsToProductName); if (product == null) { return true; } else ... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... | CompanyProductServiceImpl implements CompanyProductService { public boolean checkIfProductIsNotUsed(final Entity companyProduct, final String belongsToProductName, final String belongsToCompanyName, final String hasManyName) { if (companyProduct.getId() == null) { Entity product = companyProduct.getBelongsToField(belon... |
@Test public void shouldReturnTrueWhenIsColumnsForDeliveriesEmpty() { given( columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES)).willReturn(true); boolean result = deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty(); assertTrue(result); ... | public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override void fillColumnsForDeliveries(final String plugin... | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override void fillColumnsForDeliveries(final String plugin... |
@Test public void shouldSetParameterDefaultValuesIfParameterIsntNull() { when(parameterService.getParameter()).thenReturn(parameter); when(parameter.isValid()).thenReturn(true); when(parameter.getDataDefinition()).thenReturn(parameterDD); when(parameterDD.save(parameter)).thenReturn(parameter); workPlansColumnLoaderSer... | public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_IN_WORK_PLANS, ParameterFieldsWP.IMAGE_URL_IN_WORK_PLAN, ParameterFieldsWP.DONT_PRINT_INP... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_IN_WORK_PLANS,... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_IN_WORK_PLANS,... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_IN_WORK_PLANS,... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void setParameterDefaultValues() { Entity parameter = parameterService.getParameter(); for (String fieldName : Lists.newArrayList(ParameterFieldsWP.HIDE_DESCRIPTION_IN_WORK_PLANS, ParameterFieldsWP.HIDE_TECHNOLOGY_AND_ORDER_IN_WORK_PLANS,... |
@Test public void shouldReturnFalseWhenIsColumnsForDeliveriesEmpty() { given( columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES)).willReturn(false); boolean result = deliveriesColumnLoaderService.isColumnsForDeliveriesEmpty(); assertFalse(result... | public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override void fillColumnsForDeliveries(final String plugin... | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForDeliveriesEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override void fillColumnsForDeliveries(final String plugin... |
@Test public void shouldReturnTrueWhenIsColumnsForOrdersEmpty() { given( columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS)).willReturn(true); boolean result = deliveriesColumnLoaderService.isColumnsForOrdersEmpty(); assertTrue(result); } | public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } @Override void fillColumnsForDeliveries(final String plugin); @Over... | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } @Override void fillColumnsForDeliveries(final String plugin); @Over... |
@Test public void shouldReturnFalseWhenIsColumnsForOrdersEmpty() { given( columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS)).willReturn(false); boolean result = deliveriesColumnLoaderService.isColumnsForOrdersEmpty(); assertFalse(result); } | public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } } | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } @Override void fillColumnsForDeliveries(final String plugin); @Over... | DeliveriesColumnLoaderServiceImpl implements DeliveriesColumnLoaderService { public boolean isColumnsForOrdersEmpty() { return columnExtensionService.isColumnsEmpty(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_ORDERS); } @Override void fillColumnsForDeliveries(final String plugin); @Over... |
@Test public void shouldMultiTenantEnable() { deliveriesOnStartupService.multiTenantEnable(); verify(deliveriesColumnLoader).addColumnsForDeliveries(); verify(deliveriesColumnLoader).addColumnsForOrders(); } | @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisable(); } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantEnable() { deliveriesColumnLoader.addColumnsForDeliveries(); deliveriesColumnLoader.addColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisable(); } |
@Test public void shouldMultiTenantDisable() { deliveriesOnStartupService.multiTenantDisable(); verify(deliveriesColumnLoader).deleteColumnsForDeliveries(); verify(deliveriesColumnLoader).deleteColumnsForOrders(); } | @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisable(); } | DeliveriesOnStartupService extends Module { @Transactional @Override public void multiTenantDisable() { deliveriesColumnLoader.deleteColumnsForDeliveries(); deliveriesColumnLoader.deleteColumnsForOrders(); } @Transactional @Override void multiTenantEnable(); @Transactional @Override void multiTenantDisable(); } |
@Test public void shouldReturnNullWhenGetDelivery() { Long deliveryId = null; given(deliveryDD.get(deliveryId)).willReturn(null); Entity result = deliveriesService.getDelivery(deliveryId); assertEquals(null, result); } | @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity getDeliveredProduct(final ... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity getDeliveredProduct(final ... |
@Test public void shouldReturnDeliveryWhenGetDelivery() { Long deliveryId = 1L; given(deliveryDD.get(deliveryId)).willReturn(delivery); Entity result = deliveriesService.getDelivery(deliveryId); assertEquals(delivery, result); } | @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity getDeliveredProduct(final ... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDelivery(final Long deliveryId) { return getDeliveryDD().get(deliveryId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity getDeliveredProduct(final ... |
@Test public void shouldReturnNullWhenGetOrderedProduct() { Long orderedProductId = null; given(orderedProductDD.get(orderedProductId)).willReturn(null); Entity result = deliveriesService.getOrderedProduct(orderedProductId); assertEquals(null, result); } | @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entit... |
@Test public void shouldReturnOrderedProductWhenGetOrderedProduct() { Long orderedProductId = 1L; given(orderedProductDD.get(orderedProductId)).willReturn(orderedProduct); Entity result = deliveriesService.getOrderedProduct(orderedProductId); assertEquals(orderedProduct, result); } | @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getOrderedProduct(final Long deliveredProductId) { return getOrderedProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entit... |
@Test public void shouldReturnNullWhenGetDeliveredProduct() { Long deliveredProductId = null; given(deliveredProductDD.get(deliveredProductId)).willReturn(null); Entity result = deliveriesService.getDeliveredProduct(deliveredProductId); assertEquals(null, result); } | @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... |
@Ignore @Test public void shouldFillColumnsForProducts() { when(dataDefinitionService.get(WorkPlansConstants.PLUGIN_IDENTIFIER, WorkPlansConstants.MODEL_COLUMN_FOR_INPUT_PRODUCTS)) .thenReturn(columnForInputProductsDD); when(dataDefinitionService.get(WorkPlansConstants.PLUGIN_IDENTIFIER, WorkPlansConstants.MODEL_COLUMN... | public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : columnsAttributes.values()) { readData(L_COLUMN_FOR_PRODUCTS, OperationType.ADD, ... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : column... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : column... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : column... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void fillColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : column... |
@Test public void shouldReturnDeliveredProductWhenGetDeliveredProduct() { Long deliveredProductId = 1L; given(deliveredProductDD.get(deliveredProductId)).willReturn(deliveredProduct); Entity result = deliveriesService.getDeliveredProduct(deliveredProductId); assertEquals(deliveredProduct, result); } | @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... |
@Test public void shouldReturnNullWhenGetCompanyProduct() { Long companyProductId = null; given(companyProductDD.get(companyProductId)).willReturn(null); Entity result = deliveriesService.getDeliveredProduct(companyProductId); assertEquals(null, result); } | @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... |
@Test public void shouldReturnCompanyProductWhenGetCompanyProduct() { Long companyProductId = 1L; given(companyProductDD.get(companyProductId)).willReturn(companyProduct); Entity result = deliveriesService.getCompanyProduct(companyProductId); assertEquals(companyProduct, result); } | @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity ge... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProduct(final Long companyProductId) { return getCompanyProductDD().get(companyProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override Entity ge... |
@Test public void shouldReturnNullWhenGetCompanyProductsFamily() { Long companyProductsFamilyId = null; given(companyProductsFamilyDD.get(companyProductsFamilyId)).willReturn(null); Entity result = deliveriesService.getDeliveredProduct(companyProductsFamilyId); assertEquals(null, result); } | @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getDeliveredProduct(final Long deliveredProductId) { return getDeliveredProductDD().get(deliveredProductId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredProductId); @Override E... |
@Test public void shouldReturnCompanyProductsFamilyWhenGetCompanyProductsFamily() { Long companyProductsFamilyId = 1L; given(companyProductsFamilyDD.get(companyProductsFamilyId)).willReturn(companyProductsFamily); Entity result = deliveriesService.getCompanyProductsFamily(companyProductsFamilyId); assertEquals(companyP... | @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredPro... | DeliveriesServiceImpl implements DeliveriesService { @Override public Entity getCompanyProductsFamily(final Long companyProductsFamilyId) { return getCompanyProductsFamilyDD().get(companyProductsFamilyId); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long deliveredPro... |
@Ignore @Test public void shouldReturnNullWhenGetColumnsForDeliveriesIfColumnsForDeliveriesAreNull() { given(columnForDeliveriesDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.addOrder(Mockito.any(SearchOrder.class))).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.list()).willR... | @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entity>(); Entity successionColumn = getColumnForDeliverie... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... |
@Ignore @Test public void shouldReturnColumnsForDeliveriesWhenGetColumnsForDeliveriesIfColumnsForDeliveriesArentNull() { given(columnForDeliveriesDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.addOrder(Mockito.any(SearchOrder.class))).willReturn(searchCriteriaBuilder); given(searchCriteriaBui... | @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entity>(); Entity successionColumn = getColumnForDeliverie... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... | DeliveriesServiceImpl implements DeliveriesService { @Override public List<Entity> getColumnsForDeliveries() { List<Entity> columnsForDeliveries = getColumnForDeliveriesDD().find() .addOrder(SearchOrders.asc(ColumnForDeliveriesFields.SUCCESSION)).list().getEntities(); List<Entity> deliveriesColumn = new ArrayList<Entit... |
@Test public void shouldReturnDeliveryDD() { DataDefinition result = deliveriesService.getDeliveryDD(); assertEquals(deliveryDD, result); } | @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long delive... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveryDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERY); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(final Long delive... |
@Test public void shouldReturnOrderedProductDD() { DataDefinition result = deliveriesService.getOrderedProductDD(); assertEquals(orderedProductDD, result); } | @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(fina... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getOrderedProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_ORDERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(fina... |
@Test public void shouldReturnDeliveredProductDD() { DataDefinition result = deliveriesService.getDeliveredProductDD(); assertEquals(deliveredProductDD, result); } | @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getDeliveredProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_DELIVERED_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(... |
@Ignore @Test public void shouldClearColumnsForProducts() { when(dataDefinitionService.get(WorkPlansConstants.PLUGIN_IDENTIFIER, WorkPlansConstants.MODEL_COLUMN_FOR_INPUT_PRODUCTS)) .thenReturn(columnForInputProductsDD); when(dataDefinitionService.get(WorkPlansConstants.PLUGIN_IDENTIFIER, WorkPlansConstants.MODEL_COLUM... | public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : columnsAttributes.values()) { readData(L_COLUMN_FOR_PRODUCTS, OperationType.DELE... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : colum... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : colum... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : colum... | WorkPlansColumnLoaderServiceImpl implements WorkPlansColumnLoaderService { public void clearColumnsForProducts(final String plugin) { Map<Integer, Map<String, String>> columnsAttributes = columnExtensionService.getColumnsAttributesFromXML(plugin, L_COLUMN_FOR_PRODUCTS); for (Map<String, String> columnAttributes : colum... |
@Test public void shouldReturnCompanyProductDD() { DataDefinition result = deliveriesService.getCompanyProductDD(); assertEquals(companyProductDD, result); } | @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(fina... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCT); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedProduct(fina... |
@Test public void shouldReturnCompanyProductsFamilyDD() { DataDefinition result = deliveriesService.getCompanyProductsFamilyDD(); assertEquals(companyProductsFamilyDD, result); } | @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrd... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getCompanyProductsFamilyDD() { return dataDefinitionService .get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COMPANY_PRODUCTS_FAMILY); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrd... |
@Test public void shouldReturnColumnForDeliveriesDD() { DataDefinition result = deliveriesService.getColumnForDeliveriesDD(); assertEquals(columnForDeliveriesDD, result); } | @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } } | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedP... | DeliveriesServiceImpl implements DeliveriesService { @Override public DataDefinition getColumnForDeliveriesDD() { return dataDefinitionService.get(DeliveriesConstants.PLUGIN_IDENTIFIER, DeliveriesConstants.MODEL_COLUMN_FOR_DELIVERIES); } @Override Entity getDelivery(final Long deliveryId); @Override Entity getOrderedP... |
@Test public final void shouldPass() { Entity operationalTask = mockOperationalTask(OTHER_TASK_TYPE, "some name", EARLIER_DATE, LATER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertTrue(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldPassIfTypeIsNotTheOtherTask() { Entity operationalTask = mockOperationalTask(YET_ANOTHER_TASK_TYPE, null, EARLIER_DATE, LATER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertTrue(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldPassIfDatesAreTheSame() { Entity operationalTask = mockOperationalTask(OTHER_TASK_TYPE, "some name", EARLIER_DATE, EARLIER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertTrue(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldFailBecauseOfMissingName() { Entity operationalTask = mockOperationalTask(OTHER_TASK_TYPE, null, EARLIER_DATE, LATER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertFalse(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldFailBecauseOfBlankName() { Entity operationalTask = mockOperationalTask(OTHER_TASK_TYPE, " ", EARLIER_DATE, LATER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertFalse(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldFailBecauseOfWrongOrderDates() { Entity operationalTask = mockOperationalTask(OTHER_TASK_TYPE, "some name", LATER_DATE, EARLIER_DATE); boolean isValid = operationalTaskValidators.onValidate(operationalTaskDD, operationalTask); assertFalse(isValid); } | public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } } | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... | OperationalTaskValidators { public boolean onValidate(final DataDefinition operationalTaskDD, final Entity operationalTask) { boolean isValid = true; isValid = hasName(operationalTaskDD, operationalTask) && isValid; isValid = datesAreInCorrectOrder(operationalTaskDD, operationalTask) && isValid; return isValid; } bool... |
@Test public final void shouldRunGenerator() { List<Entity> generatorResults = Lists.newArrayList(mockEntity(), mockEntity()); stubGeneratorResults(generatorResults); given(order.getBelongsToField(OrderFields.TECHNOLOGY)).willReturn(technology); given(orderFromDB.getBelongsToField(OrderFields.TECHNOLOGY)).willReturn(nu... | public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.getId()); shouldUpdate = orderFr... | OrderHooksCNFM { public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.getId()); shoul... | OrderHooksCNFM { public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.getId()); shoul... | OrderHooksCNFM { public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.getId()); shoul... | OrderHooksCNFM { public void fillOrderOperationProductsInComponents(final DataDefinition orderDD, final Entity order) { Entity technology = order.getBelongsToField(OrderFields.TECHNOLOGY); if (technology != null) { boolean shouldUpdate; if (order.getId() != null) { Entity orderFromDb = orderDD.get(order.getId()); shoul... |
@Test public final void shouldEnableDeleteButton() { stubGridSelectedEntities(mockWorkPlanEntity(false, OrderState.PENDING, OrderState.PENDING), mockWorkPlanEntity(false, OrderState.ACCEPTED, OrderState.COMPLETED), mockWorkPlanEntity(true, OrderState.ACCEPTED, OrderState.IN_PROGRESS)); workPlansListHooks.setGridGenerat... | public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView... | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView... |
@Test public final void shouldBuildEntity() { Entity order = mockEntity(); ProductWithCosts productWithCosts = new ProductWithCosts(1L, BigDecimal.valueOf(2L), BigDecimal.valueOf(3L), BigDecimal.valueOf(4L), BigDecimal.valueOf(5L)); orderMaterialCostsEntityBuilder.create(order, productWithCosts); verify(createdEntity).... | @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConstants.MODEL_TECHNOLOGY_INST_OPER_PRODUCT_IN_COMP).create(); orderMaterialCosts.setField(Technolog... | OrderMaterialCostsEntityBuilderImpl implements OrderMaterialCostsEntityBuilder { @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConstants.MODEL_TECH... | OrderMaterialCostsEntityBuilderImpl implements OrderMaterialCostsEntityBuilder { @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConstants.MODEL_TECH... | OrderMaterialCostsEntityBuilderImpl implements OrderMaterialCostsEntityBuilder { @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConstants.MODEL_TECH... | OrderMaterialCostsEntityBuilderImpl implements OrderMaterialCostsEntityBuilder { @Override public Entity create(final Entity order, final ProductWithCosts productWithCosts) { Entity orderMaterialCosts = dataDefinitionService.get(CostNormsForMaterialsConstants.PLUGIN_IDENTIFIER, CostNormsForMaterialsConstants.MODEL_TECH... |
@Test public final void shouldCopeWithZeroQuantity() { Long productId = 1L; BigDecimal newQuantity = BigDecimal.valueOf(3L); BigDecimal newCostForOrder = BigDecimal.valueOf(100L); BigDecimal averageCost = BigDecimal.ONE; BigDecimal oldQuantity = BigDecimal.valueOf(0L).setScale(20); BigDecimal nominalCost = BigDecimal.v... | public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterialCostsOpt.isPresent()) { Entity ... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... |
@Test public final void shouldCopeWithZeroNewQuantity() { Long productId = 1L; BigDecimal newQuantity = BigDecimal.valueOf(0L).setScale(20); BigDecimal newCostForOrder = BigDecimal.valueOf(100L); BigDecimal averageCost = BigDecimal.ONE; BigDecimal oldQuantity = BigDecimal.valueOf(0L).setScale(20); BigDecimal nominalCos... | public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterialCostsOpt.isPresent()) { Entity ... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... |
@Test public final void shouldUpdateCosts() { Long productId = 1L; BigDecimal newQuantity = BigDecimal.valueOf(1L); BigDecimal newCostForOrder = BigDecimal.valueOf(100L); BigDecimal averageCost = BigDecimal.valueOf(3L); BigDecimal oldQuantity = BigDecimal.valueOf(3L).setScale(5); BigDecimal nominalCost = BigDecimal.val... | public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterialCostsOpt.isPresent()) { Entity ... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... | CostNormsForMaterialsService { public Entity updateCostsForProductInOrder(final Entity order, final Long productId, final Optional<BigDecimal> newQuantity, final Optional<BigDecimal> costForOrder) { Optional<Entity> orderMaterialCostsOpt = orderMaterialCostsDataProvider.find(order.getId(), productId); if (orderMaterial... |
@Test public void shouldAddColumn() { String pluginIdentifier = "plugin"; String model = "model"; given(dataDefinitionService.get(pluginIdentifier, model)).willReturn(entityDD); given(entityDD.create()).willReturn(entity); given(entity.getDataDefinition()).willReturn(entityDD); given(entityDD.save(entity)).willReturn(e... | public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER.toLowerCase(Locale.ENGLISH))); column.setField(NAME, columnAttributes.get(NA... | ColumnExtensionServiceImpl implements ColumnExtensionService { public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER.toLowerCase(L... | ColumnExtensionServiceImpl implements ColumnExtensionService { public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER.toLowerCase(L... | ColumnExtensionServiceImpl implements ColumnExtensionService { public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER.toLowerCase(L... | ColumnExtensionServiceImpl implements ColumnExtensionService { public Entity addColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { Entity column = getColumnDD(pluginIdentifier, model).create(); column.setField(IDENTIFIER, columnAttributes.get(IDENTIFIER.toLowerCase(L... |
@Test public void shouldDeleteColumn() { String pluginIdentifier = "plugin"; String model = "model"; entities = mockEntityList(Arrays.asList(entity)); given(dataDefinitionService.get(pluginIdentifier, model)).willReturn(entityDD); given(entityDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.add... | public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAttributes.get(IDENTIFIER))).list().getEntities(); for (Entity column : columns)... | ColumnExtensionServiceImpl implements ColumnExtensionService { public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAttributes.get(ID... | ColumnExtensionServiceImpl implements ColumnExtensionService { public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAttributes.get(ID... | ColumnExtensionServiceImpl implements ColumnExtensionService { public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAttributes.get(ID... | ColumnExtensionServiceImpl implements ColumnExtensionService { public void deleteColumn(final String pluginIdentifier, final String model, final Map<String, String> columnAttributes) { final List<Entity> columns = getColumnDD(pluginIdentifier, model).find() .add(SearchRestrictions.eq(IDENTIFIER, columnAttributes.get(ID... |
@Test public void shouldReturnTrueWhenIsColumnsEmpty() { String pluginIdentifier = "plugin"; String model = "model"; given(dataDefinitionService.get(pluginIdentifier, model)).willReturn(entityDD); given(entityDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.list()).willReturn(searchResult); giv... | public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } Map<Integer, Map<String, String>> getColumnsAttributesFromXML(final String plugi... | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } Map<Integer, Map<String, String>> getColumnsAttributesFromXML(final String plugi... |
@Test public void shouldReturnFalseWhenIsColumnsEmpty() { String pluginIdentifier = "plugin"; String model = "model"; given(dataDefinitionService.get(pluginIdentifier, model)).willReturn(entityDD); given(entityDD.find()).willReturn(searchCriteriaBuilder); given(searchCriteriaBuilder.list()).willReturn(searchResult); gi... | public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } } | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } Map<Integer, Map<String, String>> getColumnsAttributesFromXML(final String plugi... | ColumnExtensionServiceImpl implements ColumnExtensionService { public boolean isColumnsEmpty(final String pluginIdentifier, final String model) { return getColumnDD(pluginIdentifier, model).find().list().getTotalNumberOfEntities() == 0; } Map<Integer, Map<String, String>> getColumnsAttributesFromXML(final String plugi... |
@Test public void shouldSetRequiredOnCommentForControlResult() { FormComponent form = mock(FormComponent.class); FieldComponent comment = mock(FieldComponent.class); FieldComponent controlResult = mock(FieldComponent.class); ViewDefinitionState state = mock(ViewDefinitionState.class); given(state.getComponentByReferenc... | public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (controlResult != null && controlResult.get... | QualityControlService { public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (controlResult != n... | QualityControlService { public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (controlResult != n... | QualityControlService { public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (controlResult != n... | QualityControlService { public void checkIfCommentIsRequiredBasedOnResult(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent controlResult = (FieldComponent) state.getComponentByReference(FIELD_CONTROL_RESULT); if (controlResult != n... |
@Test public void shouldSetRequiredOnCommentForDefects() { FormComponent form = mock(FormComponent.class); FieldComponent comment = mock(FieldComponent.class); FieldComponent acceptedDefectsQuantity = mock(FieldComponent.class); ViewDefinitionState state = mock(ViewDefinitionState.class); given(state.getComponentByRefe... | public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QUANTITY_LITERAL); if (acceptedDefectsQu... | QualityControlService { public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QUANTITY_LITERAL... | QualityControlService { public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QUANTITY_LITERAL... | QualityControlService { public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QUANTITY_LITERAL... | QualityControlService { public void checkIfCommentIsRequiredBasedOnDefects(final ViewDefinitionState state) { FieldComponent comment = (FieldComponent) state.getComponentByReference(FIELD_COMMENT); FieldComponent acceptedDefectsQuantity = (FieldComponent) state .getComponentByReference(ACCEPTED_DEFECTS_QUANTITY_LITERAL... |
@Test public final void shouldDisableDeleteButtonWhenNoneEntityIsSelected() { stubGridSelectedEntities(); workPlansListHooks.setGridGenerateButtonState(workPlansListView); verify(workPlansListView).setUpDeleteButton(false, null); } | public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } } | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView... | WorkPlansListHooks { public void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState) { setGridGenerateButtonState(WorkPlansListView.from(viewDefinitionState)); } void setGridGenerateButtonState(final ViewDefinitionState viewDefinitionState); void setGridGenerateButtonState(final WorkPlansListView... |
@Test public void shouldSetRequiredOnCommentAfterSelectChange() { FieldComponent resultType = mock(FieldComponent.class); FieldComponent comment = mock(FieldComponent.class); ViewDefinitionState state = mock(ViewDefinitionState.class); given(resultType.getFieldValue()).willReturn("03objection"); given(state.getComponen... | public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponent) state; FieldComponent comment = (Fi... | QualityControlService { public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponent) state; Fiel... | QualityControlService { public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponent) state; Fiel... | QualityControlService { public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponent) state; Fiel... | QualityControlService { public void checkQualityControlResult(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (!(state instanceof FieldComponent)) { throw new IllegalStateException("component is not select"); } FieldComponent resultType = (FieldComponent) state; Fiel... |
@Test public void shouldSetErrorOnCommentFieldForResultType() { Entity entity = mock(Entity.class); DataDefinition dataDefinition = mock(DataDefinition.class); given(entity.getStringField("qualityControlType")).willReturn("qualityControlsForOrder"); given(entity.getStringField("controlResult")).willReturn("03objection"... | public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entity); } else { return chec... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... |
@Test public void shouldSetErrorOnCommentFieldForAcceptedDefectsQuantity() { Entity entity = mock(Entity.class); DataDefinition dataDefinition = mock(DataDefinition.class); given(entity.getStringField("qualityControlType")).willReturn("qualityControlsForUnit"); given(entity.getDecimalField("acceptedDefectsQuantity")).w... | public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entity); } else { return chec... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... | QualityControlService { public boolean checkIfCommentForResultOrQuantityIsReq(final DataDefinition dataDefinition, final Entity entity) { String qualityControlType = entity.getStringField(QUALITY_CONTROL_TYPE_LITERAL); if (hasControlResult(qualityControlType)) { return checkIfCommentForResultIsReq(dataDefinition, entit... |
@Test public void shouldCloseQualityControlForEntityComponentState() { FormComponent state = mock(FormComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent controlResult = mock(FieldComponent.class); FieldComponent closed = mock(FieldComponent.class); FieldComponent... | public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... |
@Test public void shouldCloseQualityControlForIGridComponentState() { GridComponent state = mock(GridComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); Entity qualityControl = mock(Entity.class); DataDefinition qualityControlDD = mock(DataDefinition.class); FieldComponent contr... | public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... |
@Test public void shouldAddFailureMessageOnEmptyControlResultTypeForFormComponent() { FormComponent state = mock(FormComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent controlResult = mock(FieldComponent.class); Entity qualityControl = mock(Entity.class); DataDef... | public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... |
@Test public void shouldAddFailureMessageOnEmptyControlResultTypeForGridComponent() { GridComponent state = mock(GridComponent.class); ViewDefinitionState viewDefinitionState = mock(ViewDefinitionState.class); FieldComponent controlResult = mock(FieldComponent.class); Entity qualityControl = mock(Entity.class); DataDef... | public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { state.addMessage("smartVi... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... | QualityControlService { public void closeQualityControl(final ViewDefinitionState viewDefinitionState, final ComponentState state, final String[] args) { if (state.getFieldValue() == null) { if (state instanceof FormComponent) { state.addMessage("smartView.form.entityWithoutIdentifier", MessageType.FAILURE); } else { s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.