Skip to content

Commit

Permalink
Removed setting resource id's unnecessarily. Removed unused imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaboehri committed Sep 6, 2024
1 parent 119e98f commit ff262c8
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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 All @@ -14,7 +13,6 @@
import org.hl7.fhir.r4.model.StringType;
import org.junit.Test;

import dev.dsf.fhir.dao.BundleDao;
import dev.dsf.fhir.dao.QuestionnaireDao;

public class QuestionnaireVsQuestionnaireResponseIntegrationTest extends AbstractQuestionnaireIntegrationTest
Expand Down Expand Up @@ -161,13 +159,10 @@ public void testPostQuestionnaireAndCorrespondingQuestionnaireResponseInTransact
QuestionnaireResponse questionnaireResponse = createQuestionnaireResponse("1.5.3");

Bundle bundle = new Bundle();
bundle.setId("urn:uuid:" + UUID.randomUUID());
bundle.setType(Bundle.BundleType.TRANSACTION);
questionnaire.setId("urn:uuid:" + UUID.randomUUID());
bundle.addEntry().setResource(questionnaire).setFullUrl("urn:uuid:" + questionnaire.getId()).getRequest()
bundle.addEntry().setResource(questionnaire).setFullUrl("urn:uuid:" + UUID.randomUUID().toString()).getRequest()
.setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.Questionnaire.name());
questionnaireResponse.setId("urn:uuid:" + UUID.randomUUID());
bundle.addEntry().setResource(questionnaireResponse).setFullUrl("urn:uuid:" + questionnaireResponse.getId())
bundle.addEntry().setResource(questionnaireResponse).setFullUrl("urn:uuid:" + UUID.randomUUID().toString())
.getRequest().setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.QuestionnaireResponse.name());

assertTrue(getWebserviceClient().postBundle(bundle).getEntry().stream()
Expand All @@ -182,13 +177,10 @@ public void testPostQuestionnaireAndCorrespondingQuestionnaireResponseInTransact
QuestionnaireResponse questionnaireResponse = createQuestionnaireResponse("1.5.3");

Bundle bundle = new Bundle();
bundle.setId("urn:uuid:" + UUID.randomUUID());
bundle.setType(Bundle.BundleType.TRANSACTION);
questionnaire.setId("urn:uuid:" + UUID.randomUUID());
questionnaireResponse.setId("urn:uuid:" + UUID.randomUUID());
bundle.addEntry().setResource(questionnaireResponse).setFullUrl("urn:uuid:" + questionnaireResponse.getId())
bundle.addEntry().setResource(questionnaireResponse).setFullUrl("urn:uuid:" + UUID.randomUUID().toString())
.getRequest().setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.QuestionnaireResponse.name());
bundle.addEntry().setResource(questionnaire).setFullUrl("urn:uuid:" + questionnaire.getId()).getRequest()
bundle.addEntry().setResource(questionnaire).setFullUrl("urn:uuid:" + UUID.randomUUID().toString()).getRequest()
.setMethod(Bundle.HTTPVerb.POST).setUrl(ResourceType.Questionnaire.name());

assertTrue(getWebserviceClient().postBundle(bundle).getEntry().stream()
Expand Down

0 comments on commit ff262c8

Please sign in to comment.