summaryrefslogtreecommitdiffstats
path: root/testutil/src/test/java/com/yahoo/test/MatchersTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'testutil/src/test/java/com/yahoo/test/MatchersTestCase.java')
-rw-r--r--testutil/src/test/java/com/yahoo/test/MatchersTestCase.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/testutil/src/test/java/com/yahoo/test/MatchersTestCase.java b/testutil/src/test/java/com/yahoo/test/MatchersTestCase.java
new file mode 100644
index 00000000000..c560a0e0624
--- /dev/null
+++ b/testutil/src/test/java/com/yahoo/test/MatchersTestCase.java
@@ -0,0 +1,33 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.test;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+
+import org.hamcrest.Matcher;
+import org.junit.Test;
+
+/**
+ * Tests for com.yahoo.test.Matchers.
+ *
+ * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a>
+ */
+public class MatchersTestCase {
+
+ @Test
+ public final void testHasItemWithMethodObjectString() {
+ @SuppressWarnings("rawtypes")
+ final Matcher<Iterable> m = Matchers.hasItemWithMethod("nalle",
+ "toLowerCase");
+ assertEquals(
+ false,
+ m.matches(Arrays.asList(new Object[] { Integer.valueOf(1),
+ Character.valueOf('c'), "blbl" })));
+ assertEquals(
+ true,
+ m.matches(Arrays.asList(new Object[] { Character.valueOf('c'),
+ "NALLE" })));
+ }
+
+}