summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java
Publish
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java')
-rw-r--r--jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java
new file mode 100644
index 00000000000..0d1b33fa72f
--- /dev/null
+++ b/jdisc_core/src/test/java/com/yahoo/jdisc/test/NonWorkingRequestTestCase.java
@@ -0,0 +1,35 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.test;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Key;
+import com.google.inject.name.Names;
+import com.yahoo.jdisc.Request;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+
+/**
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
+ */
+public class NonWorkingRequestTestCase {
+
+ @Test
+ public void requireThatFactoryMethodWorks() {
+ assertNotNull(NonWorkingRequest.newInstance("scheme://host/path"));
+ }
+
+ @Test
+ public void requireThatGuiceModulesAreInjected() {
+ Request request = NonWorkingRequest.newInstance("scheme://host/path", new AbstractModule() {
+
+ @Override
+ protected void configure() {
+ bind(String.class).annotatedWith(Names.named("foo")).toInstance("bar");
+ }
+ });
+ assertEquals("bar", request.container().getInstance(Key.get(String.class, Names.named("foo"))));
+ }
+}