Search in sources :

Example 6 with CommitResult

use of com.b2international.snowowl.core.request.CommitResult in project snow-owl by b2ihealthcare.

the class SnomedRefSetMemberApiTest method testDuplicateIdCreationShouldFail.

@Test(expected = AlreadyExistsException.class)
public void testDuplicateIdCreationShouldFail() {
    final String simpleRefSetId = createNewRefSet(branchPath);
    final String memberId = UUID.randomUUID().toString();
    final CommitResult result1 = SnomedRequests.prepareNewMember().setId(memberId).setModuleId(Concepts.MODULE_SCT_CORE).setRefsetId(simpleRefSetId).setReferencedComponentId(simpleRefSetId).build(branchPath.getPath(), RestExtensions.USER, "Creating refset member").execute(getBus()).getSync();
    final String member1Id = result1.getResultAs(String.class);
    assertEquals(memberId, member1Id);
    final CommitResult result2 = SnomedRequests.prepareNewMember().setId(memberId).setModuleId(Concepts.MODULE_SCT_CORE).setRefsetId(simpleRefSetId).setReferencedComponentId(simpleRefSetId).build(branchPath.getPath(), RestExtensions.USER, "Creating refset member").execute(getBus()).getSync();
}
Also used : CommitResult(com.b2international.snowowl.core.request.CommitResult) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Test(org.junit.Test) AbstractSnomedApiTest(com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)

Aggregations

CommitResult (com.b2international.snowowl.core.request.CommitResult)6 Test (org.junit.Test)5 AbstractSnomedApiTest (com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)3 Branch (com.b2international.snowowl.core.branch.Branch)2 TransactionContext (com.b2international.snowowl.core.domain.TransactionContext)2 Pair (com.b2international.commons.Pair)1 BadRequestException (com.b2international.commons.exceptions.BadRequestException)1 BaseRevisionBranching (com.b2international.index.revision.BaseRevisionBranching)1 RevisionBranch (com.b2international.index.revision.RevisionBranch)1 ServiceProvider (com.b2international.snowowl.core.ServiceProvider)1 IBranchPath (com.b2international.snowowl.core.api.IBranchPath)1 Branching (com.b2international.snowowl.core.branch.Branching)1 Merging (com.b2international.snowowl.core.branch.Merging)1 CodeSystem (com.b2international.snowowl.core.codesystem.CodeSystem)1 BranchContext (com.b2international.snowowl.core.domain.BranchContext)1 Request (com.b2international.snowowl.core.events.Request)1 BulkRequest (com.b2international.snowowl.core.events.bulk.BulkRequest)1 RemoteJobEntry (com.b2international.snowowl.core.jobs.RemoteJobEntry)1 Merge (com.b2international.snowowl.core.merge.Merge)1 SnomedConcepts (com.b2international.snowowl.snomed.core.domain.SnomedConcepts)1