Skip to content

Refactor JUnit 5 Tests for BaseTestDSASignatureInterop#1468

Open
Mohit-Rajbhar100698 wants to merge 1 commit into
IBM:mainfrom
Mohit-Rajbhar100698:refactor-junit5-BaseTestDSASignatureInterop-tests
Open

Refactor JUnit 5 Tests for BaseTestDSASignatureInterop#1468
Mohit-Rajbhar100698 wants to merge 1 commit into
IBM:mainfrom
Mohit-Rajbhar100698:refactor-junit5-BaseTestDSASignatureInterop-tests

Conversation

@Mohit-Rajbhar100698
Copy link
Copy Markdown
Collaborator

Replace multiple test classes extending BaseTestDSASignatureInterop with a single JUnit 5 parameterized test class

Signed-off-by: Mohit Rajbhar mohit.rajbhar@ibm.com

@Mohit-Rajbhar100698 Mohit-Rajbhar100698 force-pushed the refactor-junit5-BaseTestDSASignatureInterop-tests branch from 90700db to edfcd4e Compare May 15, 2026 07:02
@BeforeEach
public void setUp() throws Exception {
setAndInsertProvider(provider);
setInteropProviderName(TestProvider.SUN.getProviderName());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we hardcode this here or have the interop provider as a parameter too? @jasonkatonica what do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m only using enum TestProvider.SUN here to get the provider name for the interop provider .
not passing through the JUnit 5 parameterization.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistancy i think i woudl prefer using parameters like other interop tests. Sure in this case we are only doing it against SUN however in the future it would be easier to add other providers using same code pattern as other interop tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally we could remove SUN from the testcase name to generalize it as a interop test for DSA signatures.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also upon further inspection there is a test TestDSASignatureInteropBC I think this test should also be included in this update ( and refactored to use parameters and the BC provider )

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistancy i think i woudl prefer using parameters like other interop tests. Sure in this case we are only doing it against SUN however in the future it would be easier to add other providers using same code pattern as other interop tests.

I have parameterized the interop provider as well.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally we could remove SUN from the testcase name to generalize it as a interop test for DSA signatures.

Removed SUN from test name

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also upon further inspection there is a test TestDSASignatureInteropBC I think this test should also be included in this update ( and refactored to use parameters and the BC provider )

Since TestDSASignatureInteropBC extends BaseTestDSASignatureInterop2, As we discussed we will handle that refactoring separately in another PR.

@Mohit-Rajbhar100698 Mohit-Rajbhar100698 force-pushed the refactor-junit5-BaseTestDSASignatureInterop-tests branch from edfcd4e to 893ded6 Compare May 20, 2026 09:00
Replace multiple test classes extending BaseTestDSASignatureInterop with a single JUnit 5 parameterized test class

Signed-off-by: Mohit Rajbhar <mohit.rajbhar@ibm.com>
@Mohit-Rajbhar100698 Mohit-Rajbhar100698 force-pushed the refactor-junit5-BaseTestDSASignatureInterop-tests branch from 893ded6 to d9a6071 Compare May 21, 2026 17:27
@BeforeEach
public void setUp() throws Exception {
setAndInsertProvider(provider);
setInteropProviderName(interopProvider.getProviderName());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to do a setAndInsertProvider() for the interop provider too, in case it's not in the provider list? I know we are just using the Sun provider here, but I think it's good practice.

Copy link
Copy Markdown
Member

@jasonkatonica jasonkatonica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants