From 38df1425f5f4e967ac7f27367599c852a52b8b7c Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 7 Jul 2015 10:45:43 +0200 Subject: Fix deprecated code --- .../java/org/sonar/duplications/detector/DetectorTestCase.java | 2 +- .../java/org/sonar/duplications/junit/TestNamePrinter.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sonar-duplications/src/test') diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java b/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java index 100b09d1be8..261eacfe314 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java @@ -34,11 +34,11 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.sameInstance; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.junit.matchers.JUnitMatchers.hasItem; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java b/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java index 8064c822f34..4bca9becb43 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/junit/TestNamePrinter.java @@ -19,14 +19,14 @@ */ package org.sonar.duplications.junit; -import org.junit.rules.TestWatchman; -import org.junit.runners.model.FrameworkMethod; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; -public class TestNamePrinter extends TestWatchman { +public class TestNamePrinter extends TestWatcher { @Override - public void starting(FrameworkMethod method) { - System.out.println("Executing " + method.getName()); + protected void starting(Description description) { + System.out.println("Executing " + description.getMethodName()); } } -- cgit v1.2.3