Search in sources :

Example 1 with OnRefOnly

use of org.projectnessie.versioned.testworker.OnRefOnly in project nessie by projectnessie.

the class AbstractCommits method commitDuplicateValues.

/*
   * Test:
   *  - Check that store allows storing the same value under different keys
   */
@Test
public void commitDuplicateValues() throws Exception {
    BranchName branch = BranchName.of("dupe-values");
    store().create(branch, Optional.empty());
    OnRefOnly foo1 = newOnRef("foo");
    OnRefOnly foo2 = newOnRef("foo");
    store().commit(branch, Optional.empty(), commitMessage("metadata"), ImmutableList.of(put("keyA", foo1), put("keyB", foo2)));
    assertThat(store().getValue(branch, Key.of("keyA"))).isEqualTo(foo1);
    assertThat(store().getValue(branch, Key.of("keyB"))).isEqualTo(foo2);
}
Also used : OnRefOnly(org.projectnessie.versioned.testworker.OnRefOnly) BranchName(org.projectnessie.versioned.BranchName) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 BranchName (org.projectnessie.versioned.BranchName)1 OnRefOnly (org.projectnessie.versioned.testworker.OnRefOnly)1