AI REVIEWED
Module: testkit
File: testkit/assertion/DataResultAssert.java (~line 329)
Severity: Low
Summary
extractingValue() is annotated @NotNull but calls Assertions.assertThat(this.actual.result().orElse(null)), potentially wrapping null. While isSuccess() is called first, the @NotNull annotation on the return type is misleading.
Suggested Fix
Use orElseThrow():
return Assertions.assertThat(this.actual.result()
.orElseThrow(() -> new AssertionError("Success result contained no value")));
AI REVIEWED
Module: testkit
File:
testkit/assertion/DataResultAssert.java(~line 329)Severity: Low
Summary
extractingValue()is annotated@NotNullbut callsAssertions.assertThat(this.actual.result().orElse(null)), potentially wrapping null. WhileisSuccess()is called first, the@NotNullannotation on the return type is misleading.Suggested Fix
Use
orElseThrow():