Example usage for java.math BigDecimal ONE

List of usage examples for java.math BigDecimal ONE

Introduction

In this page you can find the example usage for java.math BigDecimal ONE.

Prototype

BigDecimal ONE

To view the source code for java.math BigDecimal ONE.

Click Source Link

Document

The value 1, with a scale of 0.

Usage

From source file:org.openvpms.archetype.rules.patient.reminder.ReminderRulesTestCase.java

/**
 * Tests the {@link ReminderRules#getDocumentFormReminder} method, when the <em>act.patientDocumentForm</em> is
 * linked to an invoice item./*  w  w w .ja  v  a 2 s . c  om*/
 */
@Test
public void testGetDocumentFormReminderForInvoiceItem() {
    Party patient = TestHelper.createPatient();
    DocumentAct form = PatientTestHelper.createDocumentForm(patient);

    // verify a form not associated with any invoice item nor product returns null
    assertNull(rules.getDocumentFormReminder(form));

    // create an invoice item and associate the form with it
    Act item = FinancialTestHelper.createChargeItem(CustomerAccountArchetypes.INVOICE_ITEM, patient,
            TestHelper.createProduct(), BigDecimal.ONE);
    ActBean itemBean = new ActBean(item);
    itemBean.addNodeRelationship("documents", form);
    save(item, form);

    // should return null as neither the invoice nor product associated with the form have reminders
    assertNull(rules.getDocumentFormReminder(form));

    // associate a single reminder with the invoice item, and verify it is returned by getDocumentFormReminder()
    Entity reminderType1 = createReminderType();
    Act reminder1 = createReminderWithDueDate(patient, reminderType1, getDate("2012-01-12"));
    itemBean.addNodeRelationship("reminders", reminder1);
    save(item, reminder1);
    assertEquals(reminder1, rules.getDocumentFormReminder(form));

    // associate another reminder with the invoice item, with a closer due date. This should be returned
    Entity reminderType2 = createReminderType();
    Act reminder2 = createReminderWithDueDate(patient, reminderType2, getDate("2012-01-11"));
    itemBean.addNodeRelationship("reminders", reminder2);
    save(item, reminder2);
    assertEquals(reminder2, rules.getDocumentFormReminder(form));

    // associate another reminder with the invoice item, with the same due date. The reminder with the lower id
    // should be returned
    Entity reminderType3 = createReminderType();
    Act reminder3 = createReminderWithDueDate(patient, reminderType3, getDate("2012-01-11"));
    itemBean.addNodeRelationship("reminders", reminder3);
    save(item, reminder3);
    assertEquals(reminder2, rules.getDocumentFormReminder(form));
}

From source file:org.apache.olingo.server.core.serializer.json.EdmAssistedJsonSerializerTest.java

@Test(expected = SerializerException.class)
public void wrongValueForPropertyFacet() throws Exception {
    EntityCollection entityCollection = new EntityCollection();
    entityCollection.getEntities().add(new Entity().addProperty(
            new Property(null, "PropertyDecimal", ValueType.PRIMITIVE, BigDecimal.ONE.scaleByPowerOfTen(-11))));
    serializer.entityCollection(metadata, entityContainer.getEntitySet("ESAllPrim").getEntityType(),
            entityCollection, null);/*  w ww .ja  va  2s.  c  om*/
}

From source file:org.nd4j.linalg.util.BigDecimalMath.java

/**
 * The exponential function./*from ww w. ja  v  a2  s.  c o  m*/
 *
 * @param x the argument.
 * @return exp(x).
 * The precision of the result is implicitly defined by the precision in the argument.
 * 16
 * In particular this means that "Invalid Operation" errors are thrown if catastrophic
 * cancellation of digits causes the result to have no valid digits left.
 */
