Skip to content

Commit

Permalink
suppress warning and fix an occurence
Browse files Browse the repository at this point in the history
  • Loading branch information
Venorcis committed Oct 6, 2023
1 parent 10dfe9d commit efd3a9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Arguments before(@Repeated T objects) {
}

@AfterTemplate
@SuppressWarnings("JUnitSingleArguments" /* The bugpattern does not understand Repeated. */)
@UseImportPolicy(STATIC_IMPORT_ALWAYS)
Arguments after(@Repeated T objects) {
return arguments(objects);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ void identification() {
CompilationTestHelper.newInstance(JUnitSingleArguments.class, getClass())
.addSourceLines(
"A.java",
"import static java.util.function.Function.identity;",
"import static java.util.Objects.requireNonNull;",
"import static java.util.function.Function.identity;",
"import static org.junit.jupiter.params.provider.Arguments.arguments;",
"",
"class A {",
Expand All @@ -20,7 +20,7 @@ void identification() {
" // BUG: Diagnostic contains:",
" arguments(1);",
" arguments(1,2);",
" ",
"",
" identity();",
" requireNonNull(null);",
" }",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static com.google.errorprone.BugPattern.SeverityLevel.SUGGESTION;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.params.provider.Arguments.arguments;

import com.google.common.collect.ImmutableList;
import com.google.errorprone.BugPattern;
Expand All @@ -17,7 +16,6 @@
import java.util.stream.Stream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

final class MethodMatcherFactoryTest {
Expand All @@ -29,13 +27,13 @@ final class MethodMatcherFactoryTest {
"com.example.A#m2(java.lang.String)",
"com.example.sub.B#m3(int,int)"));

private static Stream<Arguments> createWithMalformedSignaturesTestCases() {
private static Stream<ImmutableList<String>> createWithMalformedSignaturesTestCases() {
/* { signatures } */
return Stream.of(
arguments(ImmutableList.of("foo.bar")),
arguments(ImmutableList.of("foo.bar#baz")),
arguments(ImmutableList.of("a", "foo.bar#baz()")),
arguments(ImmutableList.of("foo.bar#baz()", "a")));
ImmutableList.of("foo.bar"),
ImmutableList.of("foo.bar#baz"),
ImmutableList.of("a", "foo.bar#baz()"),
ImmutableList.of("foo.bar#baz()", "a"));
}

@MethodSource("createWithMalformedSignaturesTestCases")
Expand Down

0 comments on commit efd3a9a

Please sign in to comment.