List of usage examples for java.math BigDecimal TEN
BigDecimal TEN
To view the source code for java.math BigDecimal TEN.
Click Source Link
From source file:cz.cas.lib.proarc.common.workflow.FilterFindParameterQueryTest.java
@Test public void testFilter() { String taskProfileName = "task.id1"; TaskParameterView dbParam2 = new TaskParameterView(); dbParam2.setJobId(BigDecimal.ZERO); dbParam2.setParamRef("param.id2"); dbParam2.setTaskId(BigDecimal.TEN); dbParam2.setTaskProfileName(taskProfileName); dbParam2.addValueString("testVal"); List<TaskParameterView> params = Arrays.asList(dbParam2); TaskParameterFilter filter = new TaskParameterFilter(); filter.setTaskId(BigDecimal.TEN); filter.setLocale(Locale.ENGLISH); List<TaskParameterView> result = new FilterFindParameterQuery(wp).filter(params, filter, null, wp.getProfiles());//from w w w . j a va2 s. com assertEquals(2, result.size()); assertEquals("param.id1", result.get(0).getParamRef()); assertEquals(DisplayType.TEXT, result.get(0).getDisplayType()); assertEquals(taskProfileName, result.get(0).getTaskProfileName()); assertEquals(filter.getTaskId(), result.get(0).getTaskId()); assertEquals("param.id2", result.get(1).getParamRef()); assertEquals("testVal", result.get(1).getValue()); assertEquals(DisplayType.TEXT, result.get(1).getDisplayType()); assertEquals(taskProfileName, result.get(1).getTaskProfileName()); assertEquals(filter.getTaskId(), result.get(1).getTaskId()); }
From source file:org.killbill.billing.plugin.adyen.dao.TestAdyenDao.java
@Test(groups = "slow") public void testInsertPaymentResult() throws SQLException, IOException { final PurchaseResult purchaseResult = new PurchaseResult(PaymentServiceProviderResult.AUTHORISED, UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableMap.<String, String>of(UUID.randomUUID().toString(), UUID.randomUUID().toString(), AdyenPaymentPluginApi.PROPERTY_DCC_AMOUNT_VALUE, "10", AdyenPaymentPluginApi.PROPERTY_DCC_AMOUNT_CURRENCY, "EUR")); final UUID kbAccountId = UUID.randomUUID(); final UUID kbPaymentId = UUID.randomUUID(); final UUID kbPaymentTransactionId = UUID.randomUUID(); final TransactionType transactionType = TransactionType.AUTHORIZE; final BigDecimal amount = BigDecimal.TEN; final Currency currency = Currency.EUR; final DateTime dateTime = new DateTime(DateTimeZone.UTC); final UUID kbTenantId = UUID.randomUUID(); dao.addResponse(kbAccountId, kbPaymentId, kbPaymentTransactionId, transactionType, amount, currency, purchaseResult, dateTime, kbTenantId); final List<AdyenResponsesRecord> result = dao.getResponses(kbPaymentId, kbTenantId); Assert.assertEquals(result.size(), 1); final AdyenResponsesRecord record = result.get(0); Assert.assertNotNull(record.getRecordId()); Assert.assertEquals(record.getKbAccountId(), kbAccountId.toString()); Assert.assertEquals(record.getKbPaymentId(), kbPaymentId.toString()); Assert.assertEquals(record.getKbPaymentTransactionId(), kbPaymentTransactionId.toString()); Assert.assertEquals(record.getTransactionType(), transactionType.toString()); Assert.assertEquals(record.getAmount().compareTo(amount), 0); Assert.assertEquals(record.getCurrency(), currency.toString()); Assert.assertEquals(new DateTime(record.getCreatedDate(), DateTimeZone.UTC) .compareTo(DefaultClock.truncateMs(dateTime)), 0); Assert.assertEquals(record.getKbTenantId(), kbTenantId.toString()); Assert.assertEquals(record.getDccAmount().compareTo(BigDecimal.TEN), 0); Assert.assertEquals(record.getDccCurrency(), "EUR"); Assert.assertEquals(objectMapper.readValue(record.getAdditionalData(), Map.class), purchaseResult.getFormParameter()); }
From source file:com.seyren.core.service.notification.BigPandaNotificationServiceTest.java
@Test public void checkingOutTheHappyPath() { String seyrenUrl = clientDriver.getBaseUrl() + "/seyren"; when(mockSeyrenConfig.getGraphiteUrl()).thenReturn(clientDriver.getBaseUrl() + "/graphite"); when(mockSeyrenConfig.getBaseUrl()).thenReturn(seyrenUrl); when(mockSeyrenConfig.getBigPandaNotificationUrl()) .thenReturn(clientDriver.getBaseUrl() + "/bigpanda/test"); when(mockSeyrenConfig.getBigPandaAuthBearer()).thenReturn("test-auth-bearer"); Check check = new Check().withEnabled(true).withName("check-name").withDescription("Testing Description") .withTarget("the.target.name").withState(AlertType.ERROR).withWarn(BigDecimal.ONE) .withError(BigDecimal.TEN).withId("testing"); Subscription subscription = new Subscription().withType(SubscriptionType.BIGPANDA) .withTarget("testing_app_key"); DateTime timestamp = new DateTime(1420070400000L); Alert alert = new Alert().withTarget("the.target.name").withValue(BigDecimal.valueOf(12)) .withWarn(BigDecimal.valueOf(5)).withError(BigDecimal.valueOf(10)).withFromType(AlertType.WARN) .withToType(AlertType.ERROR).withTimestamp(timestamp); List<Alert> alerts = Arrays.asList(alert); BodyCapture<JsonNode> bodyCapture = new JsonBodyCapture(); clientDriver.addExpectation(/*from w w w .jav a2s. c om*/ onRequestTo("/bigpanda/test").withMethod(Method.POST).capturingBodyIn(bodyCapture), giveResponse("success", "text/plain")); service.sendNotification(check, subscription, alerts); JsonNode node = bodyCapture.getContent(); assertThat(node, hasJsonPath("$.seyrenCheckUrl", is(seyrenUrl + "/#/checks/" + check.getId()))); assertThat(node, hasJsonPath("$.app_key", is("testing_app_key"))); assertThat(node, hasJsonPath("$.check", is("the.target.name"))); assertThat(node, hasJsonPath("$.status", is("critical"))); assertThat(node, hasJsonPath("$.service", is("check-name"))); assertThat(node, hasJsonPath("$.description", is("Testing Description"))); assertThat(node, hasJsonPath("$.timestamp", is(1420070400L))); assertThat(node, hasJsonPath("$.currentValue", is(12))); assertThat(node, hasJsonPath("$.thresholdWarning", is(5))); assertThat(node, hasJsonPath("$.thresholdCritical", is(10))); assertThat(node, hasJsonPath("$.previewGraph", containsString("the.target.name"))); assertThat(node, hasJsonPath("$.previewGraph", containsString("/graphite"))); }
From source file:br.edu.ifrn.conta.servico.LancamentoServicoIT.java
@Test public void transferenciaDePapaiParaMamae() { this.lancamentoServico.transferir(BigDecimal.TEN, this.donoFabrica.papai(), this.contaDebitoFabrica.despesaComConjuge(), this.contaPatrimonioFabrica.poupanca(), this.donoFabrica.mamae(), this.contaPatrimonioFabrica.poupanca(), this.contaCreditoFabrica.receitaComConjuge()); }
From source file:cz.muni.fi.pa165.legomanager.dao.LegoKitDaoImplTest.java
@Test(expected = DataAccessException.class) public void addLegoCategoriesNullTest() { LegoKit legoKit = createLegoKit("StarWars Death Star", BigDecimal.TEN, 12, null, new ArrayList<LegoPiece>(), new ArrayList<LegoSet>()); legoKitDao.addLegoKit(legoKit);//from w ww. ja v a 2 s . c o m }
From source file:org.fineract.module.stellar.TestCreateTrustLine.java
@Test public void createTrustLineTrusteeDoesntExist() { final TrustLineConfiguration trustLine = new TrustLineConfiguration(BigDecimal.TEN); String issuer = ""; try {/* w w w .j ava 2 s .c o m*/ issuer = URLEncoder.encode("blah*test.org", "UTF-8"); } catch (UnsupportedEncodingException e) { Assert.fail(); } given().header(StellarBridgeTestHelpers.CONTENT_TYPE_HEADER) .header(StellarBridgeTestHelpers.API_KEY_HEADER_LABEL, firstTenantApiKey) .header(StellarBridgeTestHelpers.TENANT_ID_HEADER_LABEL, firstTenantId) .pathParameter("assetCode", ASSET_CODE).pathParameter("issuer", issuer).body(trustLine) .put("/modules/stellarbridge/trustlines/{assetCode}/{issuer}/").then().assertThat() .statusCode(HttpStatus.NOT_FOUND.value()); }
From source file:com.devnexus.ting.core.service.impl.PrepareMailToRegisterTransforerTests.java
private RegistrationDetails getRegistrationDetails() { final RegistrationDetails registrationDetails = new RegistrationDetails(); registrationDetails.setContactEmailAddress("cartman@ajug.org"); registrationDetails.setContactName("Cartman"); registrationDetails.setContactPhoneNumber("555-555-5555"); registrationDetails.setEvent(new Event(123L)); registrationDetails.setFinalCost(BigDecimal.TEN); registrationDetails.setInvoice("Invoice"); List<TicketOrderDetail> ticketOrderDetails = new ArrayList<>(); TicketOrderDetail ticketOrderDetail = new TicketOrderDetail(); ticketOrderDetail.setCity("Kailua-Kona"); ticketOrderDetail.setCompany("Pivotal"); ticketOrderDetail.setCountry("USA"); ticketOrderDetail.setCouponCode("NONE"); ticketOrderDetail.setEmailAddress("kenny@ajug.org"); ticketOrderDetail.setFirstName("Stan"); ticketOrderDetail.setJobTitle("Hero"); ticketOrderDetail.setLastName("Butters"); ticketOrderDetail.setRegistration(registrationDetails); ticketOrderDetail.setState("HI"); ticketOrderDetail.settShirtSize("M"); ticketOrderDetails.add(ticketOrderDetail); registrationDetails.setOrderDetails(ticketOrderDetails); registrationDetails.setPaymentState(PaymentState.PAID); return registrationDetails; }
From source file:org.apache.sling.jcr.resource.internal.JcrPropertyMapTest.java
public void testTypeByClass() throws Exception { this.rootNode.getSession().refresh(false); testValue(rootNode, "A String Value", String.class); testValue(rootNode, 1l, Byte.class); testValue(rootNode, 1l, Short.class); testValue(rootNode, 1l, Integer.class); testValue(rootNode, 1l, Long.class); testValue(rootNode, 1.0d, Float.class); testValue(rootNode, 1.0d, Double.class); testValue(rootNode, 1.0d, BigDecimal.class); Calendar cal = Calendar.getInstance(); testValue(rootNode, cal, Calendar.class); testValue(rootNode, cal, Date.class); testValue(rootNode, cal, Long.class); testValue(rootNode, BigDecimal.TEN, BigDecimal.class); }
From source file:com.samples.platform.client.test.ClientTest.java
/** Run the test. */ private void run() { this.logger.info("+run"); this.logger.info(" run Get client bean"); try {// ww w .ja v a2s.c om ObjectMapper json = new ObjectMapper(); json.enable(SerializationFeature.INDENT_OUTPUT); LibraryServiceClientExtension libraryClient = this.applicationContext .getBean(LibraryServiceClientExtension.class); IssTechSupportServiceClientExtension issTechSupportClient = this.applicationContext .getBean(IssTechSupportServiceClientExtension.class); String userName = "userName"; String ISBN = UUIDGenerator.getUUID(); this.logger.info(" run Call bus to create a book"); BookType book = new BookType(); book.setISBN(ISBN); book.setCategory("Category"); book.setLanguage("Language"); book.setPrice(BigDecimal.TEN); book.setTitle("Title " + ISBN); book.setUUID(UUIDGenerator.getUUID()); CreateBookResponseType createBookResponse = libraryClient.createBook(userName, book); if (createBookResponse != null) { for (BookType bt : createBookResponse.getBook()) { this.logger.info(" run created book ISBN=", bt.getISBN()); this.logger.info(" run Book: {}", json.writeValueAsString(bt)); } } else { this.logger.error(" run create book returned null response."); } this.logger.info(" run Call bus to get the created book"); BookCriteriaType criteria = new BookCriteriaType(); criteria.setISBN(ISBN); GetBookRequestType getBookRequest = libraryClient.createGetBookRequestType(); getBookRequest.setCriteria(criteria); GetBookResponseType getBookResponse = libraryClient.getBook(getBookRequest); if (getBookResponse != null) { for (BookType bt : getBookResponse.getBook()) { this.logger.info(" run got book for ISBN {}: {}", ISBN, json.writeValueAsString(bt)); } } else { this.logger.error(" run get book returned null response."); } GetAggregatedReferenceDataResponseType aggregatedReferenceData = issTechSupportClient .getAggregatedReferenceData(userName); if (aggregatedReferenceData != null) { if (aggregatedReferenceData.getReferenceData().size() == 2) { this.logger.info(" run got aggregated ReferenceData list size 2."); } else { this.logger.error(" run get aggregated reference data returned list size of {}!", aggregatedReferenceData.getReferenceData().size()); } } else { this.logger.error(" run get aggregated reference data returned null response."); } GetForwardedReferenceDataResponseType forwardedReferenceData = issTechSupportClient .getForwardedReferenceData(userName); if (forwardedReferenceData != null) { if (forwardedReferenceData.getReferenceData().size() == 1) { this.logger.info(" run got forwarded ReferenceData list size 1."); } else { this.logger.error(" run get forwarded reference data returned list size of {}!", forwardedReferenceData.getReferenceData().size()); } } else { this.logger.error(" run get forwarded reference data returned null response."); } GetSystemUserReportResponseType systemUserReport = issTechSupportClient.getSystemUserReport(userName, new Date()); if (systemUserReport != null) { for (SystemUserReportType report : systemUserReport.getReport()) { this.logger.info(" run system user report: {}", json.writeValueAsString(report)); } } else { this.logger.error(" run get system user report returned null response."); } } catch (Exception e) { this.logger.error(e.getMessage(), e); } this.logger.info("-run"); }
From source file:cz.muni.fi.pa165.legomanager.dao.LegoKitDaoImplTest.java
@Test(expected = DataAccessException.class) public void addLegoPiecesNullTest() { LegoKit legoKit = createLegoKit("StarWars Death Star", BigDecimal.TEN, 12, new HashSet<Category>(), null, new ArrayList<LegoSet>()); legoKitDao.addLegoKit(legoKit);// www. j av a2 s . co m }