use of name.abuchen.portfolio.datatransfer.pdf.BankSLMPDFExtractor in project portfolio by buchen.
the class BankSLMPDFExtractorTest method testKauf_Inland1.
@Test
public void testKauf_Inland1() throws IOException {
BankSLMPDFExtractor extractor = new BankSLMPDFExtractor(new Client());
List<Exception> errors = new ArrayList<>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "BankSLM_Kauf_Inland1.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
new AssertImportActions().check(results, "CHF");
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getWkn(), is("135186"));
assertThat(security.getName(), is("Bank SLM AG"));
// check buy sell transaction
Optional<Item> 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();
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.BUY));
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getMonetaryAmount(), is(Money.of("CHF", Values.Amount.factorize(1481.10))));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2016-06-21T00:00")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(1)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of("CHF", 1_10L)));
}
use of name.abuchen.portfolio.datatransfer.pdf.BankSLMPDFExtractor in project portfolio by buchen.
the class BankSLMPDFExtractorTest method testKauf_Inland2.
@Test
public void testKauf_Inland2() throws IOException {
BankSLMPDFExtractor extractor = new BankSLMPDFExtractor(new Client());
List<Exception> errors = new ArrayList<>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "BankSLM_Kauf_Inland2.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
new AssertImportActions().check(results, "CHF");
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getWkn(), is("24476758"));
assertThat(security.getName(), is("UBS Group AG"));
// check buy sell transaction
Optional<Item> 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();
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.BUY));
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getMonetaryAmount(), is(Money.of("CHF", Values.Amount.factorize(43412.10))));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2016-02-10T00:00")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(3000)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of("CHF", 32_40L + 3_50 + 176_20)));
}
use of name.abuchen.portfolio.datatransfer.pdf.BankSLMPDFExtractor 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