Exemplo n.º 1
0
  @Test
  public void Test500InvalidKey() {

    thrown.expect(RuntimeException.class);
    thrown.expectMessage(JUnitMatchers.containsString("found 500"));

    ODataConsumer consumer = ODataConsumer.create(endpointUri);
    consumer.getEntity("Customers", 1).execute();
  }
Exemplo n.º 2
0
  @Test
  public void Test404NoEntity() {
    ODataConsumer consumer = ODataConsumer.create(endpointUri);
    OEntity customer = null;
    try {
      customer = consumer.getEntity("Customers", "NOUSER").execute();
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }

    Assert.assertNull(customer);
  }