Examples of AccountList


Examples of com.wesabe.api.accounts.entities.AccountList

    @Test
    public void itReturnsTxactionsExcludingTheOffsetOnes() {
      assertEquals(Lists.newArrayList(interestEarned, starbucks), new TxactionListBuilder()
                        .setLimit(2)
                        .setAccounts(new AccountList(checking, savings))
                        .setCurrency(USD)
                        .setCurrencyExchangeRateMap(exchangeRates)
                        .build(txactions)
                        .getTxactions());
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

   
    @Test
    public void itIncludesTheLimitedTransactionsInTheTotalCount() throws Exception {
      final TxactionList list = new TxactionListBuilder()
                      .setOffset(1)
                      .setAccounts(new AccountList(checking, savings))
                      .setCurrency(USD)
                      .setCurrencyExchangeRateMap(exchangeRates)
                      .build(txactions);
      assertEquals(3, list.getTotalCount());
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

    public void setup() throws Exception {
      this.context = new MockResourceContext();
     
      this.account = mock(Account.class);
      when(account.getRelativeId()).thenReturn(1);
      this.accounts = new AccountList(account);
      when(context.getAccountDAO().findVisibleAccounts(Mockito.anyString())).thenReturn(accounts);
     
      this.txaction = mock(Txaction.class);
      this.filteredTxaction = mock(Txaction.class);
      this.txactions = ImmutableList.of(txaction, filteredTxaction);
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

    public void itPresentsTheAccountList() throws Exception {
      final XmlsonObject representation = resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, includeArchived);
     
      assertThat(representation, is(sameInstance(xmlson)));
     
      verify(context.getAccountListPresenter()).present(new AccountList(accounts), USD, Locale.CANADA_FRENCH);
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

      savings.setRelativeId(1);
     
      this.weirdOne = new Account("Brian Has Insane Accounts", USD);
      weirdOne.setRelativeId(400);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings, weirdOne));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/400"));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

   
    @Test
    public void itLimitsTheTransactionListToThoseAccounts() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setAccounts(new AccountList(checking, weirdOne));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

      checking.setRelativeId(2);
     
      this.savings = new Account("Savings", USD);
      savings.setRelativeId(1);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/woof"), new UriParam("/accouFFFnts/2"));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

   
    @Test
    public void itIgnoresMalformedAccountURIs() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setAccounts(new AccountList(checking));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

     
      this.filteredTags = mock(Set.class);
     
      this.account = mock(Account.class);
      when(account.getRelativeId()).thenReturn(1);
      this.accounts = new AccountList(account);
      when(context.getAccountDAO().findVisibleAccounts(Mockito.anyString())).thenReturn(accounts);

      this.txaction = mock(Txaction.class);
      this.filteredTxaction = mock(Txaction.class);
      when(context.getTxactionDAO().findTxactionsInDateRange(Mockito.anyCollection(), Mockito.any(Interval.class))).thenReturn(ImmutableList.of(txaction, filteredTxaction));
View Full Code Here

Examples of com.wesabe.api.accounts.entities.AccountList

  public XmlsonObject show(@Context WesabeUser user,
      @Context Locale locale,
      @PathParam("currency") CurrencyParam currency,
      @QueryParam("include_archived") @DefaultValue("false") BooleanParam includeArchived) {
   
    final AccountList accounts = new AccountList(accountDAO.findAllAccountsByAccountKey(
      user.getAccountKey(),
      getStatuses(includeArchived.getValue())
    ));
   
    return presenter.present(accounts, currency.getValue(), locale);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.