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

Commit 33528aa

Browse files
committed
Typed generics
1 parent f980ff3 commit 33528aa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/test/java/fi/helsinki/cs/tmc/cli/shared/FeedbackHandlerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static com.google.common.truth.Truth.assertThat;
44
import static org.mockito.Matchers.any;
55
import static org.mockito.Matchers.anyBoolean;
6+
import static org.mockito.Matchers.anyListOf;
67
import static org.mockito.Matchers.anyString;
78
import static org.mockito.Mockito.mock;
89
import static org.powermock.api.mockito.PowerMockito.mockStatic;
@@ -66,7 +67,7 @@ public void setup() {
6667
@Test
6768
public void sendingFeedbackWorks() {
6869
PowerMockito.when(
69-
TmcUtil.sendFeedback(any(CliContext.class), any(List.class), any(URI.class)))
70+
TmcUtil.sendFeedback(any(CliContext.class), anyListOf(FeedbackAnswer.class), any(URI.class)))
7071
.thenReturn(true);
7172
io.addLinePrompt("1");
7273
io.addLinePrompt("who cars");

src/test/java/fi/helsinki/cs/tmc/cli/shared/ResultPrinterTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import fi.helsinki.cs.tmc.core.domain.submission.ValidationResultImpl;
1313
import fi.helsinki.cs.tmc.langs.abstraction.Strategy;
1414
import fi.helsinki.cs.tmc.langs.abstraction.ValidationError;
15+
import fi.helsinki.cs.tmc.langs.abstraction.ValidationResult;
1516
import fi.helsinki.cs.tmc.langs.domain.RunResult;
1617
import fi.helsinki.cs.tmc.langs.domain.RunResult.Status;
1718
import fi.helsinki.cs.tmc.langs.domain.TestResult;
@@ -24,6 +25,7 @@
2425

2526
import java.io.File;
2627
import java.util.HashMap;
28+
import java.util.List;
2729
import java.util.Map;
2830

2931
public class ResultPrinterTest {
@@ -150,7 +152,7 @@ public void printValidationErrorsInLocalTests() {
150152
error.setMessage("validation error");
151153
validationErrors = ImmutableList.of((ValidationError) error);
152154
File file = new File("");
153-
Map map = new HashMap<>();
155+
Map<File, List<ValidationError>> map = new HashMap<>();
154156
map.put(file, validationErrors);
155157
valResult.setValidationErrors(map);
156158

@@ -164,7 +166,7 @@ public void printValidationErrorsInSubmit() {
164166
error.setMessage("Incorrect indentation");
165167

166168
File file = new File("Test.java");
167-
Map valErrors = new HashMap<>();
169+
Map<File, List<ValidationError>> valErrors = new HashMap<>();
168170
valErrors.put(file, ImmutableList.of((ValidationError) error));
169171

170172
ValidationResultImpl valResult = new ValidationResultImpl();

0 commit comments

Comments
 (0)