From 335292b0f9a0a644a225bee0e8b39eab672c1ce8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 19 Feb 2013 10:32:42 +0100 Subject: Simplify testability of PathResolver.RelativePath --- .../src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java index fbb7a0b7d32..7131fda4e3c 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java @@ -63,9 +63,8 @@ public class SonarEngineTest { public void testGetResource() { PathResolver pathResolver = mock(PathResolver.class); ModuleFileSystem fileSystem = mock(ModuleFileSystem.class); - RelativePath relativePath = mock(RelativePath.class); + RelativePath relativePath = new RelativePath(null, "com/foo/Bar.java"); when(pathResolver.relativePath(anyCollection(), any(java.io.File.class))).thenReturn(relativePath); - when(relativePath.path()).thenReturn("com/foo/Bar.java"); SonarEngine engine = new SonarEngine(null, fileSystem, pathResolver, null); Resource resource = engine.getResource(new java.io.File("")); -- cgit v1.2.3