diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/IntegrationAdaptorNhaisApplicationTests.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/IntegrationAdaptorNhaisApplicationTests.java index b3c21c296..82b0ad88a 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/IntegrationAdaptorNhaisApplicationTests.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/IntegrationAdaptorNhaisApplicationTests.java @@ -11,7 +11,7 @@ class IntegrationAdaptorNhaisApplicationTests { @Test - void when_databaseIsNotReachable_then_applicationStartsUpWithNegativeHealthcheck() { + void When_DatabaseIsNotReachable_Expect_ApplicationStartsUpWithNegativeHealthcheck() { } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundEdifactTransactionHandlerTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundEdifactTransactionHandlerTest.java index 1de7c15d7..f0d553d11 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundEdifactTransactionHandlerTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundEdifactTransactionHandlerTest.java @@ -43,7 +43,7 @@ void setUp() { } @Test - void whenTranslatingAmendment_expectPatchTranslationServiceIsUsed() { + void When_TranslatingAmendment_Expect_PatchTranslationServiceIsUsed() { when(message.getReferenceTransactionType()) .thenReturn(new ReferenceTransactionType(ReferenceTransactionType.Inbound.AMENDMENT)); var amendmentBody = new AmendmentBody(); @@ -59,7 +59,7 @@ void whenTranslatingAmendment_expectPatchTranslationServiceIsUsed() { @ParameterizedTest @EnumSource(names = {"DEDUCTION", "REJECTION", "APPROVAL"}) - void whenTranslatingNonAmendment_expectFhirTranslationServiceIsUsed(ReferenceTransactionType.Inbound transactionType) { + void When_TranslatingNonAmendment_Expect_FhirTranslationServiceIsUsed(ReferenceTransactionType.Inbound transactionType) { when(message.getReferenceTransactionType()) .thenReturn(new ReferenceTransactionType(transactionType)); var parameters = new Parameters(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundOperationIdServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundOperationIdServiceTest.java index 8a0bf15aa..d89fd80f9 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundOperationIdServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundOperationIdServiceTest.java @@ -53,7 +53,7 @@ private void beforeEach() { @ParameterizedTest @EnumSource(value = ReferenceTransactionType.Inbound.class, names = {"APPROVAL", "REJECTION"}) - public void When_ApprovalOrRejectionTransaction_Then_OperationIdUsesRecipient(ReferenceTransactionType.Inbound transactionType) { + public void When_ApprovalOrRejectionTransaction_Expect_OperationIdUsesRecipient(ReferenceTransactionType.Inbound transactionType) { when(referenceTransactionType.getTransactionType()).thenReturn(transactionType); when(interchangeHeader.getRecipient()).thenReturn(RECIPIENT); assertThat(RECIPIENT_OID).isEqualTo(operationIdService.createOperationIdForTransaction(transaction)); @@ -61,7 +61,7 @@ public void When_ApprovalOrRejectionTransaction_Then_OperationIdUsesRecipient(Re @ParameterizedTest @EnumSource(value = ReferenceTransactionType.Inbound.class, names = {"APPROVAL", "REJECTION"}, mode = EnumSource.Mode.EXCLUDE) - public void When_AllOtherTransactions_Then_OperationIdUsesSender(ReferenceTransactionType.Inbound transactionType) { + public void When_AllOtherTransactions_Expect_OperationIdUsesSender(ReferenceTransactionType.Inbound transactionType) { when(referenceTransactionType.getTransactionType()).thenReturn(transactionType); when(interchangeHeader.getSender()).thenReturn(SENDER); assertThat(SENDER_OID).isEqualTo(operationIdService.createOperationIdForTransaction(transaction)); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/RecepProducerServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/RecepProducerServiceTest.java index b2665d220..3d6802f49 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/RecepProducerServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/RecepProducerServiceTest.java @@ -55,7 +55,7 @@ class RecepProducerServiceTest { private TimestampService timestampService; @Test - public void whenProducingRecep_thenValidRecepIsCreated() throws IOException { + public void When_ProducingRecep_Expect_ValidRecepIsCreated() throws IOException { when(timestampService.getCurrentTimestamp()).thenReturn(FIXED_TIME); when(sequenceService.generateInterchangeSequence(REF_SENDER, REF_RECIPIENT)).thenReturn(RECEP_INTERCHANGE_SEQUENCE); when(sequenceService.generateMessageSequence(REF_SENDER, REF_RECIPIENT)).thenReturn(RECEP_MESSAGE_SEQUENCE); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionRejectionTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionRejectionTransactionMapperTest.java index 551128c1e..781c30044 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionRejectionTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionRejectionTransactionMapperTest.java @@ -55,7 +55,7 @@ class DeductionRejectionTransactionMapperTest { private GpNameAndAddress gpNameAndAddress; @Test - void when_AllDataPresent_then_mapped(SoftAssertions softly) { + void When_AllDataPresent_Expect_Mapped(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getNhsNumber()).thenReturn(NHS_NUMBER); when(transaction.getFreeText()).thenReturn(Optional.of(new FreeText("TEXT VALUE"))); @@ -78,7 +78,7 @@ void when_AllDataPresent_then_mapped(SoftAssertions softly) { } @Test - void when_missingOfficialPatientIdentifier_then_throwsException() { + void When_MissingOfficialPatientIdentifier_Expect_ThrowsException() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getNhsNumber()).thenReturn(null); when(transaction.getMessage()).thenReturn(message); @@ -94,7 +94,7 @@ void when_missingOfficialPatientIdentifier_then_throwsException() { } @Test - void when_missingPersonNameSegment_then_throwsException() { + void When_MissingPersonNameSegment_Expect_ThrowsException() { when(transaction.getPersonName()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); @@ -109,7 +109,7 @@ void when_missingPersonNameSegment_then_throwsException() { } @Test - void when_missingHaNotes_then_throwsException() { + void When_MissingHaNotes_Expect_ThrowsException() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getNhsNumber()).thenReturn(NHS_NUMBER); when(transaction.getFreeText()).thenReturn(Optional.empty()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionTransactionMapperTest.java index 6edd9e689..54cb14788 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionTransactionMapperTest.java @@ -61,7 +61,7 @@ class DeductionTransactionMapperTest { private GpNameAndAddress gpNameAndAddress; @Test - void when_allFieldsInTransaction_Then_mapAllFields(SoftAssertions softly) { + void When_AllFieldsInTransaction_Expect_MapAllFields(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode)); when(transaction.getDeductionDate()).thenReturn(Optional.of(deductionDate)); @@ -91,7 +91,7 @@ void when_allFieldsInTransaction_Then_mapAllFields(SoftAssertions softly) { } @Test - void when_allMandatoryFieldsInTransaction_Then_mapOnlyMandatoryFields(SoftAssertions softly) { + void When_AllMandatoryFieldsInTransaction_Expect_MapOnlyMandatoryFields(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode)); when(transaction.getDeductionDate()).thenReturn(Optional.of(deductionDate)); @@ -119,7 +119,7 @@ void when_allMandatoryFieldsInTransaction_Then_mapOnlyMandatoryFields(SoftAssert } @Test - void when_NhsNumberIsMissing_Then_ThrowException(SoftAssertions softly) { + void When_NhsNumberIsMissing_Expect_ThrowException(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); @@ -133,7 +133,7 @@ void when_NhsNumberIsMissing_Then_ThrowException(SoftAssertions softly) { } @Test - void when_DeductionReasonCodeIsMissing_Then_ThrowException(SoftAssertions softly) { + void When_DeductionReasonCodeIsMissing_Expect_ThrowException(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(transaction.getDeductionReasonCode()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); @@ -150,7 +150,7 @@ void when_DeductionReasonCodeIsMissing_Then_ThrowException(SoftAssertions softly } @Test - void when_DeductionDateIsMissing_Then_ThrowException(SoftAssertions softly) { + void When_DeductionDateIsMissing_Expect_ThrowException(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode)); when(transaction.getDeductionDate()).thenReturn(Optional.empty()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69FlagRemovalTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69FlagRemovalTransactionMapperTest.java index 5092d781f..80519efa9 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69FlagRemovalTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69FlagRemovalTransactionMapperTest.java @@ -56,7 +56,7 @@ class FP69FlagRemovalTransactionMapperTest { private GpNameAndAddress gpNameAndAddress; @Test - void when_AllDataPresent_then_mapped(SoftAssertions softly) { + void When_AllDataPresent_Expect_Mapped(SoftAssertions softly) { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getNhsNumber()).thenReturn(NHS_NUMBER); when(transaction.getMessage()).thenReturn(message); @@ -76,7 +76,7 @@ void when_AllDataPresent_then_mapped(SoftAssertions softly) { } @Test - void when_missingOfficialPatientIdentifier_then_throwsException() { + void When_MissingOfficialPatientIdentifier_Expect_ThrowsException() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getNhsNumber()).thenReturn(null); when(transaction.getMessage()).thenReturn(message); @@ -91,7 +91,7 @@ void when_missingOfficialPatientIdentifier_then_throwsException() { } @Test - void when_missingPersonNameSegment_then_throwsException() { + void When_MissingPersonNameSegment_Expect_ThrowsException() { when(transaction.getPersonName()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69PriorNotificationTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69PriorNotificationTransactionMapperTest.java index 20abf1074..c9e2485f5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69PriorNotificationTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69PriorNotificationTransactionMapperTest.java @@ -69,7 +69,7 @@ class FP69PriorNotificationTransactionMapperTest { private GpNameAndAddress gpNameAndAddress; @Test - void whenPersonNameSegmentIsMissing_expectException() { + void When_PersonNameSegmentIsMissing_Expect_Exception() { when(transaction.getPersonName()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); @@ -83,7 +83,7 @@ void whenPersonNameSegmentIsMissing_expectException() { } @Test - void whenNhsNumberIsMissing_expectException() { + void When_NhsNumberIsMissing_Expect_Exception() { when(transaction.getPersonName()).thenReturn(Optional.of(PersonName.builder().build())); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); @@ -97,7 +97,7 @@ void whenNhsNumberIsMissing_expectException() { } @Test - void whenSurnameIsMissing_expectException() { + void When_SurnameIsMissing_Expect_Exception() { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); @@ -113,7 +113,7 @@ void whenSurnameIsMissing_expectException() { } @Test - void whenDateOfBirthSegmentIsMissing_expectException() { + void When_DateOfBirthSegmentIsMissing_Expect_Exception() { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); @@ -131,7 +131,7 @@ void whenDateOfBirthSegmentIsMissing_expectException() { } @Test - void whenReasonCodeSegmentIsMissing_expectException() { + void When_ReasonCodeSegmentIsMissing_Expect_Exception() { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); @@ -152,7 +152,7 @@ void whenReasonCodeSegmentIsMissing_expectException() { } @Test - void whenExpiryDateSegmentIsMissing_expectException() { + void When_ExpiryDateSegmentIsMissing_Expect_Exception() { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); @@ -174,7 +174,7 @@ void whenExpiryDateSegmentIsMissing_expectException() { } @Test - void whenMappingRequiredValues_expectParametersAreMapped(SoftAssertions softly) { + void When_MappingRequiredValues_Expect_ParametersAreMapped(SoftAssertions softly) { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); @@ -189,7 +189,7 @@ void whenMappingRequiredValues_expectParametersAreMapped(SoftAssertions softly) } @Test - void whenMappingAllValues_expectParametersAreMapped(SoftAssertions softly) { + void When_MappingAllValues_Expect_ParametersAreMapped(SoftAssertions softly) { when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); when(message.getInterchange()).thenReturn(interchange); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/RejectionTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/RejectionTransactionMapperTest.java index 45d02eef5..568fe7000 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/RejectionTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/RejectionTransactionMapperTest.java @@ -63,7 +63,7 @@ void testMap(SoftAssertions softly) { } @Test - void whenFreeTextIsMissing_expectException(SoftAssertions softly) { + void When_FreeTextIsMissing_Expect_Exception(SoftAssertions softly) { when(transaction.getFreeText()).thenReturn(Optional.empty()); when(transaction.getMessage()).thenReturn(message); when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/EdifactToPatchServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/EdifactToPatchServiceTest.java index 8987bb5b3..809319716 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/EdifactToPatchServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/EdifactToPatchServiceTest.java @@ -67,7 +67,7 @@ void setUp() { } @Test - void whenConvertingToPatch_properMandatoryFieldsAreSet() { + void When_ConvertingToPatch_Expect_ProperMandatoryFieldsAreSet() { var amendmentBody = edifactToPatchService.convertToPatch(transaction); assertThat(amendmentBody.getNhsNumber()).isEqualTo(NHS_NUMBER); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressCountyPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressCountyPatchTransactionMapperTest.java index fca2afe3a..5488f9228 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressCountyPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressCountyPatchTransactionMapperTest.java @@ -35,7 +35,7 @@ public static void setUp() { @Test - void whenPersonAddressHasLineFifth_thenMapIntoCountyAmendmentPatch() { + void When_PersonAddressHasLineFifth_Expect_MapIntoCountyAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine5()).thenReturn(COUNTY); @@ -45,7 +45,7 @@ void whenPersonAddressHasLineFifth_thenMapIntoCountyAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressCountyPatchTransactionMapper.map(transaction); @@ -54,7 +54,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineFifth_thenReturnValueIsNull() { + void When_PersonAddressHasNoLineFifth_Expect_ReturnValueIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine5()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressHouseNamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressHouseNamePatchTransactionMapperTest.java index 88cef1fe9..9171d4492 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressHouseNamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressHouseNamePatchTransactionMapperTest.java @@ -35,7 +35,7 @@ public static void setUp() { } @Test - void whenPersonAddressHasLineFirst_theMapIntoHouseNameAmendmentPatch() { + void When_PersonAddressHasLineFirst_Expect_MapIntoHouseNameAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine1()).thenReturn(HOUSE_NAME); @@ -45,7 +45,7 @@ void whenPersonAddressHasLineFirst_theMapIntoHouseNameAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressHouseNamePatchTransactionMapper.map(transaction); @@ -54,7 +54,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineFirst_thenReturnValueIsNull() { + void When_PersonAddressHasNoLineFirst_Expect_ReturnValueIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine1()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressLocalityPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressLocalityPatchTransactionMapperTest.java index 7d5f889ee..48e1d624a 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressLocalityPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressLocalityPatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonAddressHasLineThird_thenMapIntoLocalityAmendmentPatch() { + void When_PersonAddressHasLineThird_Expect_MapIntoLocalityAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine3()).thenReturn(LOCALITY); @@ -46,7 +46,7 @@ void whenPersonAddressHasLineThird_thenMapIntoLocalityAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressLocalityPatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineThird_thenReturnValueIsNull() { + void When_PersonAddressHasNoLineThird_Expect_ReturnValueIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine3()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressNumberOrRoadNamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressNumberOrRoadNamePatchTransactionMapperTest.java index 29878600c..fe0f4313e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressNumberOrRoadNamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressNumberOrRoadNamePatchTransactionMapperTest.java @@ -37,7 +37,7 @@ public static void setUp() { @Test - void whenPersonAddressHasLineSecond_thenMapIntoAddressNumberOrRoadNameAmendmentPatch() { + void When_PersonAddressHasLineSecond_Expect_MapIntoAddressNumberOrRoadNameAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine2()).thenReturn(ROAD_NAME); @@ -47,7 +47,7 @@ void whenPersonAddressHasLineSecond_thenMapIntoAddressNumberOrRoadNameAmendmentP } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressNumberOrRoadNamePatchTransactionMapper.map(transaction); @@ -56,7 +56,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineSecond_thenReturnValueIsNull() { + void When_PersonAddressHasNoLineSecond_Expect_ReturnValueIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine2()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostCodePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostCodePatchTransactionMapperTest.java index cff2d6899..6569379e1 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostCodePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostCodePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonAddressHasLineFifth_thenMapIntoCountyAmendmentPatch() { + void When_PersonAddressHasLineFifth_Expect_MapIntoCountyAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getPostalCode()).thenReturn(POST_CODE); @@ -46,7 +46,7 @@ void whenPersonAddressHasLineFifth_thenMapIntoCountyAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressPostCodePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineFifth_thenAmendmentPatchIsNull() { + void When_PersonAddressHasNoLineFifth_Expect_AmendmentPatchIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getPostalCode()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostTownPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostTownPatchTransactionMapperTest.java index 8aeca4174..e10b5b2cc 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostTownPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AddressPostTownPatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonAddressHasLineForth_thenMapIntoCountyAmendmentPatch() { + void When_PersonAddressHasLineFourth_Expect_MapIntoCountyAmendmentPatch() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine4()).thenReturn(POST_TOWN); @@ -46,7 +46,7 @@ void whenPersonAddressHasLineForth_thenMapIntoCountyAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonAddress()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = addressPostTownPatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonAddressNotPresent_thenReturnNull() { } @Test - void whenPersonAddressHasNoLineForth_thenReturnValueIsNull() { + void When_PersonAddressHasNoLineFourth_Expect_ReturnValueIsNull() { when(transaction.getPersonAddress()).thenReturn(Optional.of(personAddress)); when(personAddress.getAddressLine4()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AmendedNhsNumberPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AmendedNhsNumberPatchTransactionMapperTest.java index 4770d1692..b634294b5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AmendedNhsNumberPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/AmendedNhsNumberPatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenNhsNumberPresent_thenMapIntoNhsNumberAmendmentPatch() { + void When_NhsNumberPresent_Expect_MapIntoNhsNumberAmendmentPatch() { when(transaction.getPersonPreviousName()).thenReturn(Optional.of(personPreviousName)); when(personPreviousName.getNhsNumber()).thenReturn(NHS_NUMBER); @@ -46,7 +46,7 @@ void whenNhsNumberPresent_thenMapIntoNhsNumberAmendmentPatch() { } @Test - void whenNhsNumberNotPresentNotPresent_thenReturnNull() { + void When_NhsNumberNotPresentNotPresent_Expect_ReturnNull() { when(transaction.getPersonPreviousName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = amendedNhsNumberPatchTransactionMapper.map(transaction); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/BirthDatePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/BirthDatePatchTransactionMapperTest.java index 29e2a7abf..1b6c2e1d6 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/BirthDatePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/BirthDatePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonDateOfBirth_thenMapIntoBirthDateAmendmentPatch() { + void When_PersonDateOfBirth_Expect_MapIntoBirthDateAmendmentPatch() { when(transaction.getPersonDateOfBirth()).thenReturn(Optional.of(personDateOfBirth)); when(personDateOfBirth.getDateOfBirth()).thenReturn(BIRTH_DATE); @@ -46,7 +46,7 @@ void whenPersonDateOfBirth_thenMapIntoBirthDateAmendmentPatch() { } @Test - void whenPersonAddressNotPresent_thenReturnNull() { + void When_PersonAddressNotPresent_Expect_ReturnNull() { when(transaction.getPersonDateOfBirth()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = birthDatePatchTransactionMapper.map(transaction); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/DrugsMarkerExtensionPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/DrugsMarkerExtensionPatchTransactionMapperTest.java index 27d3caeec..bed7a9526 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/DrugsMarkerExtensionPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/DrugsMarkerExtensionPatchTransactionMapperTest.java @@ -32,7 +32,7 @@ public static void setUp() { @Test - void whenDrugsMarkerIsTrue_thenMapIntoTrue() { + void When_DrugsMarkerIsTrue_Expect_MapIntoTrue() { when(transaction.getDrugsMarker()).thenReturn(Optional.of(drugsMarker)); when(drugsMarker.isDrugsMarker()).thenReturn(true); @@ -42,7 +42,7 @@ void whenDrugsMarkerIsTrue_thenMapIntoTrue() { } @Test - void whenDrugsMarkerIsFalse_thenMapIntoFalse() { + void When_DrugsMarkerIsFalse_Expect_MapIntoFalse() { when(transaction.getDrugsMarker()).thenReturn(Optional.of(drugsMarker)); when(drugsMarker.isDrugsMarker()).thenReturn(false); @@ -52,7 +52,7 @@ void whenDrugsMarkerIsFalse_thenMapIntoFalse() { } @Test - void whenNoDrugsMarker_thenReturnNullAmendmentPatch() { + void When_NoDrugsMarker_Expect_ReturnNullAmendmentPatch() { when(transaction.getDrugsMarker()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = drugsMarkerExtensionPatchTransactionMapper.map(transaction); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/FirstForenamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/FirstForenamePatchTransactionMapperTest.java index 8bae8b382..d40b2a57e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/FirstForenamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/FirstForenamePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonNameHasFirstForename_thenMapIntoFirstForenameAmendmentPatch() { + void When_PersonNameHasFirstForename_Expect_MapIntoFirstForenameAmendmentPatch() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getFirstForename()).thenReturn(FIRST_FORENAME); @@ -46,7 +46,7 @@ void whenPersonNameHasFirstForename_thenMapIntoFirstForenameAmendmentPatch() { } @Test - void whenPersonNameNotPresent_thenReturnNull() { + void When_PersonNameNotPresent_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = firstForenamePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonNameNotPresent_thenReturnNull() { } @Test - void whenPersonNameHasNoForename_thenReturnNull() { + void When_PersonNameHasNoForename_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getFirstForename()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/GenderPatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/GenderPatchTransactionMapperTest.java index 558e07110..ae6065428 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/GenderPatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/GenderPatchTransactionMapperTest.java @@ -33,7 +33,7 @@ public static void setUp() { @Test - void whenTransactionHasFemaleGender_thenMapIntoFemale() { + void When_TransactionHasFemaleGender_Expect_MapIntoFemale() { when(transaction.getGender()).thenReturn(Optional.of(personSex)); when(personSex.getGender()).thenReturn(PersonSex.Gender.FEMALE); @@ -43,7 +43,7 @@ void whenTransactionHasFemaleGender_thenMapIntoFemale() { } @Test - void whenTransactionHasMaleGender_thenMapIntoMale() { + void When_TransactionHasMaleGender_Expect_MapIntoMale() { when(transaction.getGender()).thenReturn(Optional.of(personSex)); when(personSex.getGender()).thenReturn(PersonSex.Gender.MALE); @@ -53,7 +53,7 @@ void whenTransactionHasMaleGender_thenMapIntoMale() { } @Test - void whenTransactionHasOtherGender_thenMapIntoOther() { + void When_TransactionHasOtherGender_Expect_MapIntoOther() { when(transaction.getGender()).thenReturn(Optional.of(personSex)); when(personSex.getGender()).thenReturn(PersonSex.Gender.OTHER); @@ -63,7 +63,7 @@ void whenTransactionHasOtherGender_thenMapIntoOther() { } @Test - void whenTransactionHasUnknownGender_thenMapIntoUnknown() { + void When_TransactionHasUnknownGender_Expect_MapIntoUnknown() { when(transaction.getGender()).thenReturn(Optional.of(personSex)); when(personSex.getGender()).thenReturn(PersonSex.Gender.UNKNOWN); @@ -73,7 +73,7 @@ void whenTransactionHasUnknownGender_thenMapIntoUnknown() { } @Test - void whenNoGenderInTransaction_thenReturnNull() { + void When_NoGenderInTransaction_Expect_ReturnNull() { when(transaction.getGender()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = genderPatchTransactionMapper.map(transaction); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/PreviousSurnamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/PreviousSurnamePatchTransactionMapperTest.java index 5196c07b3..a31856dc8 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/PreviousSurnamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/PreviousSurnamePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPreviousNameHasSurname_thenMapIntoPreviousSurnameAmendmentPatch() { + void When_PreviousNameHasSurname_Expect_MapIntoPreviousSurnameAmendmentPatch() { when(transaction.getPersonPreviousName()).thenReturn(Optional.of(personPreviousName)); when(personPreviousName.getFamilyName()).thenReturn(PREVIOUS_SURNAME); @@ -46,7 +46,7 @@ void whenPreviousNameHasSurname_thenMapIntoPreviousSurnameAmendmentPatch() { } @Test - void whenNoPreviousName_thenReturnNull() { + void When_NoPreviousName_Expect_ReturnNull() { when(transaction.getPersonPreviousName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = previousSurnamePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenNoPreviousName_thenReturnNull() { } @Test - void whenPreviousNameHasNoSurname_thenAmendmentIsNull() { + void When_PreviousNameHasNoSurname_Expect_AmendmentIsNull() { when(transaction.getPersonPreviousName()).thenReturn(Optional.of(personPreviousName)); when(personPreviousName.getFamilyName()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ResidentialInstituteCodePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ResidentialInstituteCodePatchTransactionMapperTest.java index 6b53c84b9..ebebcd98d 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ResidentialInstituteCodePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ResidentialInstituteCodePatchTransactionMapperTest.java @@ -35,7 +35,7 @@ public static void setUp() { @Test - void whenResidentialInstitutionPresent_thenMapIntoResidentialInstitutionCodeAmendmentPatch() { + void When_ResidentialInstitutionPresent_Expect_MapIntoResidentialInstitutionCodeAmendmentPatch() { when(transaction.getResidentialInstitution()).thenReturn(Optional.of(residentialInstituteNameAndAddress)); when(residentialInstituteNameAndAddress.getIdentifier()).thenReturn(IDENTIFIER); @@ -45,7 +45,7 @@ void whenResidentialInstitutionPresent_thenMapIntoResidentialInstitutionCodeAmen } @Test - void whenResidentialInstituteNotPresent_thenReturnNull() { + void When_ResidentialInstituteNotPresent_Expect_ReturnNull() { when(transaction.getResidentialInstitution()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = residentialInstituteCodePatchTransactionMapper.map(transaction); @@ -54,7 +54,7 @@ void whenResidentialInstituteNotPresent_thenReturnNull() { } @Test - void whenResidentialInstituteCodeIsRemoveIndication_thenReturnValueIsNull() { + void When_ResidentialInstituteCodeIsRemoveIndication_Expect_ReturnValueIsNull() { when(transaction.getResidentialInstitution()).thenReturn(Optional.of(residentialInstituteNameAndAddress)); when(residentialInstituteNameAndAddress.getIdentifier()).thenReturn(REMOVE_INDICATOR); @@ -64,7 +64,7 @@ void whenResidentialInstituteCodeIsRemoveIndication_thenReturnValueIsNull() { } @Test - void whenResidentialInstituteCodeIsNull_thenReturnValueIsNull() { + void When_ResidentialInstituteCodeIsNull_Expect_ReturnValueIsNull() { when(transaction.getResidentialInstitution()).thenReturn(Optional.of(residentialInstituteNameAndAddress)); when(residentialInstituteNameAndAddress.getIdentifier()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SecondForenamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SecondForenamePatchTransactionMapperTest.java index 2f3d84645..07edd7b8c 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SecondForenamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SecondForenamePatchTransactionMapperTest.java @@ -35,7 +35,7 @@ public static void setUp() { @Test - void whenPersonNameAndSecondNamePresent_thenMapIntoSecondForenameAmendmentPatch() { + void When_PersonNameAndSecondNamePresent_Expect_MapIntoSecondForenameAmendmentPatch() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getSecondForename()).thenReturn(SECOND_FORENAME); @@ -45,7 +45,7 @@ void whenPersonNameAndSecondNamePresent_thenMapIntoSecondForenameAmendmentPatch( } @Test - void whenPersonNameNotPresent_thenReturnNull() { + void When_PersonNameNotPresent_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = secondForenamePatchTransactionMapper.map(transaction); @@ -54,7 +54,7 @@ void whenPersonNameNotPresent_thenReturnNull() { } @Test - void whenPersonNamePresentNoSecondForename_thenReturnNull() { + void When_PersonNamePresentNoSecondForename_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getSecondForename()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SurnamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SurnamePatchTransactionMapperTest.java index d35a4793e..a0555774e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SurnamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/SurnamePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonNameAndSurnamePresent_thenMapIntoSurnameAmendmentPatch() { + void When_PersonNameAndSurnamePresent_Expect_MapIntoSurnameAmendmentPatch() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getSurname()).thenReturn(SURNAME); @@ -46,7 +46,7 @@ void whenPersonNameAndSurnamePresent_thenMapIntoSurnameAmendmentPatch() { } @Test - void whenPersonNAmeNotPresent_thenReturnNull() { + void When_PersonNAmeNotPresent_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = surnamePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonNAmeNotPresent_thenReturnNull() { } @Test - void whenPersonNameHasNoSurname_thenReturnNull() { + void When_PersonNameHasNoSurname_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getSurname()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ThirdForenamePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ThirdForenamePatchTransactionMapperTest.java index 82d5129a9..15c601a0f 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ThirdForenamePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/ThirdForenamePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonNameAndOtherForenamePresent_thenMapIntoThirdForenameAmendmentPatch() { + void When_PersonNameAndOtherForenamePresent_Expect_MapIntoThirdForenameAmendmentPatch() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getOtherForenames()).thenReturn(THIRD_NAME); @@ -46,7 +46,7 @@ void whenPersonNameAndOtherForenamePresent_thenMapIntoThirdForenameAmendmentPatc } @Test - void whenPersonNamesNotPresent_thenReturnNull() { + void When_PersonNamesNotPresent_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = thirdForenamePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonNamesNotPresent_thenReturnNull() { } @Test - void whenPersonNameHasNoOtherForename_thenReturnNull() { + void When_PersonNameHasNoOtherForename_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getOtherForenames()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/TitlePatchTransactionMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/TitlePatchTransactionMapperTest.java index 65b4ed015..f4c45fbc2 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/TitlePatchTransactionMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/mapper/TitlePatchTransactionMapperTest.java @@ -36,7 +36,7 @@ public static void setUp() { @Test - void whenPersonNameAndTitlePresent_thenMapIntoTitleAmendmentPatch() { + void When_PersonNameAndTitlePresent_Expect_MapIntoTitleAmendmentPatch() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getTitle()).thenReturn(TITLE); @@ -46,7 +46,7 @@ void whenPersonNameAndTitlePresent_thenMapIntoTitleAmendmentPatch() { } @Test - void whenPersonNameNotPresent_thenReturnNull() { + void When_PersonNameNotPresent_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.empty()); AmendmentPatch amendmentPatch = titlePatchTransactionMapper.map(transaction); @@ -55,7 +55,7 @@ void whenPersonNameNotPresent_thenReturnNull() { } @Test - void whenPersonNameHasNoTitle_thenReturnNull() { + void When_PersonNameHasNoTitle_Expect_ReturnNull() { when(transaction.getPersonName()).thenReturn(Optional.of(personName)); when(personName.getTitle()).thenReturn(null); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/queue/InboundQueueServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/queue/InboundQueueServiceTest.java index 79555cb22..c44e0922f 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/queue/InboundQueueServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/queue/InboundQueueServiceTest.java @@ -72,7 +72,7 @@ public class InboundQueueServiceTest { private Message message; @Test - public void when_receive_registrationMessage_then_handledByRegistrationConsumerService() throws Exception { + public void When_ReceiveRegistrationMessage_Expect_HandledByRegistrationConsumerService() throws Exception { when(message.getBody(String.class)).thenReturn("{\"workflowId\":\"NHAIS_REG\"}"); when(message.getStringProperty(JmsHeaders.CONVERSATION_ID)).thenReturn(CONVERSATION_ID); @@ -87,7 +87,7 @@ public void when_receive_registrationMessage_then_handledByRegistrationConsumerS } @Test - public void when_receive_registrationMessage_registrationConsumerServiceThrowsException_noAck() throws Exception { + public void When_ReceiveRegistrationMessage_Expect_RegistrationConsumerServiceThrowsExceptionWithNoAck() throws Exception { when(message.getBody(String.class)).thenReturn("{\"workflowId\":\"NHAIS_REG\"}"); when(message.getStringProperty(JmsHeaders.CONVERSATION_ID)).thenReturn(CONVERSATION_ID); doThrow(RuntimeException.class).when(registrationConsumerService).handleRegistration(any(MeshMessage.class)); @@ -100,7 +100,7 @@ public void when_receive_registrationMessage_registrationConsumerServiceThrowsEx } @Test - public void when_receive_recepMessage_handledByRecepConsumerService() throws Exception { + public void When_Receive_RecepMessage_Expect_HandledByRecepConsumerService() throws Exception { when(message.getBody(String.class)).thenReturn("{\"workflowId\":\"NHAIS_RECEP\"}"); when(message.getStringProperty(JmsHeaders.CONVERSATION_ID)).thenReturn(CONVERSATION_ID); @@ -115,7 +115,7 @@ public void when_receive_recepMessage_handledByRecepConsumerService() throws Exc } @Test - public void when_receive_registrationMessage_recepConsumerServiceThrowsException_noAck() throws Exception { + public void When_ReceiveRegistrationMessage_Expect_RecepConsumerServiceThrowsExceptionWithNoAck() throws Exception { when(message.getBody(String.class)).thenReturn("{\"workflowId\":\"NHAIS_RECEP\"}"); when(message.getStringProperty(JmsHeaders.CONVERSATION_ID)).thenReturn(CONVERSATION_ID); doThrow(RuntimeException.class).when(recepConsumerService).handleRecep(any(MeshMessage.class)); @@ -128,7 +128,7 @@ public void when_receive_registrationMessage_recepConsumerServiceThrowsException } @Test - public void when_receive_unknownWorkflow_throwsUnknownWorkflowException_noAck() throws Exception{ + public void When_ReceiveUnknownWorkflow_Expect_ThrowsUnknownWorkflowExceptionWithNoAck() throws Exception{ when(message.getBody(String.class)).thenReturn("{}"); when(message.getStringProperty(JmsHeaders.CONVERSATION_ID)).thenReturn(CONVERSATION_ID); @@ -141,7 +141,7 @@ public void when_receive_unknownWorkflow_throwsUnknownWorkflowException_noAck() } @Test - public void when_publish_inboundMessageFromMesh_thenTimestampAndConversationIdAreSet() throws Exception { + public void When_PublishInboundMessageFromMesh_Expect_TimestampAndConversationIdAreSet() throws Exception { final var now = Instant.now(); when(timestampService.getCurrentTimestamp()).thenReturn(now); final var messageSentTimestamp = "2020-06-12T14:15:16Z"; diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/state/InboundStateFactoryTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/state/InboundStateFactoryTest.java index f1088326d..e3bfc9b0e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/state/InboundStateFactoryTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/state/InboundStateFactoryTest.java @@ -96,14 +96,14 @@ void setUp() { } @Test - void whenFromInterchangeCalled_thenInboundStateObjectIsCreated() { + void When_FromInterchangeCalled_Expect_InboundStateObjectIsCreated() { when(inboundOperationIdService.createOperationIdForTransaction(TRANSACTION)).thenReturn(OPERATION_ID); var inboundStateFromInterchange = inboundStateFactory.fromTransaction(TRANSACTION); assertThat(inboundStateFromInterchange).isEqualTo(EXPECTED_INTERCHANGE_INBOUND_STATE); } @Test - void whenFromRecepCalled_thenInboundStateObjectIsCreated() { + void When_FromRecepCalled_Expect_InboundStateObjectIsCreated() { var inboundStateFromInterchange = inboundStateFactory.fromRecep(MESSAGE); assertThat(inboundStateFromInterchange).isEqualTo(EXPECTED_RECEP_INBOUND_STATE); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshMailBoxSchedulerTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshMailBoxSchedulerTest.java index 6aada463a..a90a7f23a 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshMailBoxSchedulerTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshMailBoxSchedulerTest.java @@ -33,7 +33,7 @@ public class MeshMailBoxSchedulerTest { private ApplicationContext applicationContext; @Test - public void When_CollectionIsEmpty_Then_SingleDocumentIsCreatedAndTheJobIsNotExecuted() { + public void When_CollectionIsEmpty_Expect_SingleDocumentIsCreatedAndTheJobIsNotExecuted() { when(schedulerTimestampRepository.updateTimestamp(anyString(), isA(Instant.class), anyLong())).thenReturn(false); when(timestampService.getCurrentTimestamp()).thenReturn(Instant.now()); @@ -43,7 +43,7 @@ public void When_CollectionIsEmpty_Then_SingleDocumentIsCreatedAndTheJobIsNotExe } @Test - public void When_DocumentExistsAndTimestampIsBeforeProvidedTime_Then_DocumentIsUpdateAndTheJobIsExecuted() { + public void When_DocumentExistsAndTimestampIsBeforeProvidedTime_Expect_DocumentIsUpdateAndTheJobIsExecuted() { when(schedulerTimestampRepository.updateTimestamp(anyString(), isA(Instant.class), anyLong())).thenReturn(true); when(timestampService.getCurrentTimestamp()).thenReturn(Instant.now()); @@ -53,7 +53,7 @@ public void When_DocumentExistsAndTimestampIsBeforeProvidedTime_Then_DocumentIsU } @Test - public void When_DocumentExistsAndTimestampIsAfterProvidedTime_Then_DocumentIsNotUpdateAndTheJobIsNotExecuted() { + public void When_DocumentExistsAndTimestampIsAfterProvidedTime_Expect_DocumentIsNotUpdateAndTheJobIsNotExecuted() { when(schedulerTimestampRepository.updateTimestamp(anyString(), isA(Instant.class), anyLong())).thenReturn(false); when(timestampService.getCurrentTimestamp()).thenReturn(Instant.now()); @@ -63,7 +63,7 @@ public void When_DocumentExistsAndTimestampIsAfterProvidedTime_Then_DocumentIsNo } @Test - void When_SchedulerIsDisabled_Then_ReturnFalse() { + void When_SchedulerIsDisabled_Expect_ReturnFalse() { Environment environment = mock(Environment.class); when(environment.getProperty("nhais.scheduler.enabled")).thenReturn("false"); when(applicationContext.getEnvironment()).thenReturn(environment); @@ -72,7 +72,7 @@ void When_SchedulerIsDisabled_Then_ReturnFalse() { } @Test - void When_SchedulerIsEnabled_Then_ReturnTrue() { + void When_SchedulerIsEnabled_Expect_ReturnTrue() { Environment environment = mock(Environment.class); when(environment.getProperty("nhais.scheduler.enabled")).thenReturn("true"); when(applicationContext.getEnvironment()).thenReturn(environment); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshRequestsTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshRequestsTest.java index 14d6101dc..b268aafe0 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshRequestsTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshRequestsTest.java @@ -27,7 +27,7 @@ class MeshRequestsTest { private final MeshHeaders meshHeaders = new MeshHeaders(meshConfig); @Test - void When_GettingMessage_Then_ExpectHttpGetAndCorrectUri() { + void When_GettingMessage_Expect_ExpectHttpGetAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); var request = meshRequests.getMessage("messageId"); @@ -37,7 +37,7 @@ void When_GettingMessage_Then_ExpectHttpGetAndCorrectUri() { } @Test - void When_SendingRegistrationMessage_Then_ExpectHttpPostAndCorrectUri() { + void When_SendingRegistrationMessage_Expect_ExpectHttpPostAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); String recipient = "recipient"; @@ -47,7 +47,7 @@ void When_SendingRegistrationMessage_Then_ExpectHttpPostAndCorrectUri() { } @Test - void When_SendingRecepMessage_Then_ExpectHttpPostAndCorrectUri() { + void When_SendingRecepMessage_Expect_ExpectHttpPostAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); String recipient = "recipient"; @@ -57,7 +57,7 @@ void When_SendingRecepMessage_Then_ExpectHttpPostAndCorrectUri() { } @Test - void When_GettingMessageIds_Then_ExpectHttpGetAndCorrectUri() { + void When_GettingMessageIds_Expect_ExpectHttpGetAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); var request = meshRequests.getMessageIds(); @@ -67,7 +67,7 @@ void When_GettingMessageIds_Then_ExpectHttpGetAndCorrectUri() { } @Test - void When_AcknowledgeMessage_Then_ExpectHttpPutAndCorrectUri() { + void When_AcknowledgeMessage_Expect_ExpectHttpPutAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); var request = meshRequests.acknowledge("messageId"); @@ -77,7 +77,7 @@ void When_AcknowledgeMessage_Then_ExpectHttpPutAndCorrectUri() { } @Test - void When_Authenticate_Then_ExpectHttpPostAndCorrectUri() { + void When_Authenticate_Expect_ExpectHttpPostAndCorrectUri() { MeshRequests meshRequests = new MeshRequests(meshConfig, meshHeaders); var request = meshRequests.authenticate(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshServiceTest.java index de1ca14f1..fdea521ee 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/MeshServiceTest.java @@ -67,7 +67,7 @@ public void setUp() { } @Test - public void When_IntervalPassedAndMessagesFound_Then_DownloadAndPublishAllMessages() { + public void When_IntervalPassedAndMessagesFound_Expect_DownloadAndPublishAllMessages() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of(MESSAGE_ID1, MESSAGE_ID2)); @@ -90,7 +90,7 @@ public void When_IntervalPassedAndMessagesFound_Then_DownloadAndPublishAllMessag } @Test - public void When_IntervalHasPassed_DurationExceeded_Then_StopDownloading() { + public void When_IntervalHasPassed_DurationExceeded_Expect_StopDownloading() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of(MESSAGE_ID1, MESSAGE_ID2)); @@ -112,7 +112,7 @@ public void When_IntervalHasPassed_DurationExceeded_Then_StopDownloading() { } @Test - public void When_IntervalPassedAndRequestToGetMessageListFails_Then_DoNotPublishAndAcknowledgeMessages() { + public void When_IntervalPassedAndRequestToGetMessageListFails_Expect_DoNotPublishAndAcknowledgeMessages() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenThrow(new MeshApiConnectionException("error")); @@ -128,7 +128,7 @@ public void When_IntervalPassedAndRequestToGetMessageListFails_Then_DoNotPublish } @Test - public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Then_DoNotPublishAndAcknowledgeMessage() { + public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Expect_DoNotPublishAndAcknowledgeMessage() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of(ERROR_MESSAGE_ID)); @@ -146,7 +146,7 @@ public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Then_DoNotPu } @Test - public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Then_SkipMessageAndDownloadNextOne() { + public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Expect_SkipMessageAndDownloadNextOne() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of(ERROR_MESSAGE_ID, MESSAGE_ID1)); @@ -166,7 +166,7 @@ public void When_IntervalPassedAndRequestToDownloadMeshMessageFails_Then_SkipMes } @Test - public void When_IntervalPassedAndAcknowledgeMeshMessageFails_Then_SkipMessageAndDownloadNextOne() { + public void When_IntervalPassedAndAcknowledgeMeshMessageFails_Expect_SkipMessageAndDownloadNextOne() { MeshMessage messageForAckError = new MeshMessage(); messageForAckError.setMeshMessageId(ERROR_MESSAGE_ID); @@ -193,7 +193,7 @@ public void When_IntervalPassedAndAcknowledgeMeshMessageFails_Then_SkipMessageAn } @Test - public void When_IntervalPassedAndPublishingToQueueFails_Then_DoNotAcknowledgeMessage() { + public void When_IntervalPassedAndPublishingToQueueFails_Expect_DoNotAcknowledgeMessage() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of(MESSAGE_ID1)); @@ -212,7 +212,7 @@ public void When_IntervalPassedAndPublishingToQueueFails_Then_DoNotAcknowledgeMe } @Test - public void When_IntervalHasNotPassed_Then_DoNothing() { + public void When_IntervalHasNotPassed_Expect_DoNothing() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(false); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); @@ -224,7 +224,7 @@ public void When_IntervalHasNotPassed_Then_DoNothing() { } @Test - public void When_IntervalHasPassedButNoMessagesFound_Then_DoNothing() { + public void When_IntervalHasPassedButNoMessagesFound_Expect_DoNothing() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); when(meshClient.getInboxMessageIds()).thenReturn(List.of()); @@ -237,7 +237,7 @@ public void When_IntervalHasPassedButNoMessagesFound_Then_DoNothing() { } @Test - public void When_IntervalHasPassedButAuthenticationFails_Then_StopProcessing() { + public void When_IntervalHasPassedButAuthenticationFails_Expect_StopProcessing() { when(meshMailBoxScheduler.hasTimePassed(scanDelayInSeconds)).thenReturn(true); when(meshMailBoxScheduler.isEnabled()).thenReturn(true); doThrow(new MeshApiConnectionException("Auth fail", HttpStatus.OK, HttpStatus.INTERNAL_SERVER_ERROR)).when(meshClient).authenticate(); @@ -251,7 +251,7 @@ public void When_IntervalHasPassedButAuthenticationFails_Then_StopProcessing() { } @Test - public void When_SchedulerIsDisabled_Then_DoNothing() { + public void When_SchedulerIsDisabled_Expect_DoNothing() { when(meshMailBoxScheduler.isEnabled()).thenReturn(false); meshService.scanMeshInboxForMessages(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/scheduler/SchedulerTimestampRepositoryExtensionTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/scheduler/SchedulerTimestampRepositoryExtensionTest.java index d6e948c72..c830c6ca7 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/scheduler/SchedulerTimestampRepositoryExtensionTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/mesh/scheduler/SchedulerTimestampRepositoryExtensionTest.java @@ -55,7 +55,7 @@ public void whenCollectionDoesNotExistCreateDocumentAndReturnFalse() { } @Test - public void whenUnableToCreateInitialDocument_mongoException_thenReturnFalse() { + public void When_UnableToCreateInitialDocumentWithMongoException_Expect_ReturnFalse() { when(mongoOperations.count(any(Query.class), eq(MESH_TIMESTAMP_COLLECTION_NAME))).thenReturn(0L); when(timestampService.getCurrentTimestamp()).thenReturn(Instant.now()); MongoWriteException exception = mock(MongoWriteException.class); @@ -67,7 +67,7 @@ public void whenUnableToCreateInitialDocument_mongoException_thenReturnFalse() { } @Test - public void whenUnableToCreateInitialDocument_springException_thenReturnFalse() { + public void When_UnableToCreateInitialDocumentWithSpringException_Expect_ReturnFalse() { when(mongoOperations.count(any(Query.class), eq(MESH_TIMESTAMP_COLLECTION_NAME))).thenReturn(0L); when(timestampService.getCurrentTimestamp()).thenReturn(Instant.now()); DuplicateKeyException exception = mock(DuplicateKeyException.class); @@ -79,7 +79,7 @@ public void whenUnableToCreateInitialDocument_springException_thenReturnFalse() } @Test - public void whenUpdatedThenReturnTrue() { + public void When_Updated_Expect_ReturnTrue() { when(mongoOperations.count(any(Query.class), eq(MESH_TIMESTAMP_COLLECTION_NAME))).thenReturn(1L); when(mongoOperations.updateFirst(isA(Query.class), isA(UpdateDefinition.class), isA(String.class))).thenReturn(updateResult); @@ -92,7 +92,7 @@ public void whenUpdatedThenReturnTrue() { } @Test - public void whenNotUpdatedThenReturnFalse() { + public void When_NotUpdated_Expect_ReturnFalse() { when(mongoOperations.count(any(Query.class), eq(MESH_TIMESTAMP_COLLECTION_NAME))).thenReturn(1L); when(mongoOperations.updateFirst(isA(Query.class), isA(UpdateDefinition.class), isA(String.class))).thenReturn(updateResult); @@ -103,5 +103,4 @@ public void whenNotUpdatedThenReturnFalse() { assertThat(updated).isFalse(); } - } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceCodeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceCodeTest.java index 832d4ea7d..e2a5a7b26 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceCodeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceCodeTest.java @@ -9,7 +9,7 @@ public class AcceptanceCodeTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "HEA+ACD+A:ZZZ'"; var acceptanceCode = AcceptanceCode.builder() @@ -20,7 +20,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingWithWrongCode_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingWithWrongCode_Expect_EdifactValidationExceptionIsThrown() { var acceptanceCode = AcceptanceCode.builder() .code("B") .build(); @@ -29,7 +29,7 @@ public void When_MappingWithWrongCode_Then_EdifactValidationExceptionIsThrown() } @Test - public void When_MappingToEdifactWithEmptyType_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithEmptyType_Expect_EdifactValidationExceptionIsThrown() { var acceptanceCode = AcceptanceCode.builder() .code("") .build(); @@ -38,7 +38,7 @@ public void When_MappingToEdifactWithEmptyType_Then_EdifactValidationExceptionIs } @Test - public void When_BuildingWithoutType_Then_IsThrown() { + public void When_BuildingWithoutType_Expect_IsThrown() { assertThrows(NullPointerException.class, () -> AcceptanceCode.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceDateTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceDateTest.java index 6fb7fc865..dd06f47fa 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceDateTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceDateTest.java @@ -12,7 +12,7 @@ public class AcceptanceDateTest { private final LocalDate DATE = LocalDate.of(2020, 3, 28); @Test - public void When_toEdifact_And_instantInWinter_Then_edifactIsCorrect() throws EdifactValidationException { + public void When_ToEdifactAndInstantInWinter_Expect_EdifactIsCorrect() throws EdifactValidationException { assertThat(new AcceptanceDate(DATE).toEdifact()).isEqualTo("DTM+956:20200328:102'"); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceTypeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceTypeTest.java index 6288a0864..de2eeafa6 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceTypeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/AcceptanceTypeTest.java @@ -9,7 +9,7 @@ public class AcceptanceTypeTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "HEA+ATP+1:ZZZ'"; var acceptanceType = AcceptanceType.builder() @@ -20,7 +20,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_BuildingWithoutType_Then_IsThrown() { + public void When_BuildingWithoutType_Expect_IsThrown() { assertThrows(NullPointerException.class, () -> AcceptanceType.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionDateTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionDateTest.java index 1621f7f71..4c44563da 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionDateTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionDateTest.java @@ -10,20 +10,20 @@ public class DeductionDateTest { @Test - public void When_deductionDateToEdifact_Then_edifactFormattedCorrectly() { + public void When_DeductionDateToEdifact_Expect_EdifactFormattedCorrectly() { DeductionDate deductionDate = new DeductionDate(LocalDate.parse("2005-01-15")); assertThat(deductionDate.toEdifact()).isEqualTo("DTM+961:20050115:102'"); } @Test - void When_fromStringWithValidInput_Then_SegmentCreated() { + void When_FromStringWithValidInput_Expect_SegmentCreated() { DeductionDate deductionDate = DeductionDate.fromString("DTM+961:20050115:102"); DeductionDate expectedDeductionDate = new DeductionDate(LocalDate.of(2005,1,15)); assertThat(deductionDate.getValue()).isEqualTo(expectedDeductionDate.getValue()); } @Test - void When_fromStringWithInvalidInput_Then_ExceptionThrown() { + void When_FromStringWithInvalidInput_Expect_ExceptionThrown() { assertThatThrownBy(() -> DeductionDate.fromString("DTM+96999:20050115:102")) .isExactlyInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionReasonCodeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionReasonCodeTest.java index 34f87f8a0..dad2cbea5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionReasonCodeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/DeductionReasonCodeTest.java @@ -9,7 +9,7 @@ public class DeductionReasonCodeTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "GIS+11:ZZZ'"; var deductionReasonCode = DeductionReasonCode.builder() @@ -20,7 +20,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithEmptyType_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithEmptyType_Expect_EdifactValidationExceptionIsThrown() { var deductionReasonCode = DeductionReasonCode.builder() .code("") .build(); @@ -29,14 +29,14 @@ public void When_MappingToEdifactWithEmptyType_Then_EdifactValidationExceptionIs } @Test - void When_fromStringWithValidInput_Then_SegmentCreated() { + void When_FromStringWithValidInput_Expect_SegmentCreated() { DeductionReasonCode deductionReasonCode = DeductionReasonCode.fromString("GIS+1:ZZZ"); DeductionReasonCode expectedDeductionReasonCode = new DeductionReasonCode("1"); assertThat(deductionReasonCode.getValue()).isEqualTo(expectedDeductionReasonCode.getValue()); } @Test - void When_fromStringWithInvalidInput_Then_ExceptionThrown() { + void When_FromStringWithInvalidInput_Expect_ExceptionThrown() { assertThatThrownBy(() -> DeductionReasonCode.fromString("XXX+1:ZZZ")) .isExactlyInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ExpiryDateTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ExpiryDateTest.java index fb0e2a8d4..68ad54da4 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ExpiryDateTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ExpiryDateTest.java @@ -10,7 +10,7 @@ class FP69ExpiryDateTest { @Test - void whenSettingNullTimestamp_expectException() { + void When_SettingNullTimestamp_Expect_Exception() { assertThatThrownBy(() -> new FP69ExpiryDate(null)) .isInstanceOf(NullPointerException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ReasonCodeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ReasonCodeTest.java index c71df6c17..c1154c1d9 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ReasonCodeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/FP69ReasonCodeTest.java @@ -8,7 +8,7 @@ class FP69ReasonCodeTest { @Test - void whenSettingNullCode_expectException() { + void When_SettingNullCode_Expect_Exception() { assertThatThrownBy(() -> new FP69ReasonCode(null)) .isInstanceOf(NullPointerException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/GpNameAndAddressTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/GpNameAndAddressTest.java index e315e65a8..674239b7f 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/GpNameAndAddressTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/GpNameAndAddressTest.java @@ -51,7 +51,7 @@ void testFromString() { } @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "NAD+GP+4826940,281:900'"; var personGP = GpNameAndAddress.builder() @@ -63,7 +63,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithEmptyMandatoryFields_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithEmptyMandatoryFields_Expect_EdifactValidationExceptionIsThrown() { var personGP = GpNameAndAddress.builder() .identifier("") .code("") @@ -73,7 +73,7 @@ public void When_MappingToEdifactWithEmptyMandatoryFields_Then_EdifactValidation } @Test - public void When_BuildingWithoutMandatoryFields_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithoutMandatoryFields_Expect_NullPointerExceptionIsThrown() { assertThrows(NullPointerException.class, () -> GpNameAndAddress.builder().build()); } } \ No newline at end of file diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/NewHealthAuthorityNameTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/NewHealthAuthorityNameTest.java index b25563833..d4ce13a87 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/NewHealthAuthorityNameTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/NewHealthAuthorityNameTest.java @@ -38,14 +38,14 @@ void preValidate() { } @Test - void When_fromStringWithValidInput_Then_SegmentCreated() { + void When_FromStringWithValidInput_Expect_SegmentCreated() { NewHealthAuthorityName newHealthAuthorityName = NewHealthAuthorityName.fromString("NAD+NFH+ID1:954"); NewHealthAuthorityName expectedNewHealthAuthorityName = new NewHealthAuthorityName(IDENTIFIER); assertThat(newHealthAuthorityName.getValue()).isEqualTo(expectedNewHealthAuthorityName.getValue()); } @Test - void When_fromStringWithInvalidInput_Then_ExceptionThrown() { + void When_FromStringWithInvalidInput_Expect_ExceptionThrown() { assertThatThrownBy(() -> DeductionDate.fromString("DTM+96999:20050115:102")) .isExactlyInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PartyQualifierTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PartyQualifierTest.java index 6061503b8..929307471 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PartyQualifierTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PartyQualifierTest.java @@ -9,7 +9,7 @@ public class PartyQualifierTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "NAD+FHS+XX1:954'"; var partyQualifier = PartyQualifier.builder() @@ -20,7 +20,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithEmptyHA_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithEmptyHA_Expect_EdifactValidationExceptionIsThrown() { var partyQualifier = PartyQualifier.builder() .organization("") .build(); @@ -29,7 +29,7 @@ public void When_MappingToEdifactWithEmptyHA_Then_EdifactValidationExceptionIsTh } @Test - public void When_BuildingWithoutOrganization_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithoutOrganization_Expect_NullPointerExceptionIsThrown() { assertThrows(NullPointerException.class, () -> PartyQualifier.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonAddressTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonAddressTest.java index 12c35669f..a4859323b 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonAddressTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonAddressTest.java @@ -9,7 +9,7 @@ public class PersonAddressTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "NAD+PAT++MOORSIDE FARM:OLD LANE:ST PAULS CRAY:ORPINGTON:KENT'"; var personAddress = PersonAddress.builder() @@ -24,7 +24,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifacWithPostcodet_Then_ReturnCorrectString() { + public void When_MappingToEdifacWithPostcodet_Expect_ReturnCorrectString() { var expectedValue = "NAD+PAT++HIGHFIELD HOUSE:LOW PASS:HAYFIELD HAMLET:GRASSFUL:FIELDING+++++HR3 5BW'"; var personAddress = PersonAddress.builder() @@ -40,7 +40,7 @@ public void When_MappingToEdifacWithPostcodet_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithMissingFields_Then_ReturnCorrectString() { + public void When_MappingToEdifactWithMissingFields_Expect_ReturnCorrectString() { var expectedValue = "NAD+PAT++??:MOORSIDE FARM:ST PAULS CRAY::KENT'"; var personAddress = PersonAddress.builder() @@ -53,7 +53,7 @@ public void When_MappingToEdifactWithMissingFields_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithoutMandatoryAddressLines_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithoutMandatoryAddressLines_Expect_EdifactValidationExceptionIsThrown() { var personAddress = PersonAddress.builder() .addressLine3("test value") .build(); @@ -63,7 +63,7 @@ public void When_MappingToEdifactWithoutMandatoryAddressLines_Then_EdifactValida } @Test - public void When_MappingToEdifactWithBlankMandatoryAddressLines_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithBlankMandatoryAddressLines_Expect_EdifactValidationExceptionIsThrown() { var personAddress = PersonAddress.builder() .addressLine1("") .addressLine2(" ") diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfBirthTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfBirthTest.java index 874291932..31d5c49bf 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfBirthTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfBirthTest.java @@ -11,7 +11,7 @@ public class PersonDateOfBirthTest { private static final LocalDate FIXED_TIME = LocalDate.of(1991, 11, 6); @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "DTM+329:19911106:102'"; var personDob = PersonDateOfBirth.builder() @@ -22,7 +22,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_BuildingWithEmptyTimestamp_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithEmptyTimestamp_Expect_NullPointerExceptionIsThrown() { assertThrows(NullPointerException.class, () -> PersonDateOfBirth.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfEntryTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfEntryTest.java index 369ac595e..3651a5f9d 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfEntryTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfEntryTest.java @@ -12,13 +12,13 @@ public class PersonDateOfEntryTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var personDateOfEntry = new PersonDateOfEntry(LOCAL_DATE); assertThat(personDateOfEntry.toEdifact()).isEqualTo("DTM+957:19910113:102'"); } @Test - public void When_BuildingWithEmptyTimestamp_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithEmptyTimestamp_Expect_NullPointerExceptionIsThrown() { assertThatThrownBy(() -> new PersonDateOfEntry(null)) .isExactlyInstanceOf(NullPointerException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfExitTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfExitTest.java index 260791905..5eafbfdc1 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfExitTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonDateOfExitTest.java @@ -13,14 +13,14 @@ class PersonDateOfExitTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var personDateOfExit = new PersonDateOfExit(FIXED_TIME); assertThat(personDateOfExit.toEdifact()).isEqualTo("DTM+958:19920113:102'"); } @Test - public void When_BuildingWithEmptyTimestamp_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithEmptyTimestamp_Expect_NullPointerExceptionIsThrown() { assertThatThrownBy(() -> new PersonDateOfExit(null)) .isExactlyInstanceOf(NullPointerException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonNameTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonNameTest.java index 4b9019b1b..d9352864b 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonNameTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonNameTest.java @@ -18,7 +18,7 @@ public class PersonNameTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() throws EdifactValidationException { + public void When_MappingToEdifact_Expect_ReturnCorrectString() throws EdifactValidationException { var expectedValue = "PNA+PAT+1234567890:OPI+++SU:STEVENS+FO:CHARLES+TI:MR+MI:ANTHONY+FS:JOHN'"; var personName = PersonName.builder() @@ -35,7 +35,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() throws EdifactValid } @Test - public void When_BuildingNameWithTypeOnly_Then_ReturnCorrectValue() { + public void When_BuildingNameWithTypeOnly_Expect_ReturnCorrectValue() { var expectedValue = "PNA+PAT+T247:OPI'"; var personName = PersonName.builder() @@ -47,7 +47,7 @@ public void When_BuildingNameWithTypeOnly_Then_ReturnCorrectValue() { } @Test - public void When_BuildingEmptyName_Then_ReturnEmptySegment() { + public void When_BuildingEmptyName_Expect_ReturnEmptySegment() { var expectedValue = "PNA+PAT'"; var personName = PersonName.builder() @@ -81,7 +81,7 @@ void testFromString() { } @Test - void when_BlankNhsNumber_Then_ReturnNull() { + void When_BlankNhsNumber_Expect_ReturnNull() { assertThat(PersonName.fromString(BLANK_NHS_VALUE).getNhsNumber()).isNull(); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonOldAddressTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonOldAddressTest.java index c3424a547..df6768581 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonOldAddressTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonOldAddressTest.java @@ -9,7 +9,7 @@ public class PersonOldAddressTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "NAD+PER++MOORSIDE FARM:OLD LANE:ST PAULS CRAY:ORPINGTON:KENT'"; var personOldAddress = PersonOldAddress.builder() @@ -24,7 +24,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithMissingFields_Then_ReturnCorrectString() { + public void When_MappingToEdifactWithMissingFields_Expect_ReturnCorrectString() { var expectedValue = "NAD+PER++MOORSIDE FARM:ST PAULS CRAY:KENT'"; var personOldAddress = PersonOldAddress.builder() @@ -39,7 +39,7 @@ public void When_MappingToEdifactWithMissingFields_Then_ReturnCorrectString() { } @Test - void When_MappingEmptyAddress_Then_ThrowException() { + void When_MappingEmptyAddress_Expect_ThrowException() { var personOldAddress = PersonOldAddress.builder() .build(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonPreviousNameTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonPreviousNameTest.java index 40edcac52..f84aae15d 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonPreviousNameTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonPreviousNameTest.java @@ -18,7 +18,7 @@ class PersonPreviousNameTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() throws EdifactValidationException { + public void When_MappingToEdifact_Expect_ReturnCorrectString() throws EdifactValidationException { var expectedValue = "PNA+PER+1234567890:OPI+++SU:STEVENS+FO:CHARLES+TI:MR+MI:ANTHONY+FS:JOHN'"; var personName = PersonPreviousName.builder() @@ -35,7 +35,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() throws EdifactValid } @Test - public void When_BuildingNameWithTypeOnly_Then_ReturnCorrectValue() { + public void When_BuildingNameWithTypeOnly_Expect_ReturnCorrectValue() { var expectedValue = "PNA+PER+T247:OPI'"; var personName = PersonPreviousName.builder() @@ -47,7 +47,7 @@ public void When_BuildingNameWithTypeOnly_Then_ReturnCorrectValue() { } @Test - public void When_BuildingEmptyName_Then_ReturnEmptySegment() { + public void When_BuildingEmptyName_Expect_ReturnEmptySegment() { var expectedValue = "PNA+PER'"; var personName = PersonPreviousName.builder() diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonSexTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonSexTest.java index 2f0b844c4..272730b5a 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonSexTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PersonSexTest.java @@ -8,7 +8,7 @@ public class PersonSexTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "PDI+1'"; var personSex = PersonSex.builder() @@ -19,7 +19,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_BuildingWithoutType_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithoutType_Expect_NullPointerExceptionIsThrown() { assertThrows(NullPointerException.class, () -> PersonSex.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PreviousGpNameTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PreviousGpNameTest.java index fe11a3426..c749650dd 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PreviousGpNameTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/PreviousGpNameTest.java @@ -9,7 +9,7 @@ public class PreviousGpNameTest { @Test - public void When_MappingToEdifact_Then_ReturnCorrectString() { + public void When_MappingToEdifact_Expect_ReturnCorrectString() { var expectedValue = "NAD+PGP+++DR PREVIOUS'"; var personGPPrevious = PreviousGpName.builder() @@ -20,7 +20,7 @@ public void When_MappingToEdifact_Then_ReturnCorrectString() { } @Test - public void When_MappingToEdifactWithEmptyFields_Then_EdifactValidationExceptionIsThrown() { + public void When_MappingToEdifactWithEmptyFields_Expect_EdifactValidationExceptionIsThrown() { var personGPPrevious = PreviousGpName.builder() .partyName("") .build(); @@ -29,7 +29,7 @@ public void When_MappingToEdifactWithEmptyFields_Then_EdifactValidationException } @Test - public void When_BuildingWithoutMandatoryFields_Then_NullPointerExceptionIsThrown() { + public void When_BuildingWithoutMandatoryFields_Expect_NullPointerExceptionIsThrown() { assertThrows(NullPointerException.class, () -> PreviousGpName.builder().build()); } } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RecepMessageDateTimeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RecepMessageDateTimeTest.java index 641ccd1e1..789987b1b 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RecepMessageDateTimeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RecepMessageDateTimeTest.java @@ -20,29 +20,29 @@ public class RecepMessageDateTimeTest { .toInstant(); @Test - public void When_toEdifact_And_instantInWinter_Then_edifactIsUTC() throws EdifactValidationException { + public void When_ToEdifactAndInstantInWinter_Expect_EdifactIsUTC() throws EdifactValidationException { assertThat(new RecepMessageDateTime(WINTER).toEdifact()).isEqualTo("DTM+815:202003282058:306'"); } @Test - public void When_toEdifact_And_instantInSummer_Then_edifactIsBST() throws EdifactValidationException { + public void When_ToEdifactAndInstantInSummer_Expect_EdifactIsBST() throws EdifactValidationException { // the translated times are UK local time / BST and one hour "ahead" of UTC assertThat(new RecepMessageDateTime(SUMMER).toEdifact()).isEqualTo("DTM+815:202005282158:306'"); } @Test - void When_fromString_And_edifactIsWinterUTC_Then_instantIsUTC() { + void When_FromStringAndEdifactIsWinterUTC_Expect_InstantIsUTC() { assertThat(RecepMessageDateTime.fromString("DTM+815:202003282058:306'").getTimestamp()).isEqualTo(WINTER); } @Test - void When_fromString_And_edifactIsSummerBST_Then_instantIsUTC() { + void When_FromStringAndEdifactIsSummerBST_Expect_InstantIsUTC() { // the internal Instant representation (UTC) is one hour "behind" the EDIFACT timestamp which is UK local time / BST assertThat(RecepMessageDateTime.fromString("DTM+815:202005282158:306'").getTimestamp()).isEqualTo(SUMMER); } @Test - void When_fromString_And_stringIsNotDTMSegment_Then_throwsException() { + void When_FromStringAndStringIsNotDTMSegment_Expect_ThrowsException() { assertThatThrownBy(() -> RecepMessageDateTime.fromString("DTM+123:456:789'")).isExactlyInstanceOf(IllegalArgumentException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceInterchangeRecepTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceInterchangeRecepTest.java index 6ec5747cf..22264780e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceInterchangeRecepTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceInterchangeRecepTest.java @@ -11,7 +11,7 @@ @ExtendWith(SoftAssertionsExtension.class) class ReferenceInterchangeRecepTest { @Test - void whenGettingKey_thenReturnsProperValue() { + void When_GettingKey_Expect_ReturnsProperValue() { String key = new ReferenceInterchangeRecep( 123L, ReferenceInterchangeRecep.RecepCode.RECEIVED, 3) .getKey(); @@ -20,7 +20,7 @@ void whenGettingKey_thenReturnsProperValue() { } @Test - void whenGettingValue_thenReturnsProperValue() { + void When_GettingValue_Expect_ReturnsProperValue() { String value = new ReferenceInterchangeRecep( 123L, ReferenceInterchangeRecep.RecepCode.RECEIVED, 3) .getValue(); @@ -29,7 +29,7 @@ void whenGettingValue_thenReturnsProperValue() { } @Test - void whenPreValidatedDataViolatesNullChecks_thenThrowsException(SoftAssertions softly) { + void When_PreValidatedDataViolatesNullChecks_Expect_ThrowsException(SoftAssertions softly) { softly.assertThatThrownBy( () -> new ReferenceInterchangeRecep(null, ReferenceInterchangeRecep.RecepCode.RECEIVED, 3) .preValidate()) @@ -50,7 +50,7 @@ void whenPreValidatedDataViolatesNullChecks_thenThrowsException(SoftAssertions s } @Test - void whenParsing_thenRecepCreated() { + void When_Parsing_Expect_RecepCreated() { var recepRow = ReferenceInterchangeRecep.fromString("RFF+RIS:00000005 OK:4"); assertThat(recepRow.getInterchangeSequenceNumber()).isEqualTo(5L); @@ -71,7 +71,7 @@ void whenParsing_thenRecepCreated() { } @Test - void whenParsingRecepCodeFromCode_thenRecepCodeIsCreated(SoftAssertions softly) { + void When_ParsingRecepCodeFromCode_Expect_RecepCodeIsCreated(SoftAssertions softly) { var toParse = new String[] {"OK", "NA", "ER"}; for (int i = 0; i < ReferenceInterchangeRecep.RecepCode.values().length; i++) { diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceMessageRecepTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceMessageRecepTest.java index 8bcf34250..f0ad4519b 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceMessageRecepTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/ReferenceMessageRecepTest.java @@ -12,7 +12,7 @@ class ReferenceMessageRecepTest { @Test - void whenGettingKey_thenReturnsProperValue() { + void When_GettingKey_Expect_ReturnsProperValue() { String key = new ReferenceMessageRecep( 123L, ReferenceMessageRecep.RecepCode.ERROR) .getKey(); @@ -21,7 +21,7 @@ void whenGettingKey_thenReturnsProperValue() { } @Test - void whenGettingValue_thenReturnsProperValue() { + void When_GettingValue_Expect_ReturnsProperValue() { String value = new ReferenceMessageRecep( 123L, ReferenceMessageRecep.RecepCode.ERROR) .getValue(); @@ -30,7 +30,7 @@ void whenGettingValue_thenReturnsProperValue() { } @Test - void whenPreValidatedDataViolatesNullChecks_thenThrowsException(SoftAssertions softly) { + void When_PreValidatedDataViolatesNullChecks_Expect_ThrowsException(SoftAssertions softly) { softly.assertThatThrownBy( () -> new ReferenceMessageRecep(null, ReferenceMessageRecep.RecepCode.ERROR) .preValidate()) @@ -45,7 +45,7 @@ void whenPreValidatedDataViolatesNullChecks_thenThrowsException(SoftAssertions s } @Test - void whenParsing_thenRecepCreated(SoftAssertions softly) { + void When_Parsing_Expect_RecepCreated(SoftAssertions softly) { var recepRow = ReferenceMessageRecep.fromString("RFF+MIS:00000005 CP"); softly.assertThat(recepRow.getMessageSequenceNumber()).isEqualTo(5L); @@ -63,7 +63,7 @@ void whenParsing_thenRecepCreated(SoftAssertions softly) { } @Test - void whenParsingRecepCodeFromCode_thenRecepCodeIsCreated(SoftAssertions softly) { + void When_ParsingRecepCodeFromCode_Expect_RecepCodeIsCreated(SoftAssertions softly) { var toParse = new String[] {"CP", "CA", "CI"}; for (int i = 0; i < ReferenceMessageRecep.RecepCode.values().length; i++) { diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RegistrationMessageDateTimeTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RegistrationMessageDateTimeTest.java index 210e9444e..ddd4d79a6 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RegistrationMessageDateTimeTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/model/edifact/RegistrationMessageDateTimeTest.java @@ -20,30 +20,29 @@ public class RegistrationMessageDateTimeTest { .toInstant(); @Test - public void When_toEdifact_And_instantInWinter_Then_edifactIsUTC() throws EdifactValidationException { + public void When_ToEdifactAndInstantInWinter_Expect_EdifactIsUTC() throws EdifactValidationException { assertThat(new RegistrationMessageDateTime(WINTER).toEdifact()).isEqualTo("DTM+137:202003282058:203'"); } @Test - public void When_toEdifact_And_instantInSummer_Then_edifactIsBST() throws EdifactValidationException { + public void When_ToEdifactAndInstantInSummer_Expect_EdifactIsBST() throws EdifactValidationException { // the translated times are UK local time / BST and one hour "ahead" of UTC assertThat(new RegistrationMessageDateTime(SUMMER).toEdifact()).isEqualTo("DTM+137:202005282158:203'"); } @Test - void When_fromString_And_edifactIsWinterUTC_Then_instantIsUTC() { + void When_FromStringAndEdifactIsWinterUTC_Expect_InstantIsUTC() { assertThat(RegistrationMessageDateTime.fromString("DTM+137:202003282058:203'").getTimestamp()).isEqualTo(WINTER); } @Test - void When_fromString_And_edifactIsSummerBST_Then_instantIsUTC() { + void When_FromStringAndEdifactIsSummerBST_Expect_InstantIsUTC() { // the internal Instant representation (UTC) is one hour "behind" the EDIFACT timestamp which is UK local time / BST assertThat(RegistrationMessageDateTime.fromString("DTM+137:202005282158:203'").getTimestamp()).isEqualTo(SUMMER); } @Test - void When_fromString_And_stringIsNotDTMSegment_Then_throwsException() { + void When_FromStringAndStringIsNotDTMSegment_Expect_ThrowsException() { assertThatThrownBy(() -> RegistrationMessageDateTime.fromString("ABC+123:456:789'")).isExactlyInstanceOf(IllegalArgumentException.class); } - } \ No newline at end of file diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/FhirElementsUtilsTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/FhirElementsUtilsTest.java index 736b80448..32cd207fc 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/FhirElementsUtilsTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/FhirElementsUtilsTest.java @@ -13,7 +13,7 @@ class FhirElementsUtilsTest { @Test - public void whenNullGpCodeObject_theThrowsFhirValidationException() { + public void When_NullGpCodeObject_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); patient.setGeneralPractitioner(null); assertThatThrownBy(() -> FhirElementsUtils.checkGpCodePresence(patient)) @@ -21,7 +21,7 @@ public void whenNullGpCodeObject_theThrowsFhirValidationException() { } @Test - public void whenEmptyGpCodeList_thenThrowsFhirValidationException() { + public void When_EmptyGpCodeList_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); List generalPractitioners = Collections.emptyList(); patient.setGeneralPractitioner(generalPractitioners); @@ -30,7 +30,7 @@ public void whenEmptyGpCodeList_thenThrowsFhirValidationException() { } @Test - public void whenBlankGpCodeString_thenThrowsFhirValidationException() { + public void When_BlankGpCodeString_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); Reference reference = new Reference(); Identifier identifier = new Identifier(); @@ -43,7 +43,7 @@ public void whenBlankGpCodeString_thenThrowsFhirValidationException() { } @Test - public void whenNullHaCipherObject_theThrowsFhirValidationException() { + public void When_NullHaCipherObject_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); patient.setManagingOrganization(null); assertThatThrownBy(() -> FhirElementsUtils.checkGpCodePresence(patient)) @@ -51,7 +51,7 @@ public void whenNullHaCipherObject_theThrowsFhirValidationException() { } @Test - public void whenEmptyHaCipherNullIdentifier_thenThrowsFhirValidationException() { + public void When_EmptyHaCipherNullIdentifier_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); Reference managingOrganization = new Reference(); patient.setManagingOrganization(managingOrganization); @@ -60,7 +60,7 @@ public void whenEmptyHaCipherNullIdentifier_thenThrowsFhirValidationException() } @Test - public void whenBlankHaCipherString_thenThrowsFhirValidationException() { + public void When_BlankHaCipherString_Expect_ThrowsFhirValidationException() { Patient patient = new Patient(); Reference managingOrganization = new Reference(); Identifier identifier = new Identifier(); @@ -70,5 +70,4 @@ public void whenBlankHaCipherString_thenThrowsFhirValidationException() { assertThatThrownBy(() -> FhirElementsUtils.checkGpCodePresence(patient)) .isExactlyInstanceOf(FhirValidationException.class); } - } \ No newline at end of file diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/AmendmentControllerTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/AmendmentControllerTest.java index e8f1a5dd3..6e689b56e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/AmendmentControllerTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/AmendmentControllerTest.java @@ -60,7 +60,7 @@ public class AmendmentControllerTest { private Resource paramsPayload; @Test - void whenValidInput_thenReturns202() throws Exception { + void When_ValidInput_Expect_Returns202() throws Exception { String requestBody = new String(Files.readAllBytes(paramsPayload.getFile().toPath())); MeshMessage meshMessage = new MeshMessage(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/ConversationIdHeadersTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/ConversationIdHeadersTest.java index a8661876d..4dc2373e1 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/ConversationIdHeadersTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/ConversationIdHeadersTest.java @@ -41,7 +41,7 @@ public class ConversationIdHeadersTest { private ConversationIdService conversationIdService; @Test - void whenConversationIdInRequestHeader_thenProvidedIdIsUsed() throws Exception { + void When_ConversationIdInRequestHeader_Expect_ProvidedIdIsUsed() throws Exception { mockMvc.perform(post("/fhir/Patient/$nhais.acceptance") .contentType("text/plain") .header("ConversationId", "asdf1234") @@ -51,7 +51,7 @@ void whenConversationIdInRequestHeader_thenProvidedIdIsUsed() throws Exception { } @Test - void whenConversationNotIdInRequestHeader_thenGeneratedIdIsUsed() throws Exception { + void When_ConversationNotIdInRequestHeader_Expect_GeneratedIdIsUsed() throws Exception { mockMvc.perform(post("/fhir/Patient/$nhais.acceptance") .contentType("text/plain") .content("qwe")) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/FhirControllerTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/FhirControllerTest.java index 390e1df27..cbb0e7e8e 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/FhirControllerTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/controller/FhirControllerTest.java @@ -65,7 +65,7 @@ public class FhirControllerTest { private ConversationIdService conversationIdService; @Test - void whenValidAcceptanceInput_thenReturns202() throws Exception { + void When_ValidAcceptanceInput_Expect_Returns202() throws Exception { String requestBody = new String(Files.readAllBytes(paramsPayload.getFile().toPath())); MeshMessage meshMessage = getMeshMessage(); meshMessage.setContent("EDI"); @@ -85,7 +85,7 @@ void whenValidAcceptanceInput_thenReturns202() throws Exception { } @Test - void whenValidRemovalInput_thenReturns202() throws Exception { + void When_ValidRemovalInput_Expect_Returns202() throws Exception { String requestBody = new String(Files.readAllBytes(paramsPayload.getFile().toPath())); MeshMessage meshMessage = getMeshMessage(); @@ -102,7 +102,7 @@ void whenValidRemovalInput_thenReturns202() throws Exception { } @Test - void whenValidDeductionInput_thenReturns202() throws Exception { + void When_ValidDeductionInput_Expect_Returns202() throws Exception { String requestBody = new String(Files.readAllBytes(paramsPayload.getFile().toPath())); MeshMessage meshMessage = getMeshMessage(); @@ -127,7 +127,7 @@ private MeshMessage getMeshMessage() { } @Test - void whenInvalidInput_thenReturns400() throws Exception { + void When_InvalidInput_Expect_Returns400() throws Exception { String requestBody = "{}"; when(fhirParser.parseParameters(requestBody)).thenThrow(new FhirValidationException("the message")); String expectedResponse = "{\"expected\":\"response\"}"; @@ -141,7 +141,7 @@ void whenInvalidInput_thenReturns400() throws Exception { } @Test - void whenUnhandledException_thenReturns500() throws Exception { + void When_UnhandledException_Expect_Returns500() throws Exception { String requestBody = "{}"; when(fhirParser.parseParameters(requestBody)).thenThrow(new RuntimeException("the message")); String expectedResponse = "{\"expected\":\"response\"}"; @@ -155,7 +155,7 @@ void whenUnhandledException_thenReturns500() throws Exception { } @Test - void whenInvalidMediaType_thenReturn415() throws Exception { + void When_InvalidMediaType_Expect_Return415() throws Exception { String expectedResponse = "{\"expected\":\"response\"}"; when(fhirParser.encodeToString(any(OperationOutcome.class))).thenReturn(expectedResponse); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirParserTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirParserTest.java index 42ad972b7..12f9d2d7f 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirParserTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirParserTest.java @@ -15,14 +15,14 @@ public class FhirParserTest { private FhirParser fhirParser = new FhirParser(); @Test - public void When_parseParameters_Then_returnParametersObject() throws Exception { + public void When_ParseParameters_Expect_ReturnParametersObject() throws Exception { String json = new String(Files.readAllBytes(Paths.get(getClass().getResource("/patient/parameters.json").toURI()))); Parameters parameters = fhirParser.parseParameters(json); assertThat(parameters.getParameter()).isEmpty(); } @Test - public void When_parseNotJson_Then_returnFhirValidationException(){ + public void When_ParseNotJson_Expect_ReturnFhirValidationException(){ String xml = ""; assertThatThrownBy(() -> fhirParser.parseParameters(xml)).isExactlyInstanceOf(FhirValidationException.class); } diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirToEdifactServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirToEdifactServiceTest.java index 947cf2b07..cb4e90d18 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirToEdifactServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/fhir/FhirToEdifactServiceTest.java @@ -101,7 +101,7 @@ public void beforeEach() { } @Test - public void when_convertedSuccessfully_dependenciesCalledCorrectly() { + public void When_ConvertedSuccessfully_Expect_DependenciesCalledCorrectly() { Parameters patient = createPatient(); fhirToEdifactService.convertToEdifact(patient, ReferenceTransactionType.Outbound.ACCEPTANCE); @@ -126,7 +126,7 @@ public void when_convertedSuccessfully_dependenciesCalledCorrectly() { } @Test - public void when_convertedSuccessfully_edifactIsCorrect() { + public void When_ConvertedSuccessfully_Expect_EdifactIsCorrect() { Parameters patient = createPatient(); OutboundMeshMessage meshMessage = fhirToEdifactService.convertToEdifact(patient, ReferenceTransactionType.Outbound.ACCEPTANCE); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceCodeMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceCodeMapperTest.java index 3d971469b..151dbf37d 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceCodeMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceCodeMapperTest.java @@ -13,7 +13,7 @@ class AcceptanceCodeMapperTest { @Test - void When_MappingAcceptanceCode_Then_ExpectCorrectResult() { + void When_MappingAcceptanceCode_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ACCEPTANCE_CODE) @@ -30,7 +30,7 @@ void When_MappingAcceptanceCode_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutCodeParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutCodeParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var acceptanceCodeMapper = new AcceptanceCodeMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceDateMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceDateMapperTest.java index d3d3c173d..c130e74a6 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceDateMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceDateMapperTest.java @@ -13,7 +13,7 @@ class AcceptanceDateMapperTest { @Test - void When_MappingAcceptanceCode_Then_ExpectCorrectResult() { + void When_MappingAcceptanceCode_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ACCEPTANCE_DATE) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceTypeMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceTypeMapperTest.java index 648d41a25..19db5d3d5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceTypeMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/AcceptanceTypeMapperTest.java @@ -15,7 +15,7 @@ class AcceptanceTypeMapperTest { @Test - void When_MappingAcceptanceType_Then_ExpectCorrectResult() { + void When_MappingAcceptanceType_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ACCEPTANCE_TYPE) @@ -32,7 +32,7 @@ void When_MappingAcceptanceType_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithWrongType_Then_NoSuchElementExceptionIsThrown() { + public void When_MappingWithWrongType_Expect_NoSuchElementExceptionIsThrown() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ACCEPTANCE_TYPE) @@ -43,7 +43,7 @@ public void When_MappingWithWrongType_Then_NoSuchElementExceptionIsThrown() { } @Test - public void When_MappingWithoutTypeParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutTypeParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var acceptanceTypeMapper = new AcceptanceTypeMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionDateMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionDateMapperTest.java index dcb6c1753..388607907 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionDateMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionDateMapperTest.java @@ -14,7 +14,7 @@ class DeductionDateMapperTest { @Test - void When_MappingDeductionDate_Then_ExpectCorrectResult() { + void When_MappingDeductionDate_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.DATE_OF_DEDUCTION) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionReasonCodeMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionReasonCodeMapperTest.java index 46b48f97e..5455e059a 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionReasonCodeMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DeductionReasonCodeMapperTest.java @@ -15,7 +15,7 @@ class DeductionReasonCodeMapperTest { @Test - void When_MappingAcceptanceCode_Then_ExpectCorrectResult() { + void When_MappingAcceptanceCode_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.DEDUCTION_REASON_CODE) @@ -32,7 +32,7 @@ void When_MappingAcceptanceCode_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutCodeParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutCodeParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var mapper = new DeductionReasonCodeMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DrugsMarkerMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DrugsMarkerMapperTest.java index 6bd2b8f4f..e3148e5bc 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DrugsMarkerMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/DrugsMarkerMapperTest.java @@ -14,7 +14,7 @@ class DrugsMarkerMapperTest { private final DrugsMarkerMapper drugsMarkerMapper = new DrugsMarkerMapper(); @Test - void when_DrugsMarkerExtensionExistsAndValueIsTrue_Then_CanMap() { + void When_DrugsMarkerExtensionExistsAndValueIsTrue_Expect_CanMap() { Patient patient = new Patient(); patient.addExtension(new DrugsMarkerExtension("true")); PatientParameter patientParameter = new PatientParameter(patient); @@ -25,7 +25,7 @@ void when_DrugsMarkerExtensionExistsAndValueIsTrue_Then_CanMap() { } @Test - void when_DrugsMarkerExtensionExistsAndValueIsFalse_Then_CanNotMap() { + void When_DrugsMarkerExtensionExistsAndValueIsFalse_Expect_CanNotMap() { Patient patient = new Patient(); patient.addExtension(new DrugsMarkerExtension("false")); PatientParameter patientParameter = new PatientParameter(patient); @@ -36,7 +36,7 @@ void when_DrugsMarkerExtensionExistsAndValueIsFalse_Then_CanNotMap() { } @Test - void when_DrugsMarkerExtensionDoesntExist_Then_CanNotMap() { + void When_DrugsMarkerExtensionDoesntExist_Expect_CanNotMap() { PatientParameter patientParameter = new PatientParameter(); Parameters parameters = new Parameters() .addParameter(patientParameter); @@ -45,7 +45,7 @@ void when_DrugsMarkerExtensionDoesntExist_Then_CanNotMap() { } @Test - void when_DrugsMarkerExtensionExistsAndValueIsTrue_Then_MappingSuccessful() { + void When_DrugsMarkerExtensionExistsAndValueIsTrue_Expect_MappingSuccessful() { Patient patient = new Patient(); patient.addExtension(new DrugsMarkerExtension("true")); PatientParameter patientParameter = new PatientParameter(patient); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/FreeTextMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/FreeTextMapperTest.java index 240aa8e4a..cd8d87cec 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/FreeTextMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/FreeTextMapperTest.java @@ -12,7 +12,7 @@ class FreeTextMapperTest { private final FreeTextMapper freeTextMapper = new FreeTextMapper(); @Test - void when_FreeTextValueExistsAndValueIsSet_Then_CanMap() { + void When_FreeTextValueExistsAndValueIsSet_Expect_CanMap() { Parameters parameters = new Parameters() .addParameter(ParameterNames.FREE_TEXT, "text"); @@ -20,7 +20,7 @@ void when_FreeTextValueExistsAndValueIsSet_Then_CanMap() { } @Test - void when_FreeTextValueExistsAndValueIsNotSet_Then_CanMap() { + void When_FreeTextValueExistsAndValueIsNotSet_Expect_CanMap() { Parameters parameters = new Parameters() .addParameter(ParameterNames.FREE_TEXT, ""); @@ -28,7 +28,7 @@ void when_FreeTextValueExistsAndValueIsNotSet_Then_CanMap() { } @Test - void when_FreeTextValueExistsAndValueIsNull_Then_CanNotMap() { + void When_FreeTextValueExistsAndValueIsNull_Expect_CanNotMap() { Parameters parameters = new Parameters() .addParameter(ParameterNames.FREE_TEXT, (String) null); @@ -36,14 +36,14 @@ void when_FreeTextValueExistsAndValueIsNull_Then_CanNotMap() { } @Test - void when_FreeTextValueDoesntExist_Then_CanNotMap() { + void When_FreeTextValueDoesntExist_Expect_CanNotMap() { Parameters parameters = new Parameters(); assertThat(freeTextMapper.inputDataExists(parameters)).isFalse(); } @Test - void when_DrugsMarkerExtensionExistsAndValueIsSet_Then_MappingSuccessful() { + void When_DrugsMarkerExtensionExistsAndValueIsSet_Expect_MappingSuccessful() { Parameters parameters = new Parameters() .addParameter(ParameterNames.FREE_TEXT, "text"); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/GpNameAndAddressMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/GpNameAndAddressMapperTest.java index 90bb3e6bb..797afbad4 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/GpNameAndAddressMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/GpNameAndAddressMapperTest.java @@ -18,7 +18,7 @@ class GpNameAndAddressMapperTest { @Test - void When_MappingGP_Then_ExpectCorrectResult() { + void When_MappingGP_Expect_ExpectCorrectResult() { Patient patient = new Patient(); patient.setGeneralPractitioner(List.of( new Reference().setIdentifier(new GeneralPractitionerIdentifier("4826940,281")) @@ -40,7 +40,7 @@ void When_MappingGP_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutGP_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutGP_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); parameters.addParameter(new PatientParameter()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PartyQualifierMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PartyQualifierMapperTest.java index 9d33e2259..6a15c6216 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PartyQualifierMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PartyQualifierMapperTest.java @@ -15,7 +15,7 @@ class PartyQualifierMapperTest { @Test - void When_MappingPartyQualifier_Then_ExpectCorrectResult() { + void When_MappingPartyQualifier_Expect_ExpectCorrectResult() { Patient patient = new Patient(); patient.setManagingOrganization( new Reference().setIdentifier(new ManagingOrganizationIdentifier("X11")) @@ -36,7 +36,7 @@ void When_MappingPartyQualifier_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutPartyQualifier_Then_NullPointerExceptionIsThrown() { + public void When_MappingWithoutPartyQualifier_Expect_NullPointerExceptionIsThrown() { Parameters parameters = new Parameters(); parameters.addParameter(new PatientParameter()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonAddressMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonAddressMapperTest.java index cac76e8da..3148facdc 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonAddressMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonAddressMapperTest.java @@ -17,7 +17,7 @@ class PersonAddressMapperTest { @Test - void When_MappingAddress_Then_ExpectCorrectResult() { + void When_MappingAddress_Expect_ExpectCorrectResult() { Patient patient = new Patient(); Address address = new Address(); address.setUse(Address.AddressUse.HOME); @@ -45,7 +45,7 @@ void When_MappingAddress_Then_ExpectCorrectResult() { } @Test - void When_MappingAddressWithPostcode_Then_ExpectCorrectResult() { + void When_MappingAddressWithPostcode_Expect_ExpectCorrectResult() { Patient patient = new Patient(); Address address = new Address(); address.addLine("") @@ -76,7 +76,7 @@ void When_MappingAddressWithPostcode_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutAddress_Then_IllegalStateExceptionIsThrown() { + public void When_MappingWithoutAddress_Expect_IllegalStateExceptionIsThrown() { Parameters parameters = new Parameters() .addParameter(new PatientParameter()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfBirthMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfBirthMapperTest.java index 4873cde3a..06ce4f7d3 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfBirthMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfBirthMapperTest.java @@ -23,7 +23,7 @@ class PersonDateOfBirthMapperTest { private final PersonDateOfBirthMapper personDateOfBirthMapper = new PersonDateOfBirthMapper(); @Test - void When_MappingDob_Then_ExpectCorrectResult() { + void When_MappingDob_Expect_ExpectCorrectResult() { Patient patient = new Patient(); patient.setBirthDate(Date.from(FIXED_TIME_LOCAL)); @@ -41,7 +41,7 @@ void When_MappingDob_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutDob_Then_NullPointerExceptionIsThrown() { + public void When_MappingWithoutDob_Expect_NullPointerExceptionIsThrown() { Parameters parameters = new Parameters() .addParameter(new PatientParameter()); @@ -49,7 +49,7 @@ public void When_MappingWithoutDob_Then_NullPointerExceptionIsThrown() { } @Test - public void When_ParametersWithoutDob_Then_CanNotMap() { + public void When_ParametersWithoutDob_Expect_CanNotMap() { Parameters parameters = new Parameters() .addParameter(new PatientParameter()); @@ -57,7 +57,7 @@ public void When_ParametersWithoutDob_Then_CanNotMap() { } @Test - public void When_ParametersWithDob_Then_CanMap() { + public void When_ParametersWithDob_Expect_CanMap() { Patient patient = new Patient(); patient.setBirthDate(Date.from(FIXED_TIME_LOCAL)); Parameters parameters = new Parameters() diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfEntryMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfEntryMapperTest.java index e69566a67..36b1a7b95 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfEntryMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfEntryMapperTest.java @@ -18,7 +18,7 @@ class PersonDateOfEntryMapperTest { private static final LocalDate LOCAL_DATE = LocalDate.parse(DATE_STRING); @Test - void When_MappingDateOfEntry_Then_ExpectCorrectResult() { + void When_MappingDateOfEntry_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ENTRY_DATE) @@ -33,7 +33,7 @@ void When_MappingDateOfEntry_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithWrongDate_Then_DateTimeParseExceptionIsThrown() { + public void When_MappingWithWrongDate_Expect_DateTimeParseExceptionIsThrown() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.ENTRY_DATE) @@ -44,7 +44,7 @@ public void When_MappingWithWrongDate_Then_DateTimeParseExceptionIsThrown() { } @Test - public void When_MappingWithoutDateParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutDateParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var personDateOfEntryMapper = new PersonDateOfEntryMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfExitMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfExitMapperTest.java index 3e51075a4..84f60a553 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfExitMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonDateOfExitMapperTest.java @@ -19,7 +19,7 @@ class PersonDateOfExitMapperTest { private static final LocalDate LOCAL_DATE = LocalDate.parse(DATE_STRING); @Test - void When_MappingDateOfEntry_Then_ExpectCorrectResult() { + void When_MappingDateOfEntry_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.EXIT_DATE) @@ -34,7 +34,7 @@ void When_MappingDateOfEntry_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithWrongDate_Then_DateTimeParseExceptionIsThrown() { + public void When_MappingWithWrongDate_Expect_DateTimeParseExceptionIsThrown() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.EXIT_DATE) @@ -46,7 +46,7 @@ public void When_MappingWithWrongDate_Then_DateTimeParseExceptionIsThrown() { } @Test - public void When_MappingWithoutDateParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutDateParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var PersonDateOfExitMapper = new PersonDateOfExitMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonNameMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonNameMapperTest.java index e0e219131..6b989a369 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonNameMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonNameMapperTest.java @@ -22,7 +22,7 @@ class PersonNameMapperTest { public static final String FAMILY_NAME = "Smith"; @Test - void When_MappingPatientFamilyName_Then_ExpectCorrectResult() { + void When_MappingPatientFamilyName_Expect_ExpectCorrectResult() { Patient patient = new Patient(); PatientName patientName = PatientName.builder() .familyName(FAMILY_NAME) @@ -48,7 +48,7 @@ void When_MappingPatientFamilyName_Then_ExpectCorrectResult() { } @Test - void When_MappingAllPossiblePatientNames_Then_ExpectCorrectResult() { + void When_MappingAllPossiblePatientNames_Expect_ExpectCorrectResult() { Patient patient = new Patient(); PatientName patientName = PatientName.builder() .familyName(FAMILY_NAME) @@ -82,7 +82,7 @@ void When_MappingAllPossiblePatientNames_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutSurname_Then_UnsupportedOperationExceptionIsThrown() { + public void When_MappingWithoutSurname_Expect_UnsupportedOperationExceptionIsThrown() { Patient patient = new Patient(); patient.setIdentifier(List.of(new NhsIdentifier(NHS_NUMBER))); patient.setName(List.of()); @@ -95,7 +95,7 @@ public void When_MappingWithoutSurname_Then_UnsupportedOperationExceptionIsThrow } @Test - void When_MappingWithoutNhsNumber_Then_ExpectCorrectResult() { + void When_MappingWithoutNhsNumber_Expect_ExpectCorrectResult() { Patient patient = new Patient(); HumanName humanName = new HumanName(); humanName.setFamily(FAMILY_NAME); @@ -116,7 +116,7 @@ void When_MappingWithoutNhsNumber_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutPatient_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutPatient_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var personNameMapper = new PersonNameMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonOldAddressMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonOldAddressMapperTest.java index 55cbaaf3a..16510af78 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonOldAddressMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonOldAddressMapperTest.java @@ -16,7 +16,7 @@ class PersonOldAddressMapperTest { @Test - void When_MappingAddress_Then_ExpectCorrectResult() { + void When_MappingAddress_Expect_ExpectCorrectResult() { Patient patient = new Patient(); Address current = new Address(); current.addLine("") @@ -53,7 +53,7 @@ void When_MappingAddress_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutAddress_Then_IllegalStateExceptionIsThrown() { + public void When_MappingWithoutAddress_Expect_IllegalStateExceptionIsThrown() { Parameters parameters = new Parameters() .addParameter(new PatientParameter()); @@ -62,7 +62,7 @@ public void When_MappingWithoutAddress_Then_IllegalStateExceptionIsThrown() { } @Test - public void When_MappingWithOnlyCurrentAddress_Then_IllegalStateExceptionIsThrown() { + public void When_MappingWithOnlyCurrentAddress_Expect_IllegalStateExceptionIsThrown() { Patient patient = new Patient(); Address current = new Address(); current.addLine("") diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPlaceOfBirthMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPlaceOfBirthMapperTest.java index c9114716e..5d91a75d2 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPlaceOfBirthMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPlaceOfBirthMapperTest.java @@ -16,7 +16,7 @@ class PersonPlaceOfBirthMapperTest { private final PersonPlaceOfBirthMapper personPlaceOfBirthMapper = new PersonPlaceOfBirthMapper(); @Test - void when_ExtensionExistsAndValueIsSet_Then_CanMap() { + void When_ExtensionExistsAndValueIsSet_Expect_CanMap() { Patient patient = new Patient(); patient.addExtension(new BirthPlaceExtension("GLASGOW")); PatientParameter patientParameter = new PatientParameter(patient); @@ -27,7 +27,7 @@ void when_ExtensionExistsAndValueIsSet_Then_CanMap() { } @Test - void when_ExtensionExistsAndValueIsNotSet_Then_CanMap() { + void When_ExtensionExistsAndValueIsNotSet_Expect_CanMap() { Patient patient = new Patient(); patient.addExtension(new BirthPlaceExtension("")); PatientParameter patientParameter = new PatientParameter(patient); @@ -41,7 +41,7 @@ void when_ExtensionExistsAndValueIsNotSet_Then_CanMap() { } @Test - void when_ExtensionDoesntExist_Then_CanNotMap() { + void When_ExtensionDoesntExist_Expect_CanNotMap() { PatientParameter patientParameter = new PatientParameter(); Parameters parameters = new Parameters() .addParameter(patientParameter); @@ -50,7 +50,7 @@ void when_ExtensionDoesntExist_Then_CanNotMap() { } @Test - void when_ExtensionExistsAndValueIsSet_Then_MappingSuccessful() { + void When_ExtensionExistsAndValueIsSet_Expect_MappingSuccessful() { Patient patient = new Patient(); patient.addExtension(new BirthPlaceExtension("GLASGOW")); PatientParameter patientParameter = new PatientParameter(patient); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPreviousNameMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPreviousNameMapperTest.java index 25fd6b416..eea543021 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPreviousNameMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonPreviousNameMapperTest.java @@ -29,7 +29,7 @@ class PersonPreviousNameMapperTest { .build(); @Test - void When_MappingPatientPreviousFamilyName_Then_ExpectCorrectResult() { + void When_MappingPatientPreviousFamilyName_Expect_ExpectCorrectResult() { Patient patient = new Patient() .setName(List.of(patientName, patientName2)) .setIdentifier(List.of(new NhsIdentifier(NHS_NUMBER))); @@ -50,7 +50,7 @@ void When_MappingPatientPreviousFamilyName_Then_ExpectCorrectResult() { } @Test - void When_MappingAllPossiblePatientNames_Then_ExpectCorrectResult() { + void When_MappingAllPossiblePatientNames_Expect_ExpectCorrectResult() { PatientName patientName = PatientName.builder() .familyName(FAMILY_NAME) .forename("Forename") @@ -87,7 +87,7 @@ void When_MappingAllPossiblePatientNames_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutSurname_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutSurname_Expect_FhirValidationExceptionIsThrown() { Patient patient = new Patient(); patient.setIdentifier(List.of(new NhsIdentifier(NHS_NUMBER))); patient.setName(List.of()); @@ -100,7 +100,7 @@ public void When_MappingWithoutSurname_Then_FhirValidationExceptionIsThrown() { } @Test - void When_MappingWithoutNhsNumber_Then_ExpectCorrectResult() { + void When_MappingWithoutNhsNumber_Expect_ExpectCorrectResult() { Patient patient = new Patient() .setName(List.of(patientName, patientName2)); @@ -118,7 +118,7 @@ void When_MappingWithoutNhsNumber_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutPatient_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutPatient_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var previousPersonNameMapper = new PersonPreviousNameMapper(); @@ -126,7 +126,7 @@ public void When_MappingWithoutPatient_Then_FhirValidationExceptionIsThrown() { } @Test - void When_ThereIsOnlyOneName_Then_CanNotMap() { + void When_ThereIsOnlyOneName_Expect_CanNotMap() { Patient patient = new Patient() .setName(List.of(patientName)); @@ -139,7 +139,7 @@ void When_ThereIsOnlyOneName_Then_CanNotMap() { } @Test - void When_ThereAreTwoNamea_Then_CanMap() { + void When_ThereAreTwoNamea_Expect_CanMap() { Patient patient = new Patient() .setName(List.of(patientName, patientName2)); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonSexMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonSexMapperTest.java index df9b8cf9b..dcbe5e0a5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonSexMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PersonSexMapperTest.java @@ -14,7 +14,7 @@ class PersonSexMapperTest { @Test - void When_MappingGender_Then_ExpectCorrectResult() { + void When_MappingGender_Expect_ExpectCorrectResult() { Patient patient = new Patient(); patient.setGender(Enumerations.AdministrativeGender.FEMALE); @@ -32,7 +32,7 @@ void When_MappingGender_Then_ExpectCorrectResult() { } @Test - public void When_MappingGenderWrongType_Then_FhirValidationExceptionIsThrown() { + public void When_MappingGenderWrongType_Expect_FhirValidationExceptionIsThrown() { Patient patient = new Patient(); patient.setGender(Enumerations.AdministrativeGender.NULL); @@ -43,7 +43,7 @@ public void When_MappingGenderWrongType_Then_FhirValidationExceptionIsThrown() { } @Test - public void When_MappingWithoutGender_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutGender_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters() .addParameter(new PatientParameter()); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousGpNameMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousGpNameMapperTest.java index 323dae96d..85ec70704 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousGpNameMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousGpNameMapperTest.java @@ -13,7 +13,7 @@ class PreviousGpNameMapperTest { @Test - void When_MappingGPPrevious_Then_ExpectCorrectResult() { + void When_MappingGPPrevious_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.PREVIOUS_GP_NAME) @@ -31,7 +31,7 @@ void When_MappingGPPrevious_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutGPPreviousParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutGPPreviousParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var personGPPreviousMapper = new PreviousGpNameMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousHealthAuthorityNameMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousHealthAuthorityNameMapperTest.java index 91bf4d4a3..a9f9a7a84 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousHealthAuthorityNameMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/PreviousHealthAuthorityNameMapperTest.java @@ -15,7 +15,7 @@ class PreviousHealthAuthorityNameMapperTest { private final static String IDENTIFIER = "ID1"; @Test - void When_MappingGPPrevious_Then_ExpectCorrectResult() { + void When_MappingGPPrevious_Expect_ExpectCorrectResult() { Parameters parameters = new Parameters(); parameters.addParameter() .setName(ParameterNames.PREVIOUS_HA_CIPHER) @@ -30,7 +30,7 @@ void When_MappingGPPrevious_Then_ExpectCorrectResult() { } @Test - public void When_MappingWithoutGPPreviousParam_Then_FhirValidationExceptionIsThrown() { + public void When_MappingWithoutGPPreviousParam_Expect_FhirValidationExceptionIsThrown() { Parameters parameters = new Parameters(); var personGPPreviousMapper = new PreviousGpNameMapper(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/TransactionTypeMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/TransactionTypeMapperTest.java index 860a7919a..c0cd39cb0 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/TransactionTypeMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/mapper/TransactionTypeMapperTest.java @@ -20,28 +20,28 @@ public static void setUp() { } @Test - public void whenAcceptanceRequestParameter_thenReturnAcceptanceType() { + public void When_AcceptanceRequestParameter_Expect_ReturnAcceptanceType() { String parameter = "$nhais.acceptance"; assertThat(transactionTypeMapper.mapTransactionType(parameter)) .isEqualTo(ReferenceTransactionType.Outbound.ACCEPTANCE); } @Test - public void whenRemovalRequestParameter_thenReturnAcceptanceType() { + public void When_RemovalRequestParameter_Expect_ReturnAcceptanceType() { String parameter = "$nhais.removal"; assertThat(transactionTypeMapper.mapTransactionType(parameter)) .isEqualTo(ReferenceTransactionType.Outbound.REMOVAL); } @Test - public void whenDeductionRequestParameter_thenReturnAcceptanceType() { + public void When_DeductionRequestParameter_Expect_ReturnAcceptanceType() { String parameter = "$nhais.deduction"; assertThat(transactionTypeMapper.mapTransactionType(parameter)) .isEqualTo(ReferenceTransactionType.Outbound.DEDUCTION); } @Test - public void whenUnknownRequestParameter_thenReturnParameterValidationException() { + public void When_UnknownRequestParameter_Expect_ReturnParameterValidationException() { String parameter = "$nhais.addPatient"; assertThatThrownBy(() -> transactionTypeMapper.mapTransactionType(parameter)) .isExactlyInstanceOf(ParameterValidationException.class); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/RemovalTranslatorTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/RemovalTranslatorTest.java index d63a79dbb..a7a3202a8 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/RemovalTranslatorTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/RemovalTranslatorTest.java @@ -69,7 +69,7 @@ public class RemovalTranslatorTest { private OptionalInputValidator validator; @Test - void whenNhsNumberIsMissing_thenExceptionIsThrown() { + void When_NhsNumberIsMissing_Expect_ExceptionIsThrown() { when(validator.nhsNumberIsMissing(any())).thenReturn(true); assertThatThrownBy(() -> removalTranslator.translate(parameters)) @@ -78,7 +78,7 @@ void whenNhsNumberIsMissing_thenExceptionIsThrown() { } @Test - void whenFhirRemovalIsTranslated_thenAllRequiredSegmentsArePresentAndAreOfCorrectType(SoftAssertions softly) { + void When_FhirRemovalIsTranslated_Expect_AllRequiredSegmentsArePresentAndAreOfCorrectType(SoftAssertions softly) { when(validator.nhsNumberIsMissing(any())).thenReturn(false); when(partyQualifierMapper.map(parameters)).thenReturn(partyQualifier); when(gpNameAndAddressMapper.map(parameters)).thenReturn(gpNameAndAddress); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceBirthTranslatorTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceBirthTranslatorTest.java index e7c27b92b..bf40d9bab 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceBirthTranslatorTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceBirthTranslatorTest.java @@ -19,7 +19,7 @@ class AcceptanceBirthTranslatorTest { private AcceptanceBirthTranslator acceptanceBirthTranslator; @Test - void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { + void When_MissingNhsNumberAndBirthPlace_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.nhsNumberIsMissing(parameters)).thenReturn(true); @@ -29,7 +29,7 @@ void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { } @Test - void when_MisssingSurname_Then_ThrowFhirValidationException() { + void When_MisssingSurname_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.surnameIsMissing(parameters)).thenReturn(true); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceFirstTranslatorTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceFirstTranslatorTest.java index 047cc2bca..78379190d 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceFirstTranslatorTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceFirstTranslatorTest.java @@ -20,7 +20,7 @@ class AcceptanceFirstTranslatorTest { private AcceptanceFirstTranslator acceptanceFirstTranslator; @Test - void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { + void When_MissingNhsNumberAndBirthPlace_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.nhsNumberIsMissing(parameters)).thenReturn(true); when(validator.placeOfBirthIsMissing(parameters)).thenReturn(true); @@ -30,7 +30,7 @@ void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { } @Test - void when_MisssingSurname_Then_ThrowFhirValidationException() { + void When_MisssingSurname_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.surnameIsMissing(parameters)).thenReturn(true); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceImmigrantTranslatorTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceImmigrantTranslatorTest.java index 4fd2ac6d0..73a22a81c 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceImmigrantTranslatorTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceImmigrantTranslatorTest.java @@ -20,7 +20,7 @@ class AcceptanceImmigrantTranslatorTest { private AcceptanceImmigrantTranslator acceptanceImmigrantTranslator; @Test - void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { + void When_MissingNhsNumberAndBirthPlace_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.nhsNumberIsMissing(parameters)).thenReturn(true); when(validator.placeOfBirthIsMissing(parameters)).thenReturn(true); @@ -31,7 +31,7 @@ void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { } @Test - void when_MisssingSurname_Then_ThrowFhirValidationException() { + void When_MisssingSurname_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.surnameIsMissing(parameters)).thenReturn(true); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceTransferInTranslatorTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceTransferInTranslatorTest.java index 8695bb9bf..bf1b628c0 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceTransferInTranslatorTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/acceptance/AcceptanceTransferInTranslatorTest.java @@ -20,7 +20,7 @@ class AcceptanceTransferInTranslatorTest { private AcceptanceTransferInTranslator acceptanceTransferInTranslator; @Test - void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { + void When_MissingNhsNumberAndBirthPlace_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.nhsNumberIsMissing(parameters)).thenReturn(true); when(validator.placeOfBirthIsMissing(parameters)).thenReturn(true); @@ -30,7 +30,7 @@ void When_MissingNhsNumberAndBirthPlace_Then_ThrowFhirValidationException() { } @Test - void when_MisssingSurname_Then_ThrowFhirValidationException() { + void When_MisssingSurname_Expect_ThrowFhirValidationException() { Parameters parameters = new Parameters(); when(validator.surnameIsMissing(parameters)).thenReturn(true); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentAddressToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentAddressToEdifactMapperTest.java index 11b95af0e..0fc1213c5 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentAddressToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentAddressToEdifactMapperTest.java @@ -45,7 +45,7 @@ void setUp() { } @Test - void whenReplacingAllFiveAddressLinesFields_expectAllAddressLinesAreMapped() { + void When_ReplacingAllFiveAddressLinesFields_Expect_AllAddressLinesAreMapped() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -71,7 +71,7 @@ void whenReplacingAllFiveAddressLinesFields_expectAllAddressLinesAreMapped() { } @Test - void whenAddressLineIsnull_expectNullToBeMapperAsEmptyEdifactString() { + void When_AddressLineIsnull_Expect_NullToBeMapperAsEmptyEdifactString() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -97,7 +97,7 @@ void whenAddressLineIsnull_expectNullToBeMapperAsEmptyEdifactString() { } @Test - void whenRemovingFourAddressLinesFields_expectFourAddressLinesRemoved() { + void When_RemovingFourAddressLinesFields_Expect_FourAddressLinesRemoved() { AmendmentPatchOperation operation = AmendmentPatchOperation.REMOVE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(REMOVE_INDICATOR)))); @@ -123,7 +123,7 @@ void whenRemovingFourAddressLinesFields_expectFourAddressLinesRemoved() { } @Test - void whenHouseNameMissing_thenThrowsFhirValidationException() { + void When_HouseNameMissing_Expect_ThrowsFhirValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.empty()); when(jsonPatches.getNumberOrRoadName()).thenReturn(Optional.of(new AmendmentPatch() @@ -141,7 +141,7 @@ void whenHouseNameMissing_thenThrowsFhirValidationException() { } @Test - void whenNumberOrRoadNameMissing_thenThrowsFhirValidationException() { + void When_NumberOrRoadNameMissing_Expect_ThrowsFhirValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -159,7 +159,7 @@ void whenNumberOrRoadNameMissing_thenThrowsFhirValidationException() { } @Test - void whenLocalityMissing_thenThrowsFhirValidationException() { + void When_LocalityMissing_Expect_ThrowsFhirValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -177,7 +177,7 @@ void whenLocalityMissing_thenThrowsFhirValidationException() { } @Test - void whenPostTownMissing_thenThrowsFhirValidationException() { + void When_PostTownMissing_Expect_ThrowsFhirValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -195,7 +195,7 @@ void whenPostTownMissing_thenThrowsFhirValidationException() { } @Test - void whenCountyMissing_thenThrowsFhirValidationException() { + void When_CountyMissing_Expect_ThrowsFhirValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REPLACE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); @@ -213,7 +213,7 @@ void whenCountyMissing_thenThrowsFhirValidationException() { } @Test - void whenRemoveForPostTown_thenThrowsPatchValidationException() { + void When_RemoveForPostTown_Expect_ThrowsPatchValidationException() { AmendmentPatchOperation operation = AmendmentPatchOperation.REMOVE; when(jsonPatches.getHouseName()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(HOUSE_NAME)))); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDateOfBirthToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDateOfBirthToEdifactMapperTest.java index 7cb615a4d..c5ecb4a01 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDateOfBirthToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDateOfBirthToEdifactMapperTest.java @@ -38,7 +38,7 @@ class AmendmentDateOfBirthToEdifactMapperTest extends AmendmentFhirToEdifactTest @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingDateOfBirth_expectFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingDateOfBirth_Expect_FieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getBirthDate()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(DATE_OF_BIRTH)))); @@ -51,7 +51,7 @@ void whenAddingOrReplacingDateOfBirth_expectFieldsAreMapped(AmendmentPatchOperat } @Test - void whenUsingRemoveOperation_expectException() { + void When_UsingRemoveOperation_Expect_Exception() { when(jsonPatches.getBirthDate()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); @@ -62,7 +62,7 @@ void whenUsingRemoveOperation_expectException() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddOrReplaceValuesAreEmpty_expectException(AmendmentPatchOperation operation) { + void When_AddOrReplaceValuesAreEmpty_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getBirthDate()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setPath(JsonPatches.BIRTH_DATE_PATH) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDrugsDispensedMarkerToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDrugsDispensedMarkerToEdifactMapperTest.java index b47fc2b4f..956e480a7 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDrugsDispensedMarkerToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentDrugsDispensedMarkerToEdifactMapperTest.java @@ -26,7 +26,7 @@ class AmendmentDrugsDispensedMarkerToEdifactMapperTest extends AmendmentFhirToEd @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingWithCorrectValue_Expect_FieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getDrugsDispensedMarker()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setValue(new AmendmentBooleanExtension.DrugsDispensedMarker(true)))); @@ -39,7 +39,7 @@ void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchO @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenRemoving_expectFieldsAreRemoved(AmendmentPatchOperation operation) { + void When_Removing_Expect_FieldsAreRemoved(AmendmentPatchOperation operation) { when(jsonPatches.getDrugsDispensedMarker()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setValue(new AmendmentBooleanExtension.DrugsDispensedMarker(false)))); @@ -51,7 +51,7 @@ void whenRemoving_expectFieldsAreRemoved(AmendmentPatchOperation operation) { } @Test - void whenUsingRemoveOperation_expectException() { + void When_UsingRemoveOperation_Expect_Exception() { when(jsonPatches.getDrugsDispensedMarker()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentFreeTextToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentFreeTextToEdifactMapperTest.java index 82be5ecf2..03756e1c1 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentFreeTextToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentFreeTextToEdifactMapperTest.java @@ -29,7 +29,7 @@ protected static Stream getEmptyValues() { } @Test - void whenFreeTextIsPresent_expectValueIsMapped() { + void When_FreeTextIsPresent_Expect_ValueIsMapped() { when(amendmentBody.getFreeText()).thenReturn(FREE_TEXT); var segments = translator.map(amendmentBody); @@ -40,7 +40,7 @@ void whenFreeTextIsPresent_expectValueIsMapped() { @ParameterizedTest @MethodSource(value = "getEmptyValues") - void whenFreeTextIsEmpty_expectValueIsMapped(String value) { + void When_FreeTextIsEmpty_Expect_ValueIsMapped(String value) { when(amendmentBody.getFreeText()).thenReturn(value); var segments = translator.map(amendmentBody); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentNameToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentNameToEdifactMapperTest.java index 372a8e85e..b422eabc0 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentNameToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentNameToEdifactMapperTest.java @@ -49,7 +49,7 @@ void setUp() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingAllFields_expectAllFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingAllFields_Expect_AllFieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getSurname()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(SURNAME)))); when(jsonPatches.getFirstForename()).thenReturn(Optional.of(new AmendmentPatch() @@ -76,7 +76,7 @@ void whenAddingOrReplacingAllFields_expectAllFieldsAreMapped(AmendmentPatchOpera } @Test - void whenRemovingAllFields_expectAllFieldsAreMapped() { + void When_RemovingAllFields_Expect_AllFieldsAreMapped() { when(jsonPatches.getAllForenamesPath()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); when(jsonPatches.getTitle()).thenReturn(Optional.of(new AmendmentPatch() @@ -94,7 +94,7 @@ void whenRemovingAllFields_expectAllFieldsAreMapped() { } @Test - void whenRemovingSurname_expectException() { + void When_RemovingSurname_Expect_Exception() { when(jsonPatches.getSurname()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); @@ -105,7 +105,7 @@ void whenRemovingSurname_expectException() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenRemovingAllForenamesAndModifyingAtTheSameTime_expectException(AmendmentPatchOperation operation, SoftAssertions softly) { + void When_RemovingAllForenamesAndModifyingAtTheSameTime_Expect_Exception(AmendmentPatchOperation operation, SoftAssertions softly) { Stream.>>of( jsonPatches::getFirstForename, jsonPatches::getSecondForename, @@ -125,7 +125,7 @@ void whenRemovingAllForenamesAndModifyingAtTheSameTime_expectException(Amendment } @Test - void whenRemovingAnyForename_expectException(SoftAssertions softly) { + void When_RemovingAnyForename_Expect_Exception(SoftAssertions softly) { reset(jsonPatches); when(jsonPatches.getFirstForename()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE) @@ -153,7 +153,7 @@ void whenRemovingAnyForename_expectException(SoftAssertions softly) { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddOrReplaceValuesAreEmpty_expectException(AmendmentPatchOperation operation) { + void When_AddOrReplaceValuesAreEmpty_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getTitle()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setPath(JsonPatches.TITLE_PATH) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentPreviousNameToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentPreviousNameToEdifactMapperTest.java index bb98cb260..343c27632 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentPreviousNameToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentPreviousNameToEdifactMapperTest.java @@ -29,7 +29,7 @@ class AmendmentPreviousNameToEdifactMapperTest extends AmendmentFhirToEdifactTes @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingPreviousSurname_expectAllFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingPreviousSurname_Expect_AllFieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getPreviousSurname()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from(PREVIOUS_SURNAME)))); @@ -42,7 +42,7 @@ void whenAddingOrReplacingPreviousSurname_expectAllFieldsAreMapped(AmendmentPatc } @Test - void whenRemovingPreviousSurname_expectAllFieldsAreMapped() { + void When_RemovingPreviousSurname_Expect_AllFieldsAreMapped() { when(jsonPatches.getPreviousSurname()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); @@ -56,7 +56,7 @@ void whenRemovingPreviousSurname_expectAllFieldsAreMapped() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddOrReplaceValuesAreEmpty_expectException(AmendmentPatchOperation operation) { + void When_AddOrReplaceValuesAreEmpty_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getPreviousSurname()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setPath(JsonPatches.PREVIOUS_SURNAME_PATH) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentResidentialInstituteToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentResidentialInstituteToEdifactMapperTest.java index 9d4d62150..fcaedfe09 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentResidentialInstituteToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentResidentialInstituteToEdifactMapperTest.java @@ -27,7 +27,7 @@ class AmendmentResidentialInstituteToEdifactMapperTest extends AmendmentFhirToEd @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingWithCorrectValue_Expect_FieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getResidentialInstituteCode()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setValue(new AmendmentStringExtension.ResidentialInstituteCode("null")))); @@ -40,7 +40,7 @@ void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchO @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenRemoving_expectFieldsAreRemoved(AmendmentPatchOperation operation) { + void When_Removing_Expect_FieldsAreRemoved(AmendmentPatchOperation operation) { when(jsonPatches.getResidentialInstituteCode()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setValue(new AmendmentStringExtension.ResidentialInstituteCode(null)))); @@ -52,7 +52,7 @@ void whenRemoving_expectFieldsAreRemoved(AmendmentPatchOperation operation) { } @Test - void whenUsingRemoveOperation_expectException() { + void When_UsingRemoveOperation_Expect_Exception() { when(jsonPatches.getResidentialInstituteCode()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); @@ -63,7 +63,7 @@ void whenUsingRemoveOperation_expectException() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddOrReplaceValuesAreEmpty_expectException(AmendmentPatchOperation operation) { + void When_AddOrReplaceValuesAreEmpty_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getResidentialInstituteCode()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setValue(new AmendmentStringExtension.ResidentialInstituteCode(StringUtils.EMPTY)) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentSexToEdifactMapperTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentSexToEdifactMapperTest.java index 40e8a7107..6c9f7f8a7 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentSexToEdifactMapperTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/outbound/translator/amendment/mappers/AmendmentSexToEdifactMapperTest.java @@ -29,7 +29,7 @@ class AmendmentSexToEdifactMapperTest extends AmendmentFhirToEdifactTestBase { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchOperation operation) { + void When_AddingOrReplacingWithCorrectValue_Expect_FieldsAreMapped(AmendmentPatchOperation operation) { when(jsonPatches.getSex()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from("female")))); @@ -43,7 +43,7 @@ void whenAddingOrReplacingWithCorrectValue_expectFieldsAreMapped(AmendmentPatchO @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddingOrReplacingWithIncorrectValue_expectException(AmendmentPatchOperation operation) { + void When_AddingOrReplacingWithIncorrectValue_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getSex()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation).setValue(AmendmentValue.from("qwe")))); @@ -53,7 +53,7 @@ void whenAddingOrReplacingWithIncorrectValue_expectException(AmendmentPatchOpera } @Test - void whenUsingRemoveOperation_expectException() { + void When_UsingRemoveOperation_Expect_Exception() { when(jsonPatches.getSex()).thenReturn(Optional.of(new AmendmentPatch() .setOp(AmendmentPatchOperation.REMOVE))); @@ -64,7 +64,7 @@ void whenUsingRemoveOperation_expectException() { @ParameterizedTest @MethodSource(value = "getAddOrReplaceEnums") - void whenAddOrReplaceValuesAreEmpty_expectException(AmendmentPatchOperation operation) { + void When_AddOrReplaceValuesAreEmpty_Expect_Exception(AmendmentPatchOperation operation) { when(jsonPatches.getSex()).thenReturn(Optional.of(new AmendmentPatch() .setOp(operation) .setPath(JsonPatches.SEX_PATH) diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/rest/exception/FhirValidationExceptionTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/rest/exception/FhirValidationExceptionTest.java index 826824207..72f784e47 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/rest/exception/FhirValidationExceptionTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/rest/exception/FhirValidationExceptionTest.java @@ -36,14 +36,14 @@ public void beforeEach() { } @Test - public void testValidationResult_NoMessages() { + public void When_TestValidationResult_Expect_NoMessages() { when(validationResult.getMessages()).thenReturn(Collections.emptyList()); FhirValidationException exception = new FhirValidationException(validationResult); assertEquals("JSON FHIR Resource failed validation", exception.getMessage()); } @Test - public void testValidationResult_SingleMessage() { + public void When_TestValidationResult_Expect_SingleMessage() { SingleValidationMessage message = new SingleValidationMessage(); message.setMessage("the message"); when(validationResult.getMessages()).thenReturn(List.of(message)); @@ -52,7 +52,7 @@ public void testValidationResult_SingleMessage() { } @Test - public void testValidationResult_MultipleMessages() { + public void When_TestValidationResult_Expect_MultipleMessages() { SingleValidationMessage message = new SingleValidationMessage(); message.setMessage("the message"); when(validationResult.getMessages()).thenReturn(Arrays.asList(message, message, message)); @@ -61,7 +61,7 @@ public void testValidationResult_MultipleMessages() { } @Test - public void testWithoutValidationResult() { + public void When_TestWithoutValidationResult_Expect_StructuralIssue() { FhirValidationException ex = new FhirValidationException("the message"); assertEquals("the message", ex.getMessage()); OperationOutcome operationOutcome = (OperationOutcome) ex.getOperationOutcome(); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/sequence/SequenceServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/sequence/SequenceServiceTest.java index 845a03fce..bd0dcff5b 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/sequence/SequenceServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/sequence/SequenceServiceTest.java @@ -37,7 +37,7 @@ public void When_GenerateInterchangeId_Expect_CorrectValue() { } @Test - public void When_generateMessageId_Expect_ResetValue() { + public void When_GenerateMessageId_Expect_ResetValue() { when(sequenceRepository.getNext(MESSAGE_ID)).thenReturn(SEQ_VALUE); assertThat(sequenceService.generateMessageSequence("sender", "recipient")) .isEqualTo(SEQ_VALUE); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/OperationIdTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/OperationIdTest.java index 857b10dae..368a095f8 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/OperationIdTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/OperationIdTest.java @@ -7,7 +7,7 @@ class OperationIdTest { @Test - void whenBuildingOperationId_thenHashIsCreated() { + void When_BuildingOperationId_Expect_HashIsCreated() { assertEquals( "5d6c5b2009aa0a3a88ca8bd8ba339df16a831c35196136cba56f13b742461231", OperationId.buildOperationId("some_sender", 123L)); diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/PemFormatterTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/PemFormatterTest.java index 967b48883..046a43c67 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/PemFormatterTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/PemFormatterTest.java @@ -7,7 +7,7 @@ public class PemFormatterTest { @Test - public void when_certHasExtraWhitespace_then_itIsTrimmed() { + public void When_CertHasExtraWhitespace_Expect_ItIsTrimmed() { String withWhitespace = " -----BEGIN CERTIFICATE-----\n " + " \t MIIFXzCCA0egAwIBAgIJALRbCSor9bEbMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV \n" + " \n\n W/JNIRmhLoeFNGNh8HvhI2PwOCsFiqT1rrCaUtusTyH0Ggs=\n" + @@ -22,7 +22,7 @@ public void when_certHasExtraWhitespace_then_itIsTrimmed() { } @Test - public void when_certHasNoNewlines_then_itIsReformatted() { + public void When_CertHasNoNewlines_Expect_ItIsReformatted() { String withoutNewlines = "-----BEGIN RSA PRIVATE KEY-----" + " MIIJKQIBAAKCAgEA0x7V2cpEuXbLxb4TFigeN6e/TViXx4B9LMuHwwENX1P5V3O5" + " M0d/fLCFruu5dU3PWKoU2rTzUkflj5XOzu2xAftYi3KDMzRR2sByxjjxb/qMIybG" + @@ -37,7 +37,7 @@ public void when_certHasNoNewlines_then_itIsReformatted() { } @Test - public void when_certUsesDifferentHeaderAndFormattedCorrectly_then_itIsNotModified() { + public void When_CertUsesDifferentHeaderAndFormattedCorrectly_Expect_ItIsNotModified() { String pem = "-----BEGIN PRIVATE KEY-----\n" + "MIIJKQIBAAKCAgEA0x7V2cpEuXbLxb4TFigeN6e/TViXx4B9LMuHwwENX1P5V3O5\n" + "M0d/fLCFruu5dU3PWKoU2rTzUkflj5XOzu2xAftYi3KDMzRR2sByxjjxb/qMIybG\n" + diff --git a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/TimestampServiceTest.java b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/TimestampServiceTest.java index 08c4c091d..3521defe6 100644 --- a/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/TimestampServiceTest.java +++ b/src/test/java/uk/nhs/digital/nhsconnect/nhais/utils/TimestampServiceTest.java @@ -8,7 +8,7 @@ class TimestampServiceTest { @Test - public void whenGettingTimestamp_thenPrecisionIsMilliseconds() { + public void When_GettingTimestamp_Expect_PrecisionIsMilliseconds() { var instant = new TimestampService().getCurrentTimestamp(); long remainder = instant.getNano() % 1000000; // nanoseconds per millisecond @@ -16,7 +16,7 @@ public void whenGettingTimestamp_thenPrecisionIsMilliseconds() { } @Test - public void whenFormattingInISO_thenISOForUKZoneIsReturned() { + public void When_FormattingInISO_Expect_ISOForUKZoneIsReturned() { Instant timestamp = Instant.ofEpochSecond(123123); assertThat(new TimestampService().formatInISO(timestamp)).isEqualTo("1970-01-02T11:12:03+01:00[Europe/London]");