static public BigDecimal exp(BigDecimal x) {
    /* To calculate the value if x is negative, use exp(-x) = 1/exp(x)
     */
    if (x.compareTo(BigDecimal.ZERO) < 0) {
        final BigDecimal invx = exp(x.negate());
        /* Relative error in inverse of invx is the same as the relative errror in invx.
         * This is used to define the precision of the result.
         */
        MathContext mc = new MathContext(invx.precision());
        return BigDecimal.ONE.divide(invx, mc);
    } else if (x.compareTo(BigDecimal.ZERO) == 0) {
        /* recover the valid number of digits from x.ulp(), if x hits the
         * zero. The x.precision() is 1 then, and does not provide this information.
         */
        return scalePrec(BigDecimal.ONE, -(int) (Math.log10(x.ulp().doubleValue())));
    } else {
        /* Push the number in the Taylor expansion down to a small
         * value where TAYLOR_NTERM terms will do. If x<1, the n-th term is of the order
         * x^n/n!, and equal to both the absolute and relative error of the result
         * since the result is close to 1. The x.ulp() sets the relative and absolute error
         * of the result, as estimated from the first Taylor term.
         * We want x^TAYLOR_NTERM/TAYLOR_NTERM! < x.ulp, which is guaranteed if
         * x^TAYLOR_NTERM < TAYLOR_NTERM*(TAYLOR_NTERM-1)*...*x.ulp.
         */
        final double xDbl = x.doubleValue();
        final double xUlpDbl = x.ulp().doubleValue();
        if (Math.pow(xDbl, TAYLOR_NTERM) < TAYLOR_NTERM * (TAYLOR_NTERM - 1.0) * (TAYLOR_NTERM - 2.0)
                * xUlpDbl) {
            /* Add TAYLOR_NTERM terms of the Taylor expansion (Eulers sum formula)
             */
            BigDecimal resul = BigDecimal.ONE;
            /* x^i */
            BigDecimal xpowi = BigDecimal.ONE;
            /* i factorial */
            BigInteger ifac = BigInteger.ONE;
            /* TAYLOR_NTERM terms to be added means we move x.ulp() to the right
             * for each power of 10 in TAYLOR_NTERM, so the addition wont add noise beyond
             * whats already in x.
             */
            MathContext mcTay = new MathContext(err2prec(1., xUlpDbl / TAYLOR_NTERM));
            for (int i = 1; i <= TAYLOR_NTERM; i++) {
                ifac = ifac.multiply(new BigInteger("" + i));
                xpowi = xpowi.multiply(x);
                final BigDecimal c = xpowi.divide(new BigDecimal(ifac), mcTay);
                resul = resul.add(c);
                if (Math.abs(xpowi.doubleValue()) < i && Math.abs(c.doubleValue()) < 0.5 * xUlpDbl) {
                    break;
                }
            }
            /* exp(x+deltax) = exp(x)(1+deltax) if deltax is <<1. So the relative error
             * in the result equals the absolute error in the argument.
             */
            MathContext mc = new MathContext(err2prec(xUlpDbl / 2.));
            return resul.round(mc);
        } else {
            /* Compute exp(x) = (exp(0.1*x))^10. Division by 10 does not lead
             * to loss of accuracy.
             */
            int exSc = (int) (1.0 - Math.log10(TAYLOR_NTERM * (TAYLOR_NTERM - 1.0) * (TAYLOR_NTERM - 2.0)
                    * xUlpDbl / Math.pow(xDbl, TAYLOR_NTERM)) / (TAYLOR_NTERM - 1.0));
            BigDecimal xby10 = x.scaleByPowerOfTen(-exSc);
            BigDecimal expxby10 = exp(xby10);
            /* Final powering by 10 means that the relative error of the result
             * is 10 times the relative error of the base (First order binomial expansion).
             * This looses one digit.
             */
            MathContext mc = new MathContext(expxby10.precision() - exSc);
            /* Rescaling the powers of 10 is done in chunks of a maximum of 8 to avoid an invalid operation
            17
             * response by the BigDecimal.pow library or integer overflow.
             */
            while (exSc > 0) {
                int exsub = Math.min(8, exSc);
                exSc -= exsub;
                MathContext mctmp = new MathContext(expxby10.precision() - exsub + 2);
                int pex = 1;
                while (exsub-- > 0) {
                    pex *= 10;
                }
                expxby10 = expxby10.pow(pex, mctmp);
            }
            return expxby10.round(mc);
        }
    }
}

From source file:pe.gob.mef.gescon.web.ui.MaestroMB.java

public void activarDetalle(ActionEvent event) {
    try {//from ww  w. j  a  v a 2  s . c om
        if (event != null) {
            if (this.getSelectedMaestroDetalle() != null) {
                LoginMB loginMB = (LoginMB) JSFUtils.getSessionAttribute("loginMB");
                User user = loginMB.getUser();
                MaestroDetalleService service = (MaestroDetalleService) ServiceFinder
                        .findBean("MaestroDetalleService");
                this.getSelectedMaestroDetalle().setNactivo(BigDecimal.ONE);
                this.getSelectedMaestroDetalle().setDfechamodificacion(new Date());
                this.getSelectedMaestroDetalle().setVusuariomodificacion(user.getVlogin());
                service.saveOrUpdate(this.getSelectedMaestroDetalle());
                this.setListaMaestroDetalle(service.getDetallesByMaestro(this.getSelectedMaestro()));
            } else {
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, Constante.SEVERETY_ALERTA,
                        "Debe seleccionar el detalle a activar.");
                FacesContext.getCurrentInstance().addMessage(null, message);
            }
        }
    } catch (Exception e) {
        log.error(e.getMessage());
        e.printStackTrace();
    }
}

