summaryrefslogtreecommitdiffstats
path: root/sangria-core/src/test
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-09-15 20:37:58 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-09-15 20:37:58 -0400
commit6f87abbdabd02244a536acbf7f1895f4466a095d (patch)
treebf8819fd7a85b886dbd727157dae6a6a2b0db7d8 /sangria-core/src/test
parent7af926e2d02823c94a65310756f0ca7595908521 (diff)
parent75db2e06b7a6b1f15bad5986b33bc3aa1bb31f26 (diff)
downloadsangria-6f87abbdabd02244a536acbf7f1895f4466a095d.tar.xz
Merge branch 'lazy'
Diffstat (limited to 'sangria-core/src/test')
-rw-r--r--sangria-core/src/test/java/com/tavianator/sangria/core/PotentialAnnotationTest.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/sangria-core/src/test/java/com/tavianator/sangria/core/PotentialAnnotationTest.java b/sangria-core/src/test/java/com/tavianator/sangria/core/PotentialAnnotationTest.java
index c4ccc36..4c53ef4 100644
--- a/sangria-core/src/test/java/com/tavianator/sangria/core/PotentialAnnotationTest.java
+++ b/sangria-core/src/test/java/com/tavianator/sangria/core/PotentialAnnotationTest.java
@@ -36,7 +36,7 @@ import static org.junit.Assert.*;
* Tests for {@link PotentialAnnotation}s.
*
* @author Tavian Barnes (tavianator@tavianator.com)
- * @version 1.1
+ * @version 1.2
* @since 1.1
*/
public class PotentialAnnotationTest {
@@ -63,8 +63,8 @@ public class PotentialAnnotationTest {
@Test(expected = CreationException.class)
public void testInvalidAnnotatedWithInstance() {
- none.annotatedWith(Names.named("name"))
- .annotatedWith(Names.named("name"));
+ none.annotatedWith(nameAnnotation)
+ .annotatedWith(nameAnnotation);
}
@Test
@@ -78,6 +78,16 @@ public class PotentialAnnotationTest {
}
@Test
+ public void testFromKey() {
+ assertThat(PotentialAnnotation.from(new Key<String>() { }),
+ equalTo(none));
+ assertThat(PotentialAnnotation.from(new Key<String>(Simple.class) { }),
+ equalTo(none.annotatedWith(Simple.class)));
+ assertThat(PotentialAnnotation.from(new Key<String>(nameAnnotation) { }),
+ equalTo(none.annotatedWith(nameAnnotation)));
+ }
+
+ @Test
public void testVisitor() {
PotentialAnnotation.Visitor<String> visitor = new PotentialAnnotation.Visitor<String>() {
@Override
@@ -114,7 +124,7 @@ public class PotentialAnnotationTest {
}
/**
- * Needed to avoid compilation error to to inferred type being anonymous class.
+ * Needed to avoid compilation error due to inferred type being anonymous class.
*/
private static <T> Matcher<Key<T>> equalTo(Key<T> key) {
return Matchers.equalTo(key);