Search in sources :

Example 1 with ImportAction

use of name.abuchen.portfolio.datatransfer.ImportAction in project portfolio by buchen.

the class AssertImportActions method check.

public void check(List<Extractor.Item> items, ImportAction.Context context) {
    for (Extractor.Item item : items) {
        for (ImportAction action : actions) {
            ImportAction.Status status = item.apply(action, context);
            assertThat(status.getMessage(), status.getCode(), is(ImportAction.Status.Code.OK));
        }
    }
}
Also used : ImportAction(name.abuchen.portfolio.datatransfer.ImportAction) Extractor(name.abuchen.portfolio.datatransfer.Extractor)

Example 2 with ImportAction

use of name.abuchen.portfolio.datatransfer.ImportAction in project portfolio by buchen.

the class ReviewExtractedItemsPage method checkEntries.

private void checkEntries(List<ExtractedEntry> entries) {
    List<ImportAction> actions = new ArrayList<>();
    actions.add(new CheckValidTypesAction());
    actions.add(new DetectDuplicatesAction());
    actions.add(new CheckCurrenciesAction());
    for (ExtractedEntry entry : entries) {
        entry.clearStatus();
        for (ImportAction action : actions) entry.addStatus(entry.getItem().apply(action, this));
    }
}
Also used : CheckValidTypesAction(name.abuchen.portfolio.datatransfer.actions.CheckValidTypesAction) DetectDuplicatesAction(name.abuchen.portfolio.datatransfer.actions.DetectDuplicatesAction) ImportAction(name.abuchen.portfolio.datatransfer.ImportAction) ArrayList(java.util.ArrayList) CheckCurrenciesAction(name.abuchen.portfolio.datatransfer.actions.CheckCurrenciesAction)

Aggregations

ImportAction (name.abuchen.portfolio.datatransfer.ImportAction)2 ArrayList (java.util.ArrayList)1 Extractor (name.abuchen.portfolio.datatransfer.Extractor)1 CheckCurrenciesAction (name.abuchen.portfolio.datatransfer.actions.CheckCurrenciesAction)1 CheckValidTypesAction (name.abuchen.portfolio.datatransfer.actions.CheckValidTypesAction)1 DetectDuplicatesAction (name.abuchen.portfolio.datatransfer.actions.DetectDuplicatesAction)1