use of name.abuchen.portfolio.datatransfer.pdf.UnicreditPDFExtractor in project portfolio by buchen.
the class UnicreditPDFExtractorTest method testWertpapierKauf1.
@Test
public void testWertpapierKauf1() throws IOException {
UnicreditPDFExtractor extractor = new UnicreditPDFExtractor(new Client());
List<Exception> errors = new ArrayList<Exception>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "UniCreditHypoVereinsbankWertpapierKauf1.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
new AssertImportActions().check(results, CurrencyUnit.EUR);
Optional<Item> item;
// get security
item = results.stream().filter(i -> i instanceof SecurityItem).findFirst();
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
// assert security
assertThat(security.getIsin(), is("FR0000120578"));
assertThat(security.getWkn(), is("920657"));
assertThat(security.getName(), is("SANOFI S.A."));
assertThat(security.getCurrencyCode(), is(CurrencyUnit.EUR));
// get transaction
item = results.stream().filter(i -> i instanceof BuySellEntryItem).findFirst();
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(BuySellEntry.class));
BuySellEntry entry = (BuySellEntry) item.get().getSubject();
// assert transaction
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getAmount(), is(Values.Amount.factorize(1560.83)));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2016-02-17T00:00")));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(13.57))));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(22)));
}
use of name.abuchen.portfolio.datatransfer.pdf.UnicreditPDFExtractor in project portfolio by buchen.
the class ImportExtractedItemsWizard method addDefaultExtractors.
private void addDefaultExtractors() throws IOException {
extractors.add(new BaaderBankPDFExtractor(client));
extractors.add(new BankSLMPDFExtractor(client));
extractors.add(new ComdirectPDFExtractor(client));
extractors.add(new CommerzbankPDFExtractor(client));
extractors.add(new ConsorsbankPDFExtractor(client));
extractors.add(new DABPDFExtractor(client));
extractors.add(new DegiroPDFExtractor(client));
extractors.add(new DeutscheBankPDFExtractor(client));
extractors.add(new DkbPDFExtractor(client));
extractors.add(new FinTechGroupBankPDFExtractor(client));
extractors.add(new INGDiBaExtractor(client));
extractors.add(new OnvistaPDFExtractor(client));
extractors.add(new SBrokerPDFExtractor(client));
extractors.add(new UnicreditPDFExtractor(client));
extractors.add(new HelloBankPDFExtractor(client));
Collections.sort(extractors, (r, l) -> r.getLabel().compareToIgnoreCase(l.getLabel()));
}
Aggregations