Skip to content

Commit

Permalink
An failing test to demonstrate jooby-project#732
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredavidbelanger committed Apr 21, 2017
1 parent 1ef2c40 commit f341eac
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions coverage-report/src/test/java/org/jooby/issues/Issue732.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.jooby.issues;

import com.typesafe.config.ConfigFactory;
import com.typesafe.config.ConfigValueFactory;
import org.jooby.jedis.Redis;
import org.jooby.test.ServerFeature;
import org.junit.Test;
import redis.clients.jedis.Jedis;

public class Issue732 extends ServerFeature {

{

use(ConfigFactory
.empty()
.withValue("db",
ConfigValueFactory.fromAnyRef("redis://localhost:6379")));

use(new Redis());

get("/Issue732", () -> {
try (Jedis jedis = require(Jedis.class)) {
jedis.get("dummy");
return "Hello World!";
}
});

}

@Test
public void appShouldBeAbleToServeTwoRequestsWithJedisConnection() throws Exception {
request().get("/Issue732").expect(200);
request().get("/Issue732").expect(200);
}
}

0 comments on commit f341eac

Please sign in to comment.