Ejemplo n.º 1
0
  // -------------------------------------------------------------------------
  @Test
  public void testGetConfigByUid() {
    final SimpleExchange target = new SimpleExchange();
    target.setName("Test");

    when(_underlying.getConfig(eq(SimpleExchange.class), eq(UID))).thenReturn(target);

    Response test =
        _resource.get(OID.toString(), SimpleExchange.class.getName(), UID.getVersion(), "", "");
    assertEquals(Status.OK.getStatusCode(), test.getStatus());
    assertSame(target, test.getEntity());
  }
Ejemplo n.º 2
0
  @SuppressWarnings({"rawtypes", "unchecked"})
  @Test
  public void testSearch() {
    final SimpleExchange target = new SimpleExchange();
    target.setName("Test");
    Collection targetColl = ImmutableList.of(target);

    when(_underlying.getConfigs(eq(SimpleExchange.class), eq(NAME), eq(VC))).thenReturn(targetColl);

    Response test =
        _resource.search(
            SimpleExchange.class.getName(),
            VC.getVersionAsOfString(),
            VC.getCorrectedToString(),
            NAME);
    assertEquals(Status.OK.getStatusCode(), test.getStatus());
    assertEquals(FudgeListWrapper.of(targetColl), test.getEntity());
  }