From source file:org.alfresco.extension.bulkimport.impl.BatchImporterImpl.java

private final void importVersion(final NodeRef nodeRef, final BulkImportItemVersion previousVersion,
        final BulkImportItemVersion version, final boolean dryRun, final boolean onlyOneVersion)
        throws InterruptedException {
    Map<String, Serializable> versionProperties = new HashMap<>();
    boolean isMajor = true;

    if (version == null) {
        throw new IllegalStateException(
                "version was null. This is indicative of a bug in the chosen import source.");
    }//from   w  w w. j  a  v  a  2 s. c  om

    importVersionContentAndMetadata(nodeRef, version, dryRun);

    if (previousVersion != null && version.getVersionNumber() != null) {
        final BigDecimal difference = version.getVersionNumber().subtract(previousVersion.getVersionNumber());

        isMajor = difference.compareTo(BigDecimal.ONE) >= 0;
    }

    // Note: PROP_VERSION_LABEL is a "reserved" property, and cannot be modified by custom code.
    // In other words, we can't use the source's version label as the version label in Alfresco.  :-(
    // See: https://github.com/pmonks/alfresco-bulk-import/issues/13
    //        versionProperties.put(ContentModel.PROP_VERSION_LABEL.toString(), String.valueOf(version.getVersionNumber().toString()));

    versionProperties.put(VersionModel.PROP_VERSION_TYPE, isMajor ? VersionType.MAJOR : VersionType.MINOR);

    if (version.getVersionComment() != null) {
        versionProperties.put(Version.PROP_DESCRIPTION, version.getVersionComment());
    }

    if (dryRun) {
        if (info(log))
            info(log, "[DRY RUN] Would have created " + (isMajor ? "major" : "minor") + " version of node '"
                    + String.valueOf(nodeRef) + "'.");
    } else {
        // Only create versions if we have to - this is an exceptionally expensive operation in Alfresco
        if (onlyOneVersion) {
            if (trace(log))
                trace(log, "Skipping creation of a version for node '" + String.valueOf(nodeRef)
                        + "' as it only has one version.");
        } else {
            if (trace(log))
                trace(log, "Creating " + (isMajor ? "major" : "minor") + " version of node '"
                        + String.valueOf(nodeRef) + "'.");
            versionService.createVersion(nodeRef, versionProperties);
        }
    }
}

From source file:uk.ac.leeds.ccg.andyt.projects.moses.process.Comparison.java

