@Test
  public void testSimpleDelete() {

    metadataStore.write("a/repo", "");
    assertEquals("", metadataStore.read("a/repo").get().getOrigin());

    metadataStore.delete("a/repo");
    assertFalse(metadataStore.read("a/repo").isPresent());
  }
  @Test
  public void testComplexDelete() {

    metadataStore.write("b/repo", "a/repo");
    metadataStore.write("c/repo", "b/repo");
    metadataStore.write("d/repo", "c/repo");

    metadataStore.delete("c/repo");

    assertEquals("", metadataStore.read("d/repo").get().getOrigin());
    assertEquals("a/repo", metadataStore.read("b/repo").get().getOrigin());

    assertEquals("b/repo", metadataStore.read("a/repo").get().getForks().get(0));
    assertEquals(0, metadataStore.read("b/repo").get().getForks().size());
    assertFalse(metadataStore.read("c/repo").isPresent());
  }
Esempio n. 3
0
 protected static final void assertFalse(String message, boolean condition) {
   Util.assertFalse(message, condition);
 }
Esempio n. 4
0
 protected static final void assertFalse(boolean condition) {
   Util.assertFalse(condition);
 }