Skip to content

Commit 4053573

Browse files
A failing (but commented) test related to #732
1 parent 1ef2c40 commit 4053573

2 files changed

Lines changed: 35 additions & 6 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.jooby.issues;
2+
3+
import com.typesafe.config.ConfigFactory;
4+
import com.typesafe.config.ConfigValueFactory;
5+
import org.jooby.jedis.Redis;
6+
import org.jooby.test.ServerFeature;
7+
import org.junit.Test;
8+
import redis.clients.jedis.Jedis;
9+
10+
public class Issue732 extends ServerFeature {
11+
12+
{
13+
14+
use(ConfigFactory
15+
.empty()
16+
.withValue("db",
17+
ConfigValueFactory.fromAnyRef("redis://localhost:6379")));
18+
19+
use(new Redis());
20+
21+
get("/Issue732", () -> {
22+
try (Jedis jedis = require(Jedis.class)) {
23+
jedis.get("dummy");
24+
return "Hello World!";
25+
}
26+
});
27+
28+
}
29+
30+
@Test
31+
public void appShouldBeAbleToServeTwoRequestsWithJedisConnection() throws Exception {
32+
// request().get("/Issue732").expect(200);
33+
// request().get("/Issue732").expect(200);
34+
}
35+
}

jooby-jedis/src/test/java/org/jooby/jedis/RedisTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ public void defaults() throws Exception {
8282
AnnotatedBindingBuilder<Jedis> jABB = unit.mock(AnnotatedBindingBuilder.class);
8383
expect(jABB.toProvider(isA(Provider.class))).andReturn(jABB);
8484
expect(jABB.toProvider(isA(Provider.class))).andReturn(jABB);
85-
jABB.asEagerSingleton();
86-
jABB.asEagerSingleton();
8785

8886
Binder binder = unit.get(Binder.class);
8987
expect(binder.bind(Key.get(JedisPool.class))).andReturn(jpABB);
@@ -143,8 +141,6 @@ public void shouldGetJedisInstance() throws Exception {
143141
AnnotatedBindingBuilder<Jedis> jABB = unit.mock(AnnotatedBindingBuilder.class);
144142
expect(jABB.toProvider(isA(Provider.class))).andReturn(jABB);
145143
expect(jABB.toProvider(unit.capture(Provider.class))).andReturn(jABB);
146-
jABB.asEagerSingleton();
147-
jABB.asEagerSingleton();
148144

149145
Binder binder = unit.get(Binder.class);
150146
expect(binder.bind(Key.get(JedisPool.class))).andReturn(jpABB);
@@ -206,8 +202,6 @@ public void jedisConfigOverride() throws Exception {
206202
AnnotatedBindingBuilder<Jedis> jABB = unit.mock(AnnotatedBindingBuilder.class);
207203
expect(jABB.toProvider(isA(Provider.class))).andReturn(jABB);
208204
expect(jABB.toProvider(isA(Provider.class))).andReturn(jABB);
209-
jABB.asEagerSingleton();
210-
jABB.asEagerSingleton();
211205

212206
Binder binder = unit.get(Binder.class);
213207
expect(binder.bind(Key.get(JedisPool.class))).andReturn(jpABB);

0 commit comments

Comments
 (0)