Search in sources :

Example 1 with CommentContextKey

use of com.google.gerrit.server.comment.CommentContextKey in project gerrit by GerritCodeReview.

the class CommentContextSerializerTest method roundTripKey.

@Test
public void roundTripKey() {
    Project.NameKey proj = Project.NameKey.parse("project");
    Change.Id changeId = Change.Id.tryParse("1234").get();
    CommentContextKey k = CommentContextKey.builder().project(proj).changeId(changeId).id("commentId").path("pathHash").patchset(1).contextPadding(3).build();
    byte[] serialized = CommentContextKey.Serializer.INSTANCE.serialize(k);
    assertThat(k).isEqualTo(CommentContextKey.Serializer.INSTANCE.deserialize(serialized));
}
Also used : Project(com.google.gerrit.entities.Project) CommentContextKey(com.google.gerrit.server.comment.CommentContextKey) Change(com.google.gerrit.entities.Change) Test(org.junit.Test)

Aggregations

Change (com.google.gerrit.entities.Change)1 Project (com.google.gerrit.entities.Project)1 CommentContextKey (com.google.gerrit.server.comment.CommentContextKey)1 Test (org.junit.Test)1