Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 7a50d41

Browse files
author
Aleksi Salmela
committed
Change the mockito syntax from the two bad lines.
1 parent d36606f commit 7a50d41

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/test/java/fi/helsinki/cs/tmc/cli/command/core/CommandAnnotationProcessorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void worksWithOneCommands() {
147147
when(classElement.getKind()).thenReturn(ElementKind.CLASS);
148148
Command annotation = CommandAnnotationExample1.class.getAnnotation(Command.class);
149149
doReturn(annotation).when(classElement).getAnnotation(Command.class);
150-
when(roundEnv.getElementsAnnotatedWith(any(Class.class)))
151-
.thenReturn(new HashSet<>(Arrays.asList(classElement)));
150+
doReturn(new HashSet<>(Arrays.asList(classElement))).when(roundEnv)
151+
.getElementsAnnotatedWith(any(Class.class));
152152

153153
Name mockedName = mock(Name.class);
154154
when(mockedName.toString())
@@ -172,8 +172,8 @@ public void generateCorrectCodeWithTwoCommands() {
172172
annotation = CommandAnnotationExample2.class.getAnnotation(Command.class);
173173
doReturn(annotation).when(classElement2).getAnnotation(Command.class);
174174

175-
when(roundEnv.getElementsAnnotatedWith(any(Class.class)))
176-
.thenReturn(new HashSet<>(Arrays.asList(classElement1, classElement2)));
175+
doReturn(new HashSet<>(Arrays.asList(classElement1, classElement2))).when(roundEnv)
176+
.getElementsAnnotatedWith(any(Class.class));
177177

178178
Name mockedName1 = mock(Name.class);
179179
when(mockedName1.toString())

0 commit comments

Comments
 (0)