예제 #1
0
  @Test
  public void find_all_view_uuids() throws Exception {
    ViewDoc view1 = new ViewDoc().setUuid("UUID1").setProjects(asList("P1"));
    ViewDoc view2 = new ViewDoc().setUuid("UUID2").setProjects(asList("P2"));
    esTester.putDocuments(INDEX, TYPE_VIEW, view1);
    esTester.putDocuments(INDEX, TYPE_VIEW, view2);

    List<String> result = newArrayList(index.findAllViewUuids());

    assertThat(result).containsOnly(view1.uuid(), view2.uuid());
  }
예제 #2
0
  @Test
  public void find_all_view_uuids() throws Exception {
    esTester.putDocuments(
        ViewIndexDefinition.INDEX,
        ViewIndexDefinition.TYPE_VIEW,
        this.getClass(),
        "view1.json",
        "view2.json");

    List<String> result = newArrayList(index.findAllViewUuids());

    assertThat(result)
        .containsOnly(
            "fed0a543-9d9c-4af5-a4ec-450a8fe78ce7", "8d0bc2a5-bfba-464b-92de-bb170e9d978e");
  }
예제 #3
0
  @Test
  public void not_find_all_view_uuids() {
    List<String> result = newArrayList(index.findAllViewUuids());

    assertThat(result).isEmpty();
  }