@BeforeClass public static void initData() { project = mock(VisualStudioProject.class); when(project.getProjectFile()) .thenReturn(new File("target/sonar/solution/project/project.csproj")); new File("target/sonar/solution").mkdirs(); solution = mock(VisualStudioSolution.class); when(solution.getSolutionDir()).thenReturn(new File("target/sonar/solution")); when(solution.getSolutionFile()).thenReturn(new File("target/sonar/solution/solution.sln")); }