@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()); }