Exemplo n.º 1
0
  @Test
  public void getProxy_not_found() {
    when(aclServiceDao.getProxy(IpInterval.parse("10.0.0.0/32")))
        .thenThrow(EmptyResultDataAccessException.class);

    final Response response = subject.getProxy("10.0.0.0/32");
    assertThat(response.getStatus(), is(404));
  }
Exemplo n.º 2
0
  @Test
  public void getProxy() {
    final Proxy proxy = new Proxy("10.0.0.0/32", "test");
    when(aclServiceDao.getProxy(IpInterval.parse("10.0.0.0/32"))).thenReturn(proxy);

    final Response response = subject.getProxy("10.0.0.0/32");
    assertThat((Proxy) response.getEntity(), is(proxy));
  }