Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURATOR-692. Get rid of mockito #485

Merged
merged 8 commits into from
Oct 11, 2023
Merged

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented Oct 4, 2023

Ref - CURATOR-692

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun marked this pull request as ready for review October 4, 2023 10:51
@@ -755,19 +754,6 @@ public void testNullNamespace() {
CloseableUtils.closeQuietly(client);
}

@Test
public void testNoPartialConstruction() {
Copy link
Member Author

Choose a reason for hiding this comment

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

The original behavior test is covered by testNullNamespace - #475

We don't need this detailed test.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. EnsurePath is well-implemented, battle-tested, and deprecated, which means it's stable and doesn't not subject to change.
  2. This test checks how many exist calls happen - why? Although we can take some effort to port it, I don't think it is worthy.

Signed-off-by: tison <wander4096@gmail.com>
Copy link
Member

@kezhuw kezhuw left a comment

Choose a reason for hiding this comment

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

+1

Thank you for your efforts!

<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

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

I am positive to this. I prefer real classes than mocks in most cases if not all. I do believe mock could provide "clean" tests, but the "clean" part could lost effect in refactor comparing to stupid/verbose/explicit hooks. Also, I am fearing about tests full of mocks. Removing this will force us to think about testability. That is good for me.

@tisonkun tisonkun merged commit 2a94b2d into apache:master Oct 11, 2023
5 checks passed
@tisonkun tisonkun deleted the get-rid-of-mockito branch October 11, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants