Search in sources :

Example 1 with FakeStoredValue

use of com.google.gerrit.index.testing.FakeStoredValue in project gerrit by GerritCodeReview.

the class ChangeFieldTest method tolerateNullValuesForInsertion.

@Test
public void tolerateNullValuesForInsertion() {
    Project.NameKey project = Project.nameKey("project");
    ChangeData cd = ChangeData.createForTest(project, Change.id(1), 1, ObjectId.zeroId());
    assertThat(ChangeField.ADDED.setIfPossible(cd, new FakeStoredValue(null))).isTrue();
}
Also used : Project(com.google.gerrit.entities.Project) FakeStoredValue(com.google.gerrit.index.testing.FakeStoredValue) ChangeData(com.google.gerrit.server.query.change.ChangeData) Test(org.junit.Test)

Example 2 with FakeStoredValue

use of com.google.gerrit.index.testing.FakeStoredValue in project gerrit by GerritCodeReview.

the class ChangeFieldTest method tolerateNullValuesForDeletion.

@Test
public void tolerateNullValuesForDeletion() {
    Project.NameKey project = Project.nameKey("project");
    ChangeData cd = ChangeData.createForTest(project, Change.id(1), 1, ObjectId.zeroId());
    assertThat(ChangeField.DELETED.setIfPossible(cd, new FakeStoredValue(null))).isTrue();
}
Also used : Project(com.google.gerrit.entities.Project) FakeStoredValue(com.google.gerrit.index.testing.FakeStoredValue) ChangeData(com.google.gerrit.server.query.change.ChangeData) Test(org.junit.Test)

Aggregations

Project (com.google.gerrit.entities.Project)2 FakeStoredValue (com.google.gerrit.index.testing.FakeStoredValue)2 ChangeData (com.google.gerrit.server.query.change.ChangeData)2 Test (org.junit.Test)2