Exemplo n.º 1
0
  @Test(expected = MissingFormatArgumentException.class)
  public void createAggregatorNotAdminTest() throws Exception {

    when(userManager.isAdmin()).thenReturn(false);

    Aggregator aggregator = new Aggregator();
    aggregator.setAggregatorId("*****@*****.**");
    aggregator.setAggregatorName("aggregatorName");

    toTest.createAggregator(aggregator);

    fail();
  }
Exemplo n.º 2
0
  @Test
  public void createAggregatorTest() throws Exception {

    when(userManager.isAdmin()).thenReturn(true);

    Aggregator aggregator = new Aggregator();
    aggregator.setAggregatorId("*****@*****.**");
    aggregator.setAggregatorName("aggregatorName");

    Response response = toTest.createAggregator(aggregator);

    Assert.assertEquals(201, response.getStatus());
  }