Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Oct 10, 2025

What changes were proposed in this pull request?

This PR aims to upgrade JUnit to 6.0.0.

Why are the changes needed?

JUnit 6 is released finally.

Does this PR introduce any user-facing change?

No behavior change because this is a test dependency.

How was this patch tested?

Pass the CIs.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the BUILD label Oct 10, 2025
Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

Pending CI

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya .

@dongjoon-hyun
Copy link
Member Author

Merged to main.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-53871 branch October 10, 2025 20:12
dongjoon-hyun added a commit that referenced this pull request Oct 10, 2025
### What changes were proposed in this pull request?

This PR aims to revisit `JUnit` assertion usage in test cases after upgrading to `JUnit 6`.
- #383

### Why are the changes needed?

There are three cases:

1. Fix wrong usage of `assertEquals`: The first parameter is the expected value.

```java
- assertEquals(previousGeneration2, 1L);
+ assertEquals(1L, previousGeneration2);
```

2. `assertNull` is better than `assertEquals(null, *)`.

```java
- assertEquals(null, spec1.runtimeVersions.jdkVersion);
- assertEquals(null, spec1.runtimeVersions.scalaVersion);
- assertEquals(null, spec1.runtimeVersions.sparkVersion);
+ assertNull(spec1.runtimeVersions.jdkVersion);
+ assertNull(spec1.runtimeVersions.scalaVersion);
+ assertNull(spec1.runtimeVersions.sparkVersion);
```

3. `assertInstanceOf` is more intuitive than `assertTrue(... instanceof ...)`.

```java
- assertTrue(constructorArgs.get(conf).get(0) instanceof SparkConf);
+ assertInstanceOf(SparkConf.class, constructorArgs.get(conf).get(0));
```

### Does this PR introduce _any_ user-facing change?

No. This is a test case fix and improvement.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #384 from dongjoon-hyun/SPARK-53872.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants