use of com.b2international.snowowl.core.commit.CommitInfos in project snow-owl by b2ihealthcare.
the class CommitInfoRequestTest method getCommitInfoByComment.
private CommitInfo getCommitInfoByComment(final String comment) {
Request<RepositoryContext, CommitInfos> req = RepositoryRequests.commitInfos().prepareSearchCommitInfo().filterByComment(comment).build();
final CommitInfos commitInfos = new ResourceRepositoryRequestBuilder<CommitInfos>() {
@Override
public Request<RepositoryContext, CommitInfos> build() {
return req;
}
}.buildAsync().execute(bus).getSync();
assertEquals(commitInfos.getTotal(), 1);
return Iterables.getOnlyElement(commitInfos);
}
use of com.b2international.snowowl.core.commit.CommitInfos in project snow-owl by b2ihealthcare.
the class CommitInfoRequestTest method searchCommitInfoByTimestamp.
@Test
public void searchCommitInfoByTimestamp() {
final String oid = UUID.randomUUID().toString();
final String shortName = UUID.randomUUID().toString();
final String comment = "Code system for commit info 5";
createCodeSystem(shortName, oid, comment);
final CommitInfo commitInfo = getCommitInfoByComment(comment);
Request<RepositoryContext, CommitInfos> req = RepositoryRequests.commitInfos().prepareSearchCommitInfo().filterByTimestamp(commitInfo.getTimestamp()).build();
final CommitInfos commitInfos = new ResourceRepositoryRequestBuilder<CommitInfos>() {
@Override
public Request<RepositoryContext, CommitInfos> build() {
return req;
}
}.buildAsync().execute(bus).getSync();
assertTrue(commitInfos.getTotal() == 1);
assertEquals(commitInfo.getTimestamp(), Iterables.getOnlyElement(commitInfos.getItems()).getTimestamp());
}
use of com.b2international.snowowl.core.commit.CommitInfos in project snow-owl by b2ihealthcare.
the class CommitInfoRequestTest method searchCommitInfoByUserId.
@Test
public void searchCommitInfoByUserId() {
final String oid = UUID.randomUUID().toString();
final String shortName = UUID.randomUUID().toString();
final String comment = "Code system for commit info 3";
final String userId = "commitInfo";
createCodeSystem(oid, shortName, comment, userId);
Request<RepositoryContext, CommitInfos> req = RepositoryRequests.commitInfos().prepareSearchCommitInfo().filterByAuthor(userId).build();
final CommitInfos commitInfos = new ResourceRepositoryRequestBuilder<CommitInfos>() {
@Override
public Request<RepositoryContext, CommitInfos> build() {
return req;
}
}.buildAsync().execute(bus).getSync();
assertEquals(commitInfos.getTotal(), 1);
final CommitInfo commitInfo = Iterables.getOnlyElement(commitInfos);
assertEquals(userId, commitInfo.getAuthor());
}
Aggregations