blob: c63530a9d16b0a0daa689590459746306be8b222 [file] [log] [blame]
package com.googlesource.gerrit.plugins.multisite.validation.dfsrefdb;
import static com.google.common.truth.Truth.assertThat;
import org.eclipse.jgit.lib.Ref;
import org.junit.Test;
public class NoopSharedRefDatabaseTest implements RefFixture {
private Ref sampleRef = newRef(A_TEST_REF_NAME, AN_OBJECT_ID_1);
private NoopSharedRefDatabase objectUnderTest = new NoopSharedRefDatabase();
@Test
public void isUpToDateShouldAlwaysReturnTrue() {
assertThat(objectUnderTest.isUpToDate(A_TEST_PROJECT_NAME_KEY, sampleRef)).isTrue();
}
@Test
public void compareAndPutShouldAlwaysReturnTrue() {
assertThat(objectUnderTest.compareAndPut(A_TEST_PROJECT_NAME_KEY, sampleRef, AN_OBJECT_ID_2))
.isTrue();
}
@Test
public void existsShouldAlwaysReturnFalse() {
assertThat(objectUnderTest.exists(A_TEST_PROJECT_NAME_KEY, A_TEST_REF_NAME)).isFalse();
}
}