aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2018-09-21 14:22:43 +0200
committerGitHub <noreply@github.com>2018-09-21 14:22:43 +0200
commit218f9c117793b91ec130aa1fd1bfd7410b2336e0 (patch)
tree088f752b2c180ff341e064c6459c51be52ca11e3
parent84fea383788a6e0ff9d34b53537ccb1e2f479197 (diff)
parente89c371f8a303b0fb9cc1011d04819e3888a00ad (diff)
Merge pull request #7049 from vespa-engine/gjoranv/hamcrest-type-inference
Fix hamcrest type inference issues on JDK 9+
-rw-r--r--bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.java b/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.java
index aba6e8f14e8..e9df42f24f4 100644
--- a/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.java
+++ b/bundle-plugin/src/test/java/com/yahoo/container/plugin/classanalysis/AnalyzeClassTest.java
@@ -12,6 +12,8 @@ import com.yahoo.container.plugin.classanalysis.sampleclasses.MethodAnnotation;
import com.yahoo.container.plugin.classanalysis.sampleclasses.MethodInvocation;
import com.yahoo.osgi.annotation.ExportPackage;
import com.yahoo.osgi.annotation.Version;
+import org.hamcrest.Matcher;
+import org.hamcrest.Matchers;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -27,7 +29,6 @@ import static com.yahoo.container.plugin.classanalysis.TestUtilities.classFile;
import static com.yahoo.container.plugin.classanalysis.TestUtilities.name;
import static com.yahoo.container.plugin.classanalysis.TestUtilities.throwableMessage;
import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;
@@ -41,6 +42,7 @@ import static org.junit.Assert.assertThat;
* @author ollivir
*/
public class AnalyzeClassTest {
+
@Test
public void require_that_full_class_name_is_returned() {
assertThat(analyzeClass(Base.class).getName(), is(name(Base.class)));
@@ -82,12 +84,14 @@ public class AnalyzeClassTest {
@Test
public void require_that_basic_types_ignored() {
- assertThat(analyzeClass(Interface1.class).getReferencedClasses(), not(anyOf(hasItem("int"), hasItem("float"))));
+ assertThat(analyzeClass(Interface1.class).getReferencedClasses(),
+ not(Matchers.<Iterable<? super String>>anyOf(hasItem("int"), hasItem("float"))));
}
@Test
public void require_that_arrays_of_basic_types_ignored() {
- assertThat(analyzeClass(Interface1.class).getReferencedClasses(), not(anyOf(hasItem("int[]"), hasItem("int[][]"))));
+ assertThat(analyzeClass(Interface1.class).getReferencedClasses(),
+ not(Matchers.<Iterable<? super String>>anyOf(hasItem("int[]"), hasItem("int[][]"))));
}
@Test
@@ -118,7 +122,8 @@ public class AnalyzeClassTest {
@Test
public void require_that_export_package_annotations_are_ignored() {
assertThat(Analyze.analyzeClass(classFile("com.yahoo.container.plugin.classanalysis.sampleclasses.package-info"))
- .getReferencedClasses(), not(anyOf(hasItem(name(ExportPackage.class)), hasItem(name(Version.class)))));
+ .getReferencedClasses(), not(Matchers.<Iterable<? super String>>anyOf(
+ hasItem(name(ExportPackage.class)), hasItem(name(Version.class)))));
}
@Test