Skip to content

Commit

Permalink
Asserts all resource have been created
Browse files Browse the repository at this point in the history
  • Loading branch information
jaboehri committed Sep 5, 2024
1 parent 8d34c68 commit 9b26efc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package dev.dsf.fhir.integration;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.Objects;
import java.util.Optional;
import java.util.UUID;

Expand Down Expand Up @@ -168,7 +170,8 @@ public void testPostQuestionnaireAndCorrespondingQuestionnaireResponseInTransact
bundle.addEntry().setResource(questionnaireResponse).setFullUrl("urn:uuid:" + questionnaireResponse.getId())
.getRequest().setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.QuestionnaireResponse.name());

assertNotNull(getWebserviceClient().postBundle(bundle));
assertTrue(getWebserviceClient().postBundle(bundle).getEntry().stream()
.allMatch(entry -> entry.getResponse().getStatus().equals("201 Created")));
}

@Test
Expand All @@ -188,6 +191,7 @@ public void testPostQuestionnaireAndCorrespondingQuestionnaireResponseInTransact
bundle.addEntry().setResource(questionnaire).setFullUrl("urn:uuid:" + questionnaire.getId()).getRequest()
.setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.Questionnaire.name());

assertNotNull(getWebserviceClient().postBundle(bundle));
assertTrue(getWebserviceClient().postBundle(bundle).getEntry().stream()
.allMatch(entry -> entry.getResponse().getStatus().equals("201 Created")));
}
}

0 comments on commit 9b26efc

Please sign in to comment.