Skip to content

Commit 9182a21

Browse files
* Address checkstyle [MethodName] issues (Name must match pattern.) (#304)
* Address checkstyle [MethodName] issues (Name must match pattern.) (#304)
1 parent 4de3f64 commit 9182a21

File tree

101 files changed

+323
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+323
-326
lines changed

src/test/java/uk/nhs/digital/nhsconnect/nhais/IntegrationAdaptorNhaisApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class IntegrationAdaptorNhaisApplicationTests {
1212

1313
@Test
14-
void when_databaseIsNotReachable_then_applicationStartsUpWithNegativeHealthcheck() {
14+
void When_DatabaseIsNotReachable_Expect_ApplicationStartsUpWithNegativeHealthcheck() {
1515
}
1616

1717
}

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundEdifactTransactionHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void setUp() {
4343
}
4444

4545
@Test
46-
void whenTranslatingAmendment_expectPatchTranslationServiceIsUsed() {
46+
void When_TranslatingAmendment_Expect_PatchTranslationServiceIsUsed() {
4747
when(message.getReferenceTransactionType())
4848
.thenReturn(new ReferenceTransactionType(ReferenceTransactionType.Inbound.AMENDMENT));
4949
var amendmentBody = new AmendmentBody();
@@ -59,7 +59,7 @@ void whenTranslatingAmendment_expectPatchTranslationServiceIsUsed() {
5959

6060
@ParameterizedTest
6161
@EnumSource(names = {"DEDUCTION", "REJECTION", "APPROVAL"})
62-
void whenTranslatingNonAmendment_expectFhirTranslationServiceIsUsed(ReferenceTransactionType.Inbound transactionType) {
62+
void When_TranslatingNonAmendment_Expect_FhirTranslationServiceIsUsed(ReferenceTransactionType.Inbound transactionType) {
6363
when(message.getReferenceTransactionType())
6464
.thenReturn(new ReferenceTransactionType(transactionType));
6565
var parameters = new Parameters();

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/InboundOperationIdServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ private void beforeEach() {
5353

5454
@ParameterizedTest
5555
@EnumSource(value = ReferenceTransactionType.Inbound.class, names = {"APPROVAL", "REJECTION"})
56-
public void When_ApprovalOrRejectionTransaction_Then_OperationIdUsesRecipient(ReferenceTransactionType.Inbound transactionType) {
56+
public void When_ApprovalOrRejectionTransaction_Expect_OperationIdUsesRecipient(ReferenceTransactionType.Inbound transactionType) {
5757
when(referenceTransactionType.getTransactionType()).thenReturn(transactionType);
5858
when(interchangeHeader.getRecipient()).thenReturn(RECIPIENT);
5959
assertThat(RECIPIENT_OID).isEqualTo(operationIdService.createOperationIdForTransaction(transaction));
6060
}
6161

6262
@ParameterizedTest
6363
@EnumSource(value = ReferenceTransactionType.Inbound.class, names = {"APPROVAL", "REJECTION"}, mode = EnumSource.Mode.EXCLUDE)
64-
public void When_AllOtherTransactions_Then_OperationIdUsesSender(ReferenceTransactionType.Inbound transactionType) {
64+
public void When_AllOtherTransactions_Expect_OperationIdUsesSender(ReferenceTransactionType.Inbound transactionType) {
6565
when(referenceTransactionType.getTransactionType()).thenReturn(transactionType);
6666
when(interchangeHeader.getSender()).thenReturn(SENDER);
6767
assertThat(SENDER_OID).isEqualTo(operationIdService.createOperationIdForTransaction(transaction));

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/RecepProducerServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class RecepProducerServiceTest {
5555
private TimestampService timestampService;
5656

5757
@Test
58-
public void whenProducingRecep_thenValidRecepIsCreated() throws IOException {
58+
public void When_ProducingRecep_Expect_ValidRecepIsCreated() throws IOException {
5959
when(timestampService.getCurrentTimestamp()).thenReturn(FIXED_TIME);
6060
when(sequenceService.generateInterchangeSequence(REF_SENDER, REF_RECIPIENT)).thenReturn(RECEP_INTERCHANGE_SEQUENCE);
6161
when(sequenceService.generateMessageSequence(REF_SENDER, REF_RECIPIENT)).thenReturn(RECEP_MESSAGE_SEQUENCE);

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionRejectionTransactionMapperTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DeductionRejectionTransactionMapperTest {
5555
private GpNameAndAddress gpNameAndAddress;
5656

5757
@Test
58-
void when_AllDataPresent_then_mapped(SoftAssertions softly) {
58+
void When_AllDataPresent_Expect_Mapped(SoftAssertions softly) {
5959
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
6060
when(personName.getNhsNumber()).thenReturn(NHS_NUMBER);
6161
when(transaction.getFreeText()).thenReturn(Optional.of(new FreeText("TEXT VALUE")));
@@ -78,7 +78,7 @@ void when_AllDataPresent_then_mapped(SoftAssertions softly) {
7878
}
7979

8080
@Test
81-
void when_missingOfficialPatientIdentifier_then_throwsException() {
81+
void When_MissingOfficialPatientIdentifier_Expect_ThrowsException() {
8282
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
8383
when(personName.getNhsNumber()).thenReturn(null);
8484
when(transaction.getMessage()).thenReturn(message);
@@ -94,7 +94,7 @@ void when_missingOfficialPatientIdentifier_then_throwsException() {
9494
}
9595

9696
@Test
97-
void when_missingPersonNameSegment_then_throwsException() {
97+
void When_MissingPersonNameSegment_Expect_ThrowsException() {
9898
when(transaction.getPersonName()).thenReturn(Optional.empty());
9999
when(transaction.getMessage()).thenReturn(message);
100100
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
@@ -109,7 +109,7 @@ void when_missingPersonNameSegment_then_throwsException() {
109109
}
110110

111111
@Test
112-
void when_missingHaNotes_then_throwsException() {
112+
void When_MissingHaNotes_Expect_ThrowsException() {
113113
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
114114
when(personName.getNhsNumber()).thenReturn(NHS_NUMBER);
115115
when(transaction.getFreeText()).thenReturn(Optional.empty());

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/DeductionTransactionMapperTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DeductionTransactionMapperTest {
6161
private GpNameAndAddress gpNameAndAddress;
6262

6363
@Test
64-
void when_allFieldsInTransaction_Then_mapAllFields(SoftAssertions softly) {
64+
void When_AllFieldsInTransaction_Expect_MapAllFields(SoftAssertions softly) {
6565
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
6666
when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode));
6767
when(transaction.getDeductionDate()).thenReturn(Optional.of(deductionDate));
@@ -91,7 +91,7 @@ void when_allFieldsInTransaction_Then_mapAllFields(SoftAssertions softly) {
9191
}
9292

9393
@Test
94-
void when_allMandatoryFieldsInTransaction_Then_mapOnlyMandatoryFields(SoftAssertions softly) {
94+
void When_AllMandatoryFieldsInTransaction_Expect_MapOnlyMandatoryFields(SoftAssertions softly) {
9595
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
9696
when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode));
9797
when(transaction.getDeductionDate()).thenReturn(Optional.of(deductionDate));
@@ -119,7 +119,7 @@ void when_allMandatoryFieldsInTransaction_Then_mapOnlyMandatoryFields(SoftAssert
119119
}
120120

121121
@Test
122-
void when_NhsNumberIsMissing_Then_ThrowException(SoftAssertions softly) {
122+
void When_NhsNumberIsMissing_Expect_ThrowException(SoftAssertions softly) {
123123
when(transaction.getPersonName()).thenReturn(Optional.empty());
124124
when(transaction.getMessage()).thenReturn(message);
125125
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
@@ -133,7 +133,7 @@ void when_NhsNumberIsMissing_Then_ThrowException(SoftAssertions softly) {
133133
}
134134

135135
@Test
136-
void when_DeductionReasonCodeIsMissing_Then_ThrowException(SoftAssertions softly) {
136+
void When_DeductionReasonCodeIsMissing_Expect_ThrowException(SoftAssertions softly) {
137137
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
138138
when(transaction.getDeductionReasonCode()).thenReturn(Optional.empty());
139139
when(transaction.getMessage()).thenReturn(message);
@@ -150,7 +150,7 @@ void when_DeductionReasonCodeIsMissing_Then_ThrowException(SoftAssertions softly
150150
}
151151

152152
@Test
153-
void when_DeductionDateIsMissing_Then_ThrowException(SoftAssertions softly) {
153+
void When_DeductionDateIsMissing_Expect_ThrowException(SoftAssertions softly) {
154154
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
155155
when(transaction.getDeductionReasonCode()).thenReturn(Optional.of(deductionReasonCode));
156156
when(transaction.getDeductionDate()).thenReturn(Optional.empty());

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69FlagRemovalTransactionMapperTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FP69FlagRemovalTransactionMapperTest {
5656
private GpNameAndAddress gpNameAndAddress;
5757

5858
@Test
59-
void when_AllDataPresent_then_mapped(SoftAssertions softly) {
59+
void When_AllDataPresent_Expect_Mapped(SoftAssertions softly) {
6060
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
6161
when(personName.getNhsNumber()).thenReturn(NHS_NUMBER);
6262
when(transaction.getMessage()).thenReturn(message);
@@ -76,7 +76,7 @@ void when_AllDataPresent_then_mapped(SoftAssertions softly) {
7676
}
7777

7878
@Test
79-
void when_missingOfficialPatientIdentifier_then_throwsException() {
79+
void When_MissingOfficialPatientIdentifier_Expect_ThrowsException() {
8080
when(transaction.getPersonName()).thenReturn(Optional.of(personName));
8181
when(personName.getNhsNumber()).thenReturn(null);
8282
when(transaction.getMessage()).thenReturn(message);
@@ -91,7 +91,7 @@ void when_missingOfficialPatientIdentifier_then_throwsException() {
9191
}
9292

9393
@Test
94-
void when_missingPersonNameSegment_then_throwsException() {
94+
void When_MissingPersonNameSegment_Expect_ThrowsException() {
9595
when(transaction.getPersonName()).thenReturn(Optional.empty());
9696
when(transaction.getMessage()).thenReturn(message);
9797
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/FP69PriorNotificationTransactionMapperTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class FP69PriorNotificationTransactionMapperTest {
6969
private GpNameAndAddress gpNameAndAddress;
7070

7171
@Test
72-
void whenPersonNameSegmentIsMissing_expectException() {
72+
void When_PersonNameSegmentIsMissing_Expect_Exception() {
7373
when(transaction.getPersonName()).thenReturn(Optional.empty());
7474
when(transaction.getMessage()).thenReturn(message);
7575
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
@@ -83,7 +83,7 @@ void whenPersonNameSegmentIsMissing_expectException() {
8383
}
8484

8585
@Test
86-
void whenNhsNumberIsMissing_expectException() {
86+
void When_NhsNumberIsMissing_Expect_Exception() {
8787
when(transaction.getPersonName()).thenReturn(Optional.of(PersonName.builder().build()));
8888
when(transaction.getMessage()).thenReturn(message);
8989
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
@@ -97,7 +97,7 @@ void whenNhsNumberIsMissing_expectException() {
9797
}
9898

9999
@Test
100-
void whenSurnameIsMissing_expectException() {
100+
void When_SurnameIsMissing_Expect_Exception() {
101101
when(transaction.getMessage()).thenReturn(message);
102102
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
103103
when(message.getInterchange()).thenReturn(interchange);
@@ -113,7 +113,7 @@ void whenSurnameIsMissing_expectException() {
113113
}
114114

115115
@Test
116-
void whenDateOfBirthSegmentIsMissing_expectException() {
116+
void When_DateOfBirthSegmentIsMissing_Expect_Exception() {
117117
when(transaction.getMessage()).thenReturn(message);
118118
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
119119
when(message.getInterchange()).thenReturn(interchange);
@@ -131,7 +131,7 @@ void whenDateOfBirthSegmentIsMissing_expectException() {
131131
}
132132

133133
@Test
134-
void whenReasonCodeSegmentIsMissing_expectException() {
134+
void When_ReasonCodeSegmentIsMissing_Expect_Exception() {
135135
when(transaction.getMessage()).thenReturn(message);
136136
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
137137
when(message.getInterchange()).thenReturn(interchange);
@@ -152,7 +152,7 @@ void whenReasonCodeSegmentIsMissing_expectException() {
152152
}
153153

154154
@Test
155-
void whenExpiryDateSegmentIsMissing_expectException() {
155+
void When_ExpiryDateSegmentIsMissing_Expect_Exception() {
156156
when(transaction.getMessage()).thenReturn(message);
157157
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
158158
when(message.getInterchange()).thenReturn(interchange);
@@ -174,7 +174,7 @@ void whenExpiryDateSegmentIsMissing_expectException() {
174174
}
175175

176176
@Test
177-
void whenMappingRequiredValues_expectParametersAreMapped(SoftAssertions softly) {
177+
void When_MappingRequiredValues_Expect_ParametersAreMapped(SoftAssertions softly) {
178178
when(transaction.getMessage()).thenReturn(message);
179179
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
180180
when(message.getInterchange()).thenReturn(interchange);
@@ -189,7 +189,7 @@ void whenMappingRequiredValues_expectParametersAreMapped(SoftAssertions softly)
189189
}
190190

191191
@Test
192-
void whenMappingAllValues_expectParametersAreMapped(SoftAssertions softly) {
192+
void When_MappingAllValues_Expect_ParametersAreMapped(SoftAssertions softly) {
193193
when(transaction.getMessage()).thenReturn(message);
194194
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);
195195
when(message.getInterchange()).thenReturn(interchange);

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/fhir/mapper/RejectionTransactionMapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void testMap(SoftAssertions softly) {
6363
}
6464

6565
@Test
66-
void whenFreeTextIsMissing_expectException(SoftAssertions softly) {
66+
void When_FreeTextIsMissing_Expect_Exception(SoftAssertions softly) {
6767
when(transaction.getFreeText()).thenReturn(Optional.empty());
6868
when(transaction.getMessage()).thenReturn(message);
6969
when(transaction.getGpNameAndAddress()).thenReturn(gpNameAndAddress);

src/test/java/uk/nhs/digital/nhsconnect/nhais/inbound/jsonpatch/EdifactToPatchServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void setUp() {
6767
}
6868

6969
@Test
70-
void whenConvertingToPatch_properMandatoryFieldsAreSet() {
70+
void When_ConvertingToPatch_Expect_ProperMandatoryFieldsAreSet() {
7171
var amendmentBody = edifactToPatchService.convertToPatch(transaction);
7272

7373
assertThat(amendmentBody.getNhsNumber()).isEqualTo(NHS_NUMBER);

0 commit comments

Comments
 (0)