Skip to content

Commit

Permalink
Fix #336: Remove public modifier from JUnit5 tests (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
banterCZ authored Sep 1, 2022
1 parent 57b0c4e commit ef47af5
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
@ActiveProfiles("mock")
@ComponentScan(basePackages = {"com.wultra.app.onboardingserver.docverify.mock"})
@EnableConfigurationProperties
public class WultraMockDocumentVerificationProviderTest extends AbstractDocumentVerificationProviderTest {
class WultraMockDocumentVerificationProviderTest extends AbstractDocumentVerificationProviderTest {

private WultraMockDocumentVerificationProvider provider;

private OwnerId ownerId;

@BeforeEach
public void init() {
void init() {
ownerId = createOwnerId();
}

Expand All @@ -65,7 +65,7 @@ public void setProvider(WultraMockDocumentVerificationProvider provider) {
}

@Test
public void checkDocumentUploadTest() throws Exception {
void checkDocumentUploadTest() throws Exception {
SubmittedDocument document = createSubmittedDocument();
DocumentsSubmitResult submitResult = provider.submitDocuments(ownerId, List.of(document));

Expand All @@ -81,7 +81,7 @@ public void checkDocumentUploadTest() throws Exception {
}

@Test
public void submitDocumentsTest() throws Exception {
void submitDocumentsTest() throws Exception {
SubmittedDocument document = createSubmittedDocument();
List<SubmittedDocument> documents = ImmutableList.of(document);

Expand All @@ -91,7 +91,7 @@ public void submitDocumentsTest() throws Exception {
}

@Test
public void verifyDocumentsTest() throws Exception {
void verifyDocumentsTest() throws Exception {
List<String> uploadIds = ImmutableList.of("doc_1", "doc_2");

DocumentsVerificationResult result = provider.verifyDocuments(ownerId, uploadIds);
Expand All @@ -100,7 +100,7 @@ public void verifyDocumentsTest() throws Exception {
}

@Test
public void getVerificationResultTest() throws Exception {
void getVerificationResultTest() throws Exception {
List<String> uploadIds = ImmutableList.of("doc_1", "doc_2");

DocumentsVerificationResult result = provider.verifyDocuments(ownerId, uploadIds);
Expand All @@ -125,22 +125,22 @@ public void getVerificationResultTest() throws Exception {
}

@Test
public void getPhotoTest() throws Exception {
void getPhotoTest() throws Exception {
Image photo = provider.getPhoto("photoId");

assertNotNull(photo.getData());
assertNotNull(photo.getFilename());
}

@Test
public void cleanupDocumentsTest() throws Exception {
void cleanupDocumentsTest() throws Exception {
List<String> uploadIds = ImmutableList.of("doc_1", "doc_2");

provider.cleanupDocuments(ownerId, uploadIds);
}

@Test
public void parseRejectionReasonsTest() throws Exception {
void parseRejectionReasonsTest() throws Exception {
DocumentResultEntity docResultRejected = new DocumentResultEntity();
docResultRejected.setVerificationResult("{\"reason\":\"rejected\"}");
assertEquals(List.of("Rejection reason"), provider.parseRejectionReasons(docResultRejected));
Expand All @@ -151,7 +151,7 @@ public void parseRejectionReasonsTest() throws Exception {
}

@Test
public void initVerificationSdkTest() throws Exception {
void initVerificationSdkTest() throws Exception {
Map<String, String> attributes = Map.of(MockConst.SDK_INIT_TOKEN, "mock-sdk-init-token");
VerificationSdkInfo verificationSdkInfo = provider.initVerificationSdk(ownerId, attributes);
assertNotNull(verificationSdkInfo.getAttributes().get(MockConst.SDK_INIT_RESPONSE), "Missing SDK init response");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
@ComponentScan(basePackages = {"com.wultra.app.onboardingserver.docverify.zenid"})
@EnableConfigurationProperties
@Tag("external-service")
public class ZenidDocumentVerificationProviderTest extends AbstractDocumentVerificationProviderTest {
class ZenidDocumentVerificationProviderTest extends AbstractDocumentVerificationProviderTest {

private static final Logger logger = LoggerFactory.getLogger(ZenidDocumentVerificationProviderTest.class);

Expand Down Expand Up @@ -94,7 +94,7 @@ public void teardown() {
}

@Test
public void checkDocumentUploadTest() throws Exception {
void checkDocumentUploadTest() throws Exception {
SubmittedDocument document = createIdCardFrontDocument();
List<SubmittedDocument> documents = List.of(document);

Expand All @@ -110,7 +110,7 @@ public void checkDocumentUploadTest() throws Exception {
}

@Test
public void submitDocumentsTest() throws Exception {
void submitDocumentsTest() throws Exception {
List<SubmittedDocument> documents = createSubmittedDocuments();

DocumentsSubmitResult result = submitDocuments(ownerId, documents);
Expand All @@ -119,7 +119,7 @@ public void submitDocumentsTest() throws Exception {
}

@Test
public void verifyDocumentsTest() throws Exception {
void verifyDocumentsTest() throws Exception {
List<SubmittedDocument> documents = createSubmittedDocuments();

DocumentsSubmitResult submitResult = provider.submitDocuments(ownerId, documents);
Expand All @@ -135,7 +135,7 @@ public void verifyDocumentsTest() throws Exception {
}

@Test
public void getVerificationResultTest() throws Exception {
void getVerificationResultTest() throws Exception {
List<SubmittedDocument> documents = createSubmittedDocuments();

DocumentsSubmitResult submitResult = provider.submitDocuments(ownerId, documents);
Expand All @@ -155,7 +155,7 @@ public void getVerificationResultTest() throws Exception {
}

@Test
public void getPhotoTest() throws Exception {
void getPhotoTest() throws Exception {
List<SubmittedDocument> documents = createSubmittedDocuments();

DocumentsSubmitResult result = provider.submitDocuments(ownerId, documents);
Expand All @@ -167,7 +167,7 @@ public void getPhotoTest() throws Exception {
}

@Test
public void cleanupDocumentsTest() throws Exception {
void cleanupDocumentsTest() throws Exception {
List<SubmittedDocument> documents = createSubmittedDocuments();

submitDocuments(ownerId, documents);
Expand All @@ -176,15 +176,15 @@ public void cleanupDocumentsTest() throws Exception {
}

@Test
public void parseRejectionReasonsTest() throws Exception {
void parseRejectionReasonsTest() throws Exception {
DocumentResultEntity docResult = new DocumentResultEntity();
docResult.setVerificationResult("[{\"Ok\": false, \"Issues\":[{\"IssueDescription\": \"Rejection reason\"}]}]");
List<String> rejectionReasons = provider.parseRejectionReasons(docResult);
assertEquals(List.of("Rejection reason"), rejectionReasons);
}

@Test
public void initVerificationSdkTest() throws Exception {
void initVerificationSdkTest() throws Exception {
Map<String, String> attributes = Map.of(ZenidConst.SDK_INIT_TOKEN, "sdk-init-token");
VerificationSdkInfo verificationSdkInfo = provider.initVerificationSdk(ownerId, attributes);
assertNotNull(verificationSdkInfo.getAttributes().get(ZenidConst.SDK_INIT_RESPONSE), "Missing SDK init response");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@ComponentScan(basePackages = {"com.wultra.app.onboardingserver.presencecheck.iproov"})
@EnableConfigurationProperties
@Tag("external-service")
public class IProovPresenceCheckProviderTest {
class IProovPresenceCheckProviderTest {

private IProovPresenceCheckProvider provider;

Expand All @@ -63,19 +63,19 @@ public void setProvider(IProovPresenceCheckProvider provider) {
}

@Test
public void initPresenceCheckTest() throws Exception {
void initPresenceCheckTest() throws Exception {
initPresenceCheck(ownerId);
}

// FIXME temporary testing of repeated initiatilization (not implemented deletion of previous iProov enrollment)
@Test
public void repeatInitPresenceCheckTest() throws Exception {
void repeatInitPresenceCheckTest() throws Exception {
initPresenceCheck(ownerId);
initPresenceCheck(ownerId);
}

@Test
public void startPresenceCheckTest() throws Exception {
void startPresenceCheckTest() throws Exception {
initPresenceCheck(ownerId);

SessionInfo sessionInfo = provider.startPresenceCheck(ownerId);
Expand All @@ -86,7 +86,7 @@ public void startPresenceCheckTest() throws Exception {
}

@Test
public void getResultTest() throws Exception {
void getResultTest() throws Exception {
initPresenceCheck(ownerId);

SessionInfo sessionInfo = provider.startPresenceCheck(ownerId);
Expand All @@ -97,7 +97,7 @@ public void getResultTest() throws Exception {
}

@Test
public void repeatPresenceCheckStartTest() throws Exception {
void repeatPresenceCheckStartTest() throws Exception {
initPresenceCheck(ownerId);

SessionInfo sessionInfo1 = provider.startPresenceCheck(ownerId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
class IProovRestApiServiceTest {

@Test
public void ensureValidUserIdValueTest() throws Exception {
void ensureValidUserIdValueTest() throws Exception {
assertThrows(IllegalArgumentException.class, () -> {
IProovRestApiService.ensureValidUserIdValue("invalidChars,[=");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
@ActiveProfiles("mock")
@ComponentScan(basePackages = {"com.wultra.app.onboardingserver.presencecheck.mock"})
@EnableConfigurationProperties
public class WultraMockPresenceCheckProviderTest {
class WultraMockPresenceCheckProviderTest {

private WultraMockPresenceCheckProvider provider;

private OwnerId ownerId;

@BeforeEach
public void init() {
void init() {
ownerId = createOwnerId();
}

Expand All @@ -59,12 +59,12 @@ public void setProvider(WultraMockPresenceCheckProvider provider) {
}

@Test
public void initPresenceCheckTest() throws Exception {
void initPresenceCheckTest() throws Exception {
initPresenceCheck();
}

@Test
public void startPresenceCheckTest() throws Exception {
void startPresenceCheckTest() throws Exception {
initPresenceCheck();

SessionInfo sessionInfo = provider.startPresenceCheck(ownerId);
Expand All @@ -75,7 +75,7 @@ public void startPresenceCheckTest() throws Exception {
}

@Test
public void getResultTest() throws Exception {
void getResultTest() throws Exception {
SessionInfo sessionInfo = new SessionInfo();
sessionInfo.getSessionAttributes().put(MockConst.VERIFICATION_TOKEN, "token");

Expand All @@ -86,7 +86,7 @@ public void getResultTest() throws Exception {
}

@Test
public void cleanupIdentityDataTest() throws Exception {
void cleanupIdentityDataTest() throws Exception {
provider.cleanupIdentityData(ownerId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@SpringBootTest(classes = {EnrollmentServerTestApplication.class})
@ActiveProfiles("test-onboarding")
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class ClientEvaluationTransitionsTest extends AbstractStateMachineTest {
class ClientEvaluationTransitionsTest extends AbstractStateMachineTest {

@MockBean
private IdentityVerificationConfig identityVerificationConfig;
Expand All @@ -59,27 +59,27 @@ public class ClientEvaluationTransitionsTest extends AbstractStateMachineTest {
private VerificationProcessResultAction verificationProcessResultAction;

@Test
public void testClientEvaluationAccepted() throws Exception {
void testClientEvaluationAccepted() throws Exception {
testClientVerificationStatus(IdentityVerificationStatus.ACCEPTED, OnboardingState.CLIENT_EVALUATION_ACCEPTED);
}

@Test
public void testClientEvaluationInProgress() throws Exception {
void testClientEvaluationInProgress() throws Exception {
testClientVerificationStatus(IdentityVerificationStatus.IN_PROGRESS, OnboardingState.CLIENT_EVALUATION_IN_PROGRESS);
}

@Test
public void testClientEvaluationFailed() throws Exception {
void testClientEvaluationFailed() throws Exception {
testClientVerificationStatus(IdentityVerificationStatus.FAILED, OnboardingState.CLIENT_EVALUATION_FAILED);
}

@Test
public void testClientEvaluationRejected() throws Exception {
void testClientEvaluationRejected() throws Exception {
testClientVerificationStatus(IdentityVerificationStatus.REJECTED, OnboardingState.CLIENT_EVALUATION_REJECTED);
}

@Test
public void testClientEvaluationAcceptedToPresenceCheckInit() throws Exception {
void testClientEvaluationAcceptedToPresenceCheckInit() throws Exception {
IdentityVerificationEntity idVerification =
createIdentityVerification(IdentityVerificationPhase.CLIENT_EVALUATION, IdentityVerificationStatus.ACCEPTED);
StateMachine<OnboardingState, OnboardingEvent> stateMachine = createStateMachine(idVerification);
Expand All @@ -101,7 +101,7 @@ public void testClientEvaluationAcceptedToPresenceCheckInit() throws Exception {
}

@Test
public void testDocumentVerificationTransitionToSendingOtp() throws Exception {
void testDocumentVerificationTransitionToSendingOtp() throws Exception {
IdentityVerificationEntity idVerification =
createIdentityVerification(IdentityVerificationPhase.CLIENT_EVALUATION, IdentityVerificationStatus.ACCEPTED);
StateMachine<OnboardingState, OnboardingEvent> stateMachine = createStateMachine(idVerification);
Expand Down Expand Up @@ -130,7 +130,7 @@ public void testDocumentVerificationTransitionToSendingOtp() throws Exception {
}

@Test
public void testDocumentVerificationTransitionCompleted() throws Exception {
void testDocumentVerificationTransitionCompleted() throws Exception {
IdentityVerificationEntity idVerification =
createIdentityVerification(IdentityVerificationPhase.CLIENT_EVALUATION, IdentityVerificationStatus.ACCEPTED);
StateMachine<OnboardingState, OnboardingEvent> stateMachine = createStateMachine(idVerification);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
@SpringBootTest(classes = {EnrollmentServerTestApplication.class})
@ActiveProfiles("test-onboarding")
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class DocumentUploadTransitionsTest extends AbstractStateMachineTest {
class DocumentUploadTransitionsTest extends AbstractStateMachineTest {

@MockBean
private IdentityVerificationService identityVerificationService;

@Test
public void testDocumentUploadInProgress() throws Exception {
void testDocumentUploadInProgress() throws Exception {
IdentityVerificationEntity idVerification =
createIdentityVerification(IdentityVerificationPhase.DOCUMENT_UPLOAD, IdentityVerificationStatus.IN_PROGRESS);
StateMachine<OnboardingState, OnboardingEvent> stateMachine = createStateMachine(idVerification);
Expand All @@ -66,7 +66,7 @@ public void testDocumentUploadInProgress() throws Exception {
}

@Test
public void testDocumentVerificationPending() throws Exception {
void testDocumentVerificationPending() throws Exception {
IdentityVerificationEntity idVerification =
createIdentityVerification(IdentityVerificationPhase.DOCUMENT_UPLOAD, IdentityVerificationStatus.IN_PROGRESS);
StateMachine<OnboardingState, OnboardingEvent> stateMachine = createStateMachine(idVerification);
Expand Down
Loading

0 comments on commit ef47af5

Please sign in to comment.