Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CheckListGeneratorTest {
private final String directory = System.getProperty("user.dir").replace("check-list", "");

@BeforeEach
public void setUp() throws IOException {
void setUp() throws IOException {
Gson gson = new Gson();
generator = new CheckListGenerator(gson,
Path.of(directory, "java-checks/src/main/java"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class JavadocTest {
private static Javadoc invalidThrownExceptionUndocumented;

@BeforeAll
public static void setup() {
static void setup() {
File file = new File("src/test/files/checks/helpers/JavadocTest.java");
tree = JParserTestUtils.parse(file);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AnyRuleIssueFilterTest {
private FilterableIssue issue;

@BeforeEach
public void setup() {
void setup() {
issue = mock(FilterableIssue.class);
when(issue.componentKey()).thenReturn(INPUT_FILE.key());
when(issue.ruleKey()).thenReturn(RuleKey.of(REPOSITORY_KEY, RULE_KEY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BaseTreeVisitorIssueFilterTest {
private FilterableIssue issue;

@BeforeEach
public void setup() {
void setup() {
issue = mock(FilterableIssue.class);
when(issue.componentKey()).thenReturn(INPUT_FILE.key());
when(issue.ruleKey()).thenReturn(RuleKey.of(REPOSITORY_KEY, RULE_KEY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PostAnalysisIssueFilterTest {
private FilterableIssue fakeIssue;

@BeforeEach
public void setUp() {
void setUp() {
postAnalysisIssueFilter = new PostAnalysisIssueFilter();

context = mock(JavaFileScannerContext.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DefaultJavaResourceLocatorTest {
private static final String TEST_BINARY_DIRS = "target/test/test-classes";

@BeforeAll
public static void setup() {
static void setup() {
ClasspathForMain javaClasspath = mock(ClasspathForMain.class);
when(javaClasspath.getBinaryDirs()).thenReturn(Collections.singletonList(new File(BINARY_DIRS)));
when(javaClasspath.getElements()).thenReturn(Collections.singletonList(new File(BINARY_DIRS)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class JavaAstScannerTest {
private SensorContextTester context;

@BeforeEach
public void setUp() {
void setUp() {
context = SensorContextTester.create(new File(""));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SonarSymbolTableVisitorTest {
private SonarComponents sonarComponents;

@BeforeEach
public void setUp() {
void setUp() {
context = SensorContextTester.create(temp.getRoot());
sonarComponents = new SonarComponents(mock(FileLinesContextFactory.class), context.fileSystem(),
mock(ClasspathForMain.class), mock(ClasspathForTest.class), mock(CheckFactory.class), mock(ActiveRules.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SyntaxHighlighterVisitorTest {
private SyntaxHighlighterVisitor syntaxHighlighterVisitor;

@BeforeEach
public void setUp() {
void setUp() {
context = SensorContextTester.create(temp.getRoot());
sonarComponents = new SonarComponents(mock(FileLinesContextFactory.class), context.fileSystem(),
mock(ClasspathForMain.class), mock(ClasspathForTest.class), mock(CheckFactory.class), mock(ActiveRules.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ClasspathForTestTest {
public ThreadLocalLogTester logTester = new ThreadLocalLogTester().setLevel(Level.DEBUG);

@BeforeEach
public void setUp() {
void setUp() {
fs = new DefaultFileSystem(new File("src/test/files/classpath/"));
fs.add(TestUtils.emptyInputFile("foo.java", InputFile.Type.TEST));
settings = new MapSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void endOfAnalysis(ModuleScannerContext context) {
}

@BeforeEach
public void setup() {
void setup() {
sonarComponents = createSonarComponentsMock();
compilationUnitTree = JParserTestUtils.parse(JAVA_FILE);
context = new DefaultJavaFileScannerContext(compilationUnitTree, JAVA_INPUT_FILE, null, sonarComponents, new JavaVersionImpl(), true, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GeneratedFileTest {
private DefaultFileSystem fs;

@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
expected = tmp.resolve("file.jsp");
Files.write(expected, "content".getBytes(UTF_8));
fs = new DefaultFileSystem(tmp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class InternalJavaIssueBuilderTest {
private InputFile inputFile;

@BeforeEach
public void setup() {
void setup() {
SonarComponents sonarComponents = mock(SonarComponents.class);
sensorContextTester = SensorContextTester.create(new File(""));
when(sonarComponents.context()).thenReturn(sensorContextTester);
Expand Down Expand Up @@ -370,7 +370,7 @@ class QuickFixes {
private CompilationUnitTree cut = JParserTestUtils.parse(JAVA_FILE);

@BeforeEach
public void setup() {
void setup() {
sct = Mockito.spy(SensorContextTester.create(new File("")));
when(sct.newIssue()).thenReturn(new MockSonarLintIssue(sct));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SurefireJavaParserTest {
public LogTesterJUnit5 logTester = new LogTesterJUnit5().setLevel(Level.DEBUG);

@BeforeEach
public void before() {
void before() {
javaResourceLocator = mock(JavaResourceLocator.class);
when(javaResourceLocator.findResourceByClassName(anyString())).thenAnswer(invocation -> new TestInputFileBuilder("", (String) invocation.getArguments()[0]).build());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SurefireSensorTest {
private PathResolver pathResolver = new PathResolver();

@BeforeEach
public void before() {
void before() {
fs = new DefaultFileSystem(new File("src/test/resources"));
DefaultInputFile javaFile = new TestInputFileBuilder("", "src/org/foo/java").setLanguage("java").build();
fs.add(javaFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SurefireStaxHandlerTest {
private UnitTestIndex index;

@BeforeEach
public void setUp() {
void setUp() {
index = new UnitTestIndex();
}

Expand Down