Skip to content

Commit 130f158

Browse files
authored
Merge branch 'junit-team:main' into file_source_reuse
2 parents c7719a5 + 91a5f71 commit 130f158

File tree

9 files changed

+32
-67
lines changed

9 files changed

+32
-67
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
distribution: graalvm-community
3131
version: 'latest'
32-
java-version: '24'
32+
java-version: '21'
3333
github-token: ${{ secrets.GITHUB_TOKEN }}
3434
- name: Build
3535
uses: ./.github/actions/main-build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
java-version: 24
9191
distribution: temurin
92-
- uses: sbt/setup-sbt@69a46ab4acd4316aa16e68d91a9249a98d7e78d5 # v1.1.8
92+
- uses: sbt/setup-sbt@6c68d2fe8dfbc0a0534d70101baa2e0420e1a506 # v1.1.9
9393
- name: Update JUnit dependencies in samples
9494
run: java src/Updater.java ${{ inputs.releaseVersion }}
9595
working-directory: junit5-samples
@@ -247,7 +247,7 @@ jobs:
247247
with:
248248
java-version: 24
249249
distribution: temurin
250-
- uses: sbt/setup-sbt@69a46ab4acd4316aa16e68d91a9249a98d7e78d5 # v1.1.8
250+
- uses: sbt/setup-sbt@6c68d2fe8dfbc0a0534d70101baa2e0420e1a506 # v1.1.9
251251
- name: Update JUnit dependencies in samples
252252
run: java src/Updater.java ${{ inputs.releaseVersion }}
253253
- name: Build samples

