use of name.abuchen.portfolio.datatransfer.Extractor.SecurityItem in project portfolio by buchen.
the class DkbPDFExtractorTest method assertSecurityErtragsgutschriftZinsgutschrift.
private Security assertSecurityErtragsgutschriftZinsgutschrift(List<Item> results) {
Optional<Item> item = results.stream().filter(i -> i instanceof SecurityItem).findFirst();
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
assertThat(security.getIsin(), is("DE000A1R1AN5"));
assertThat(security.getWkn(), is("A1R1AN"));
assertThat(security.getName(), is("PCC SE"));
return security;
}
use of name.abuchen.portfolio.datatransfer.Extractor.SecurityItem in project portfolio by buchen.
the class DkbPDFExtractorTest method assertSecurityRueckzahlung.
private Security assertSecurityRueckzahlung(List<Item> results) {
Optional<Item> item = results.stream().filter(i -> i instanceof SecurityItem).findFirst();
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
assertThat(security.getIsin(), is("XS0149161217"));
assertThat(security.getWkn(), is("858865"));
assertThat(security.getName(), is("2,309 % RBS CAPITAL TRUST A"));
return security;
}
use of name.abuchen.portfolio.datatransfer.Extractor.SecurityItem in project portfolio by buchen.
the class DkbPDFExtractorTest method assertSecurityBuyAktien.
private Security assertSecurityBuyAktien(List<Item> results) {
Optional<Item> item = results.stream().filter(i -> i instanceof SecurityItem).findFirst();
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
assertThat(security.getIsin(), is("BMG7945E1057"));
assertThat(security.getWkn(), is("A0ERZ0"));
assertThat(security.getName(), is("SEADRILL LTD."));
return security;
}
use of name.abuchen.portfolio.datatransfer.Extractor.SecurityItem in project portfolio by buchen.
the class DkbPDFExtractorTest method testInvestmentertraege.
@Test
public void testInvestmentertraege() throws IOException {
DkbPDFExtractor extractor = new DkbPDFExtractor(new Client());
List<Exception> errors = new ArrayList<>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "DkbInvestmentertraege.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
// check security
Optional<Item> item = results.stream().filter(i -> i instanceof SecurityItem).findFirst();
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
assertThat(security.getIsin(), is("IE00B6YX5D40"));
assertThat(security.getWkn(), is("A1JKS0"));
assertThat(security.getName(), is("SPDR S&P US DIVID.ARISTOCR.ETF"));
assertThat(security.getCurrencyCode(), is("USD"));
// check transaction
item = results.stream().filter(i -> i instanceof TransactionItem).findFirst();
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(AccountTransaction.class));
AccountTransaction transaction = (AccountTransaction) item.get().getSubject();
assertThat(transaction.getType(), is(AccountTransaction.Type.DIVIDENDS));
assertThat(transaction.getSecurity(), is(security));
assertThat(transaction.getCurrencyCode(), is(CurrencyUnit.EUR));
assertThat(transaction.getDateTime(), is(LocalDateTime.parse("2017-10-04T00:00")));
assertThat(transaction.getAmount(), is(Values.Amount.factorize(2.09)));
assertThat(transaction.getShares(), is(Values.Share.factorize(10.6841)));
assertThat(transaction.getUnitSum(Unit.Type.TAX), is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(0.39))));
}
use of name.abuchen.portfolio.datatransfer.Extractor.SecurityItem in project portfolio by buchen.
the class FinTechGroupBankPDFExtractorTest method assertFirstSecurity.
private Security assertFirstSecurity(Optional<Item> item) {
assertThat(item.isPresent(), is(true));
Security security = ((SecurityItem) item.get()).getSecurity();
assertThat(security.getIsin(), is("DE0005194062"));
assertThat(security.getWkn(), is("519406"));
assertThat(security.getName(), is("BAYWA AG VINK.NA. O.N."));
assertThat(security.getCurrencyCode(), is(CurrencyUnit.EUR));
return security;
}
Aggregations