public void compareCASUV003WithCAS001() throws Exception {
    File infile;/*  w ww  .  j  a v a2  s .  c om*/
    infile = new File("C:/Work/Projects/MoSeS/Workspace/UV003.dat");
    CASUV003DataHandler cASUV003DataHandler = new CASUV003DataHandler(infile);
    infile = new File("C:/Work/Projects/MoSeS/Workspace/CAS001.dat");
    CAS001DataHandler tCAS001DataHandler = new CAS001DataHandler(infile);

    CASUV003DataRecord aCASUV003DataRecord;
    CAS001DataRecord aCAS001DataRecord;
    long difference;
    long maxDifference = Long.MIN_VALUE;
    long sumOfSquaredDifference = 0L;
    long totalDifference = 0L;
    long absoluteDifference = 0L;
    long totalAbsoluteDifference = 0L;
    long RecordID;
    long nRecords = cASUV003DataHandler.getNDataRecords();
    for (RecordID = 0; RecordID < nRecords; RecordID++) {
        aCASUV003DataRecord = cASUV003DataHandler.getCASUV003DataRecord(RecordID);
        aCAS001DataRecord = tCAS001DataHandler.getCAS001DataRecord(RecordID);
        difference = (long) (aCASUV003DataRecord.getAllPeople() - aCAS001DataRecord.getAllPeople());
        if (difference < 0) {
            absoluteDifference = difference * -1L;
        }
        sumOfSquaredDifference += (difference * difference);
        maxDifference = Math.max(maxDifference, difference);
        totalDifference += difference;
        totalAbsoluteDifference += absoluteDifference;
    }
    int scale = 100;
    int roundingMode = BigDecimal.ROUND_HALF_EVEN;
    BigDecimal nRecordsBigDecimal = new BigDecimal(nRecords);
    BigDecimal meanDifferenceBigDecimal = new BigDecimal(maxDifference).divide(nRecordsBigDecimal, scale,
            roundingMode);
    System.out.println("nRecords " + nRecords);
    System.out.println("meanDifferenceBigDecimal " + meanDifferenceBigDecimal.toString());
    System.out.println("sumOfSquaredDifference " + sumOfSquaredDifference);
    System.out.println("maxDifference " + maxDifference);
    System.out.println("totalAbsoluteDifference " + totalAbsoluteDifference);
    System.out.println("totalDifference " + totalDifference);
    BigDecimal standardDeviationOfDifferenceBigDecimal = new BigDecimal("0");
    BigDecimal differenceBigDecimal;
    for (RecordID = 0; RecordID < nRecords; RecordID++) {
        aCASUV003DataRecord = cASUV003DataHandler.getCASUV003DataRecord(RecordID);
        aCAS001DataRecord = tCAS001DataHandler.getCAS001DataRecord(RecordID);
        differenceBigDecimal = new BigDecimal(
                aCASUV003DataRecord.getAllPeople() - aCAS001DataRecord.getAllPeople());
        standardDeviationOfDifferenceBigDecimal = differenceBigDecimal.multiply(differenceBigDecimal);
    }
    standardDeviationOfDifferenceBigDecimal = standardDeviationOfDifferenceBigDecimal
            .divide(nRecordsBigDecimal.subtract(BigDecimal.ONE), scale, roundingMode);
    standardDeviationOfDifferenceBigDecimal = Generic_BigDecimal.sqrt(standardDeviationOfDifferenceBigDecimal,
            scale, RoundingMode.HALF_EVEN);
    System.out.println("standardDeviationOfDifferenceBigDecimal " + standardDeviationOfDifferenceBigDecimal);
}

From source file:org.apache.olingo.server.core.serializer.json.EdmAssistedJsonSerializerTest.java

@Test(expected = SerializerException.class)
public void wrongValueForPropertyFacetInComplexProperty() throws Exception {
    ComplexValue innerComplexValue = new ComplexValue();
    innerComplexValue.getValue().add(//  w  w  w  .j a va 2  s.  c  o  m
            new Property(null, "PropertyDecimal", ValueType.PRIMITIVE, BigDecimal.ONE.scaleByPowerOfTen(-6)));
    ComplexValue complexValue = new ComplexValue();
    complexValue.getValue().add(new Property(null, "PropertyComp", ValueType.COMPLEX, innerComplexValue));
    EntityCollection entityCollection = new EntityCollection();
    entityCollection.getEntities().add(new Entity().addProperty(new Property(null, "CollPropertyComp",
            ValueType.COLLECTION_COMPLEX, Collections.singletonList(complexValue))));
    serializer.entityCollection(metadata, entityContainer.getEntitySet("ESKeyNav").getEntityType(),
            entityCollection, null);
}

From source file:com.heliumv.api.inventory.InventoryApi.java

private boolean updateInventurliste(ArtikelDto itemDto, BigDecimal newAmount, Boolean changeAmountTo,
        InventurlisteDto workListeDto) throws NamingException, RemoteException {
    if (!changeAmountTo) {
        BigDecimal oldAmount = workListeDto.getNInventurmenge();
        newAmount = oldAmount.add(newAmount);
    }//  ww  w . j a va2s .  com

    if (newAmount.signum() < 0) {
        respondBadRequest("amount", "<0");
        return false;
    }

    if (newAmount.signum() == 0) {
        inventurCall.removeInventurListe(workListeDto);
    } else {
        if (itemDto.isSeriennrtragend() && newAmount.compareTo(BigDecimal.ONE) > 0) {
            respondBadRequest("serialnr", "amount has to be 1");
            return false;
        }

        workListeDto.setNInventurmenge(newAmount);
        inventurCall.updateInventurliste(workListeDto, false);
    }

    return true;
}

From source file:pe.gob.mef.gescon.hibernate.impl.PreguntaDaoImpl.java