CONTRIBUTING.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,8 @@ See [`ExtensionContext`](junit-jupiter-api/src/main/java/org/junit/jupiter/api/e
125125
This project uses JSpecify's annotation to indicate nullability. In general, the approach
126126
is as follows:
127127

128-
- The Gradle build is set up to treat all code as being `@NullMarked`
129-
- The descriptor of each module is annotated with `@NullMarked` for IDEs such as IntelliJ
130-
IDEA to treat code correctly.
131-
- Fields, parameters, return types etc. may be annotated with `@Nullable`
132-
- A package can be excluded (temporarily) using `@NullUnmarked`
128+
- All packages are annotated with `@NullMarked`
129+
- Types of fields, parameters, return types etc. may be annotated with `@Nullable`
133130

134131
### Tests
135132

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This repository is the home of JUnit Platform, Jupiter, and Vintage.
1212

1313
## Latest Releases
1414

15-
- General Availability (GA): [JUnit 5.13.0](https://github.com/junit-team/junit5/releases/tag/r5.13.0) (May 30, 2025)
15+
- General Availability (GA): [JUnit 5.13.1](https://github.com/junit-team/junit5/releases/tag/r5.13.1) (June 7, 2025)
1616
- Preview (Milestone/Release Candidate): [JUnit 5.13.0-RC1](https://github.com/junit-team/junit5/releases/tag/r5.13.0-RC1) (May 16, 2025)
1717

1818
## Documentation
Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[[release-notes-5.13.1]]
22
== 5.13.1
33

4-
*Date of Release:*
4+
*Date of Release:* June 7, 2025
55

6-
*Scope:*
6+
*Scope:* Bug fixes and enhancements since 5.13.0
77

88
For a complete list of all _closed_ issues and pull requests for this release, consult the
99
link:{junit5-repo}+/milestone/97?closed=1+[5.13.1] milestone page in the JUnit repository
@@ -13,20 +13,7 @@ on GitHub.
1313
[[release-notes-5.13.1-junit-platform]]
1414
=== JUnit Platform
1515

16-
[[release-notes-5.13.1-junit-platform-bug-fixes]]
17-
==== Bug Fixes
18-
19-
* ❓
20-
21-
[[release-notes-5.13.1-junit-platform-deprecations-and-breaking-changes]]
22-
==== Deprecations and Breaking Changes
23-
24-
* ❓
25-
26-
[[release-notes-5.13.1-junit-platform-new-features-and-improvements]]
27-
==== New Features and Improvements
28-
29-
* ❓
16+
No changes.
3017

3118

3219
[[release-notes-5.13.1-junit-jupiter]]
@@ -45,31 +32,8 @@ on GitHub.
4532
* Fix support for `AnnotationBasedArgumentsProvider` implementations that override the
4633
deprecated `provideArguments(ExtensionContext, Annotation)` method.
4734

48-
[[release-notes-5.13.1-junit-jupiter-deprecations-and-breaking-changes]]
49-
==== Deprecations and Breaking Changes
50-
51-
* ❓
52-
53-
[[release-notes-5.13.1-junit-jupiter-new-features-and-improvements]]
54-
==== New Features and Improvements
55-
56-
* ❓
57-
5835

5936
[[release-notes-5.13.1-junit-vintage]]
6037
=== JUnit Vintage
6138

62-
[[release-notes-5.13.1-junit-vintage-bug-fixes]]
63-
==== Bug Fixes
64-
65-
* ❓
66-
67-
[[release-notes-5.13.1-junit-vintage-deprecations-and-breaking-changes]]
68-
==== Deprecations and Breaking Changes
69-
70-
* ❓
71-
72-
[[release-notes-5.13.1-junit-vintage-new-features-and-improvements]]
73-
==== New Features and Improvements
74-
75-
* ❓
39+
No changes

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jreleaser = { id = "org.jreleaser", version = "1.18.0" }
107107
# check if workaround in gradle.properties can be removed when updating
108108
kotlin = { id = "org.jetbrains.kotlin.jvm", version = "2.2.0-RC2" }
109109
nullaway = { id = "net.ltgt.nullaway", version = "2.2.0" }
110-
openrewrite = { id = "org.openrewrite.rewrite", version = "7.7.0" }
110+
openrewrite = { id = "org.openrewrite.rewrite", version = "7.8.0" }
111111
plantuml = { id = "io.freefair.plantuml", version = "8.13.1" }
112112
shadow = { id = "com.gradleup.shadow", version = "8.3.6" }
113113
spotless = { id = "com.diffplug.spotless", version = "7.0.4" }

junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ public static List<Field> findAnnotatedFields(Class<?> clazz, Class<? extends An
450450
List<Field> fields = findAnnotatedFields(instance.getClass(), annotationType, ModifierSupport::isNotStatic,
451451
HierarchyTraversalMode.TOP_DOWN);
452452

453-
return ReflectionUtils.readFieldValues(fields, instance);
453+
@SuppressWarnings("unchecked")
454+
List<@Nullable Object> result = (List<@Nullable Object>) ReflectionUtils.readFieldValues(fields, instance);
455+
return result;
454456
}
455457

456458
/**
@@ -482,7 +484,9 @@ public static List<Field> findAnnotatedFields(Class<?> clazz, Class<? extends An
482484
List<Field> fields = findAnnotatedFields(clazz, annotationType, ModifierSupport::isStatic,
483485
HierarchyTraversalMode.TOP_DOWN);
484486

485-
return ReflectionUtils.readFieldValues(fields, null);
487+
@SuppressWarnings("unchecked")
488+
List<@Nullable Object> result = (List<@Nullable Object>) ReflectionUtils.readFieldValues(fields, null);
489+
return result;
486490
}
487491

488492
/**

junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ public static <T> Try<Object> tryToReadFieldValue(Class<T> clazz, String fieldNa
657657
* @return an immutable list of the values of the specified fields; never
658658
* {@code null} but may be empty or contain {@code null} entries
659659
*/
660-
public static List<@Nullable Object> readFieldValues(List<Field> fields, @Nullable Object instance) {
660+
public static List<?> readFieldValues(List<Field> fields, @Nullable Object instance) {
661661
return readFieldValues(fields, instance, field -> true);
662662
}
663663

@@ -674,9 +674,7 @@ public static <T> Try<Object> tryToReadFieldValue(Class<T> clazz, String fieldNa
674674
* @return an immutable list of the values of the specified fields; never
675675
* {@code null} but may be empty or contain {@code null} entries
676676
*/
677-
@SuppressWarnings("NullAway")
678-
public static List<@Nullable Object> readFieldValues(List<Field> fields, @Nullable Object instance,
679-
Predicate<Field> predicate) {
677+
public static List<?> readFieldValues(List<Field> fields, @Nullable Object instance, Predicate<Field> predicate) {
680678
Preconditions.notNull(fields, "fields list must not be null");
681679
Preconditions.notNull(predicate, "Predicate must not be null");
682680

platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import java.util.stream.IntStream;
6161
import java.util.stream.Stream;
6262

63+
import org.assertj.core.api.Assertions;
6364
import org.jspecify.annotations.Nullable;
6465
import org.junit.jupiter.api.Nested;
6566
import org.junit.jupiter.api.Test;
@@ -1952,7 +1953,8 @@ void readFieldValuesFromInstance() {
19521953

19531954
var values = readFieldValues(fields, new ClassWithFields());
19541955

1955-
assertThat(values).containsExactly("enigma", 3.14, "text", 2.5, null, 42, "constant", 99);
1956+
Assertions.<Object> assertThat(values).containsExactly("enigma", 3.14, "text", 2.5, null, 42, "constant",
1957+
99);
19561958
}
19571959

19581960
@Test
@@ -1961,7 +1963,7 @@ void readFieldValuesFromClass() {
19611963

19621964
var values = readFieldValues(fields, null);
19631965

1964-
assertThat(values).containsExactly(2.5, "constant", 99);
1966+
Assertions.<Object> assertThat(values).containsExactly(2.5, "constant", 99);
19651967
}
19661968

19671969
/**
@@ -1972,15 +1974,15 @@ void readFieldValuesFromClass() {
19721974
void readFieldValuesFromInterfacesAndClassesInTypeHierarchy() {
19731975
var fields = findFields(InterfaceWithField.class, ReflectionUtils::isStatic, TOP_DOWN);
19741976
var values = readFieldValues(fields, null);
1975-
assertThat(values).containsOnly("ifc");
1977+
Assertions.<Object> assertThat(values).containsOnly("ifc");
19761978

19771979
fields = findFields(SuperclassWithFieldAndFieldFromInterface.class, ReflectionUtils::isStatic, TOP_DOWN);
19781980
values = readFieldValues(fields, null);
1979-
assertThat(values).containsExactly("ifc", "super");
1981+
Assertions.<Object> assertThat(values).containsExactly("ifc", "super");
19801982

19811983
fields = findFields(SubclassWithFieldAndFieldFromInterface.class, ReflectionUtils::isStatic, TOP_DOWN);
19821984
values = readFieldValues(fields, null);
1983-
assertThat(values).containsExactly("ifc", "super", "sub");
1985+
Assertions.<Object> assertThat(values).containsExactly("ifc", "super", "sub");
19841986
}
19851987

19861988
@Test
@@ -1989,7 +1991,7 @@ void readFieldValuesFromInstanceWithTypeFilterForString() {
19891991

19901992
var values = readFieldValues(fields, new ClassWithFields(), isA(String.class));
19911993

1992-
assertThat(values).containsExactly("enigma", "text", null, "constant");
1994+
Assertions.<Object> assertThat(values).containsExactly("enigma", "text", null, "constant");
19931995
}
19941996

19951997
@Test
@@ -1998,7 +2000,7 @@ void readFieldValuesFromClassWithTypeFilterForString() {
19982000

19992001
var values = readFieldValues(fields, null, isA(String.class));
20002002

2001-
assertThat(values).containsExactly("constant");
2003+
Assertions.<Object> assertThat(values).containsExactly("constant");
20022004
}
20032005

20042006
@Test
@@ -2007,7 +2009,7 @@ void readFieldValuesFromInstanceWithTypeFilterForInteger() {
20072009

20082010
var values = readFieldValues(fields, new ClassWithFields(), isA(int.class));
20092011

2010-
assertThat(values).containsExactly(42);
2012+
Assertions.<Object> assertThat(values).containsExactly(42);
20112013
}
20122014

20132015
@Test
@@ -2016,7 +2018,7 @@ void readFieldValuesFromClassWithTypeFilterForInteger() {
20162018

20172019
var values = readFieldValues(fields, null, isA(Integer.class));
20182020

2019-
assertThat(values).containsExactly(99);
2021+
Assertions.<Object> assertThat(values).containsExactly(99);
20202022
}
20212023

20222024
@Test
@@ -2025,7 +2027,7 @@ void readFieldValuesFromInstanceWithTypeFilterForDouble() {
20252027

20262028
var values = readFieldValues(fields, new ClassWithFields(), isA(double.class));
20272029

2028-
assertThat(values).containsExactly(3.14);
2030+
Assertions.<Object> assertThat(values).containsExactly(3.14);
20292031
}
20302032

20312033
@Test
@@ -2034,7 +2036,7 @@ void readFieldValuesFromClassWithTypeFilterForDouble() {
20342036

20352037
var values = readFieldValues(fields, null, isA(Double.class));
20362038

2037-
assertThat(values).containsExactly(2.5);
2039+
Assertions.<Object> assertThat(values).containsExactly(2.5);
20382040
}
20392041

20402042
private static Predicate<Field> isA(Class<?> type) {

0 commit comments

Comments
 (0)