File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
jmolecules-bytebuddy-tests/jmolecules-bytebuddy-tests-vaadoo
src/test/java/org/jmolecules/bytebuddy Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1313
1414 <dependencies >
1515
16- <dependency >
17- <groupId >org.jmolecules</groupId >
18- <artifactId >jmolecules-ddd</artifactId >
19- <version >${jmolecules.version} </version >
20- </dependency >
16+ <dependency >
17+ <groupId >org.jmolecules</groupId >
18+ <artifactId >jmolecules-ddd</artifactId >
19+ <version >${jmolecules.version} </version >
20+ </dependency >
2121
2222 <!-- nodep artifact provides the plugin registration and minimal
2323 classes required for classpath discovery by the byte-buddy
3636 <version >${project.version} </version >
3737 </dependency >
3838
39+ <dependency >
40+ <groupId >org.mockito</groupId >
41+ <artifactId >mockito-core</artifactId >
42+ <scope >test</scope >
43+ </dependency >
44+
3945 </dependencies >
4046
4147 <build >
Original file line number Diff line number Diff line change 2020import static org .assertj .core .api .Assertions .assertThatException ;
2121import static org .assertj .core .api .Assertions .assertThatNoException ;
2222import static org .assertj .core .api .Assertions .assertThatRuntimeException ;
23+ import static org .mockito .Mockito .mock ;
24+ import static org .mockito .Mockito .verifyNoInteractions ;
2325
2426import java .io .File ;
2527import java .lang .reflect .Constructor ;
3739import org .jmolecules .bytebuddy .testclasses .ValueObjectWithAttribute ;
3840import org .junit .jupiter .api .Test ;
3941import org .junit .jupiter .api .io .TempDir ;
42+ import org .mockito .Mockito ;
4043
4144import example .SampleValueObject ;
4245import example .SampleValueObjectWithSideEffect ;
@@ -130,10 +133,11 @@ void doesNotThrowExceptionOnNonNullValueAndAssignsValues() {
130133
131134 @ Test
132135 void mustNotCallAddOnListWithNull () {
133- List <String > list = new ArrayList <>();
134- assertThatRuntimeException ().isThrownBy (() -> new SampleValueObjectWithSideEffect (list , null ))
136+ @ SuppressWarnings ("unchecked" )
137+ List <String > listMock = mock (List .class );
138+ assertThatRuntimeException ().isThrownBy (() -> new SampleValueObjectWithSideEffect (listMock , null ))
135139 .withMessage ("toAdd must not be null" );
136- assertThat ( list ). isEmpty ( );
140+ verifyNoInteractions ( listMock );
137141 }
138142
139143}
You can’t perform that action at this time.
0 commit comments