@Override
public List<HashMap> getConcimientosDisponibles(HashMap filters) {
    String ntipoconocimientoid = ((BigDecimal) filters.get("ntipoconocimientoid")).toString();
    String nconocimientovinc = (String) filters.get("nconocimientovinc");
    final StringBuilder sql = new StringBuilder();
    Object object = null;/*from   w  ww .  j a v a  2 s.  c  om*/
    try {
        if (StringUtils.isNotBlank(ntipoconocimientoid) && ntipoconocimientoid.equals("1")) {
            sql.append("SELECT ");
            sql.append(
                    "    a.nbaselegalid AS ID, a.vnumero AS NUMERO, a.vnombre AS NOMBRE, a.vsumilla AS SUMILLA, ");
            sql.append(
                    "    a.ncategoriaid AS IDCATEGORIA, b.vnombre AS CATEGORIA, a.dfechapublicacion AS FECHA, ");
            sql.append(
                    "    1 AS IDTIPOCONOCIMIENTO, 'Base Legal' AS TIPOCONOCIMIENTO, a.nestadoid AS IDESTADO, c.vnombre AS ESTADO ");
            sql.append("FROM TBASELEGAL a ");
            sql.append("    INNER JOIN MTCATEGORIA b ON a.ncategoriaid = b.ncategoriaid ");
            sql.append("    INNER JOIN MTESTADO_BASELEGAL c ON a.nestadoid = c.nestadoid ");
            sql.append("WHERE a.nactivo = :ACTIVO ");
            sql.append("AND a.nestadoid IN (3,5,6) "); // Publicada, Concordada y Modificada.
            if (StringUtils.isNotBlank(nconocimientovinc)) {
                sql.append("AND a.nbaselegalid NOT IN (").append(nconocimientovinc).append(") ");
            }
        }
        if (StringUtils.isNotBlank(ntipoconocimientoid) && ntipoconocimientoid.equals("2")) {
            sql.append("SELECT ");
            sql.append("    a.npreguntaid AS ID, '' AS NUMERO, a.vasunto AS NOMBRE, a.vdetalle AS SUMILLA, ");
            sql.append(
                    "    a.ncategoriaid AS IDCATEGORIA, b.vnombre AS CATEGORIA, a.dfechacreacion AS FECHA, ");
            sql.append("    2 AS IDTIPOCONOCIMIENTO, 'Preguntas y Respuestas' AS TIPOCONOCIMIENTO, ");
            sql.append("    a.nsituacionid AS IDESTADO, c.vnombre AS ESTADO ");
            sql.append("FROM TPREGUNTA a ");
            sql.append("    INNER JOIN MTCATEGORIA b ON a.ncategoriaid = b.ncategoriaid ");
            sql.append("    INNER JOIN MTSITUACION c ON a.nsituacionid = c.nsituacionid ");
            sql.append("WHERE a.nactivo = :ACTIVO ");
            sql.append("AND a.nsituacionid = 6 "); // Publicado
            if (StringUtils.isNotBlank(nconocimientovinc)) {
                sql.append("AND a.npreguntaid NOT IN (").append(nconocimientovinc).append(") ");
            }
        }
        if (StringUtils.isNotBlank(ntipoconocimientoid)
                && (ntipoconocimientoid.equals("3") || ntipoconocimientoid.equals("4")
                        || ntipoconocimientoid.equals("5") || ntipoconocimientoid.equals("6"))) {
            sql.append("SELECT ");
            sql.append(
                    "    a.nconocimientoid AS ID, '' AS NUMERO, a.vtitulo AS NOMBRE, a.vdescripcion AS SUMILLA, ");
            sql.append(
                    "    a.ncategoriaid AS IDCATEGORIA, b.vnombre AS CATEGORIA, a.dfechacreacion AS FECHA, ");
            sql.append("    a.ntpoconocimientoid AS IDTIPOCONOCIMIENTO, d.vnombre AS TIPOCONOCIMIENTO, ");
            sql.append("    a.nsituacionid AS IDESTADO, c.vnombre AS ESTADO ");
            sql.append("FROM TCONOCIMIENTO a ");
            sql.append("    INNER JOIN MTCATEGORIA b ON a.ncategoriaid = b.ncategoriaid ");
            sql.append("    INNER JOIN MTSITUACION c ON a.nsituacionid = c.nsituacionid ");
            sql.append("    INNER JOIN MTTIPO_CONOCIMIENTO d ON a.ntpoconocimientoid = d.ntpoconocimientoid ");
            sql.append("WHERE a.nactivo = :ACTIVO ");
            sql.append("AND a.nsituacionid = 6 AND a.NTPOCONOCIMIENTOID= ").append(ntipoconocimientoid)
                    .append(" "); // Publicado
            if (StringUtils.isNotBlank(nconocimientovinc)) {
                sql.append(" AND a.nconocimientoid NOT IN (").append(nconocimientovinc).append(") ");
            }
        }
        sql.append("ORDER BY 5, 7 DESC ");

        object = getHibernateTemplate().execute(new HibernateCallback() {
            @Override
            public Object doInHibernate(Session session) throws HibernateException {
                Query query = session.createSQLQuery(sql.toString());
                query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP);
                if (StringUtils.isNotBlank(sql.toString())) {
                    query.setParameter("ACTIVO", BigDecimal.ONE);
                }
                return query.list();
            }
        });
    } catch (DataAccessException e) {
        e.getMessage();
        e.printStackTrace();
    }
    return (List<HashMap>) object;
}

