use of com.b2international.snowowl.core.commit.CommitInfo in project snow-owl by b2ihealthcare.
the class CommitInfoRequestTest method getCommitInfo.
@Test
public void getCommitInfo() {
final String oid = UUID.randomUUID().toString();
final String shortName = UUID.randomUUID().toString();
final String comment = "Code system for commit info 1";
createCodeSystem(oid, shortName, comment);
final String id = getCommitInfoByComment(comment).getId();
Request<RepositoryContext, CommitInfo> req = RepositoryRequests.commitInfos().prepareGetCommitInfo(id).build();
CommitInfo commitInfo = new ResourceRepositoryRequestBuilder<CommitInfo>() {
@Override
public Request<RepositoryContext, CommitInfo> build() {
return req;
}
}.buildAsync().execute(bus).getSync();
assertEquals(id, commitInfo.getId());
assertEquals(comment, commitInfo.getComment());
assertEquals(BRANCH, commitInfo.getBranch());
assertEquals(USER_ID, commitInfo.getAuthor());
}
use of com.b2international.snowowl.core.commit.CommitInfo 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.CommitInfo 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());
}
use of com.b2international.snowowl.core.commit.CommitInfo in project snow-owl by b2ihealthcare.
the class CommitInfoRequestTest method searchCommitInfoByComment.
@Test
public void searchCommitInfoByComment() {
final String oid = UUID.randomUUID().toString();
final String shortName = UUID.randomUUID().toString();
final String comment = "Code system for commit info 2";
createCodeSystem(oid, shortName, comment);
final CommitInfo commitInfo = getCommitInfoByComment(comment);
assertEquals(comment, commitInfo.getComment());
}
Aggregations