Package com.wesabe.api.accounts.params

Examples of com.wesabe.api.accounts.params.IntegerParam


  public static class Parsing_A_Invalid_Integer {
   
    @Test
    public void itThrowsA400BadRequestWebApplicationException() throws Exception {
      try {
        new IntegerParam("X#H");
        fail("should have thrown a WebApplicationException but didn't");
      } catch (WebApplicationException e) {
        assertEquals(400, e.getResponse().getStatus());
        assertEquals("Invalid parameter: X#H (not a valid integer).", e.getResponse().getEntity());
      }
View Full Code Here


      expectAccountBalance(accountBalance);
    }
   
    @Test
    public void itPresentsTheAccount() {
      accountBalanceResource.show(user, Locale.ENGLISH, new IntegerParam("1"), new IntegerParam("1"));
      verify(accountBalancePresenter).present(accountBalance, Locale.ENGLISH);
    }
View Full Code Here

    }
   
    @Test
    public void itReturnsNotFound() {
      try {
        accountBalanceResource.show(user, Locale.ENGLISH, new IntegerParam("1"), new IntegerParam("1"));
        fail("expected a Not Found exception");
      } catch (WebApplicationException ex) {
        assertThat(ex.getResponse().getStatus()).isEqualTo(Status.NOT_FOUND.getStatusCode());
      }
    }
View Full Code Here

    }
   
    @Test
    public void itReturnsNotFound() {
      try {
        accountBalanceResource.show(user, Locale.ENGLISH, new IntegerParam("1"), new IntegerParam("1"));
      } catch (WebApplicationException ex) {
        assertThat(ex.getResponse().getStatus()).isEqualTo(Status.NOT_FOUND.getStatusCode());
      }
    }
View Full Code Here

    }
   
    @Test
    public void itReturnsNotFound() {
      try {
        accountBalanceResource.show(user, Locale.ENGLISH, new IntegerParam("1"), new IntegerParam("1"));
      } catch (WebApplicationException ex) {
        assertThat(ex.getResponse().getStatus()).isEqualTo(Status.NOT_FOUND.getStatusCode());
      }
    }
View Full Code Here

    }
   
    @Test
    public void itThrowsA404() {
      try {
        accountResource.show(user, Locale.ENGLISH, new IntegerParam("1"));
        fail("Expected 404 to be thrown, but nothing was thrown");
      } catch (WebApplicationException e) {
        assertThat(e.getResponse().getStatus()).isEqualTo(404);
      }
    }
View Full Code Here

      super.setup();
    }
   
    @Test
    public void itPresentsTheAccount() {
      accountResource.show(user, Locale.ENGLISH, new IntegerParam("1"));
      verify(accountPresenter).present(account, Locale.ENGLISH);
    }
View Full Code Here

      expectAccount(investmentAccount);
    }
   
    @Test
    public void itPresentsTheAccount() {
      accountResource.show(user, Locale.ENGLISH, new IntegerParam("1"));
      verify(investmentAccountPresenter).present(investmentAccount, Locale.ENGLISH);
    }
View Full Code Here

      super.setup();
    }
   
    @Test
    public void itUpdatesTheAccount() {
      accountResource.update(user, Locale.ENGLISH, new IntegerParam("1"), "New Name", null, null);
      verify(account).setName("New Name");
      verify(accountDAO).update(account);
    }
View Full Code Here

      super.setup();
    }
   
    @Test
    public void itUpdatesTheCurrency() {
      accountResource.update(user, Locale.ENGLISH, new IntegerParam("1"), null, new CurrencyParam("USD"), null);
      verify(account).setCurrency(Currency.getInstance("USD"));
      verify(accountDAO).update(account);
    }
View Full Code Here

TOP

Related Classes of com.wesabe.api.accounts.params.IntegerParam

Copyright © 2018 www.massapicom. 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.