From source file:org.yes.cart.web.support.service.impl.ProductServiceFacadeImplTest.java

@Test
public void testGetSkuPriceSearchAndProductDetailsEmptyPriceWithTaxInfoGross() throws Exception {

    final PriceService priceService = context.mock(PriceService.class, "priceService");
    final PricingPolicyProvider pricingPolicyProvider = context.mock(PricingPolicyProvider.class,
            "pricingPolicyProvider");
    final ShopService shopService = context.mock(ShopService.class, "shopService");

    final ShoppingCart cart = context.mock(ShoppingCart.class, "cart");
    final ShoppingContext cartCtx = context.mock(ShoppingContext.class, "cartCtx");
    final PricingPolicyProvider.PricingPolicy policy = context.mock(PricingPolicyProvider.PricingPolicy.class,
            "policy");

    final SkuPrice skuPrice = context.mock(SkuPrice.class, "skuPrice");

    final Shop shop = context.mock(Shop.class, "shop");

    context.checking(new Expectations() {
        {/*www .ja  v a 2 s.  c o m*/
            allowing(cart).getShoppingContext();
            will(returnValue(cartCtx));
            allowing(cartCtx).getShopId();
            will(returnValue(234L));
            allowing(cartCtx).getCustomerShopId();
            will(returnValue(234L));
            allowing(cartCtx).getShopCode();
            will(returnValue("SHOP10"));
            allowing(cartCtx).getCountryCode();
            will(returnValue("GB"));
            allowing(cartCtx).getStateCode();
            will(returnValue("GB-LON"));
            allowing(cart).getCustomerEmail();
            will(returnValue("bob@doe.com"));
            allowing(cart).getCurrencyCode();
            will(returnValue("EUR"));
            allowing(pricingPolicyProvider).determinePricingPolicy("SHOP10", "EUR", "bob@doe.com", "GB",
                    "GB-LON");
            will(returnValue(policy));
            allowing(policy).getID();
            will(returnValue("P1"));
            allowing(priceService).getMinimalPrice(123L, "ABC", 234L, null, "EUR", BigDecimal.ONE, false, "P1");
            will(returnValue(skuPrice));
            allowing(skuPrice).getSkuCode();
            will(returnValue(null));
            allowing(skuPrice).getQuantity();
            will(returnValue(null));
            allowing(skuPrice).getRegularPrice();
            will(returnValue(null));
            allowing(skuPrice).getSalePriceForCalculation();
            will(returnValue(null));
            allowing(shopService).getById(234L);
            will(returnValue(shop));
            allowing(cartCtx).isTaxInfoEnabled();
            will(returnValue(true));
            allowing(cartCtx).isTaxInfoUseNet();
            will(returnValue(false));
            allowing(cartCtx).isTaxInfoShowAmount();
            will(returnValue(true));
        }
    });

    final ProductServiceFacade facade = new ProductServiceFacadeImpl(null, null, null, null, null, null,
            pricingPolicyProvider, priceService, null, null, null, shopService, null);

    final ProductPriceModel model = facade.getSkuPrice(cart, 123L, "ABC", BigDecimal.ONE);

    assertNotNull(model);

    assertNull(model.getRef());

    assertEquals("EUR", model.getCurrency());
    assertNull(model.getQuantity());

    assertNull(model.getRegularPrice());
    assertNull(model.getSalePrice());

    assertFalse(model.isTaxInfoEnabled());
    assertFalse(model.isTaxInfoUseNet());
    assertFalse(model.isTaxInfoShowAmount());

    assertNull(model.getPriceTaxCode());
    assertNull(model.getPriceTaxRate());
    assertFalse(model.isPriceTaxExclusive());
    assertNull(model.getPriceTax());

    context.assertIsSatisfied();

}