JAVA-21440 Minor cleanup (#14084)

This commit is contained in:
Dhawal Kapil 2023-05-21 15:33:22 +05:30 committed by GitHub
parent 3b73517b00
commit 9d63cfe4a6
2 changed files with 9 additions and 21 deletions

View File

@ -6,9 +6,6 @@ import io.jooby.Jooby;
import io.jooby.ServerOptions;
import io.jooby.Session;
import io.jooby.SessionStore;
import io.jooby.redis.RedisModule;
import io.jooby.redis.RedisSessionStore;
import io.lettuce.core.RedisClient;
public class App extends Jooby {
{
@ -16,7 +13,6 @@ public class App extends Jooby {
.setSecurePort(8433));
}
{
get("/", ctx -> "Hello World!");
}
@ -31,17 +27,11 @@ public class App extends Jooby {
}
{
onStarting(() -> {
System.out.println("starting app");
});
onStarting(() -> System.out.println("starting app"));
onStop(() -> {
System.out.println("stopping app");
});
onStop(() -> System.out.println("stopping app"));
onStarted(() -> {
System.out.println("app started");
});
onStarted(() -> System.out.println("app started"));
}
{
@ -63,13 +53,12 @@ public class App extends Jooby {
post("/submitForm", ctx -> {
Employee employee = ctx.path(Employee.class);
// TODO
// ...
return "employee data saved successfully";
});
}
{
decorator(next -> ctx -> {
System.out.println("first");
@ -82,9 +71,7 @@ public class App extends Jooby {
return next.apply(ctx);
});
get("/handler", ctx -> {
return "third";
});
get("/handler", ctx -> "third");
}
{
@ -104,7 +91,8 @@ public class App extends Jooby {
get("/signedSession", ctx -> {
Session session = ctx.session();
session.put("token", "value");
return session.get("token").value();
return session.get("token")
.value();
});
}

View File

@ -12,12 +12,12 @@ import okhttp3.Request;
import okhttp3.Response;
@JoobyTest(value = App.class, port = 8080)
public class AppLiveTest {
class AppLiveTest {
static OkHttpClient client = new OkHttpClient();
@Test
public void given_defaultUrl_expect_fixedString() {
void given_defaultUrl_expect_fixedString() {
Request request = new Request.Builder().url("http://localhost:8080")
.build();
try (Response response = client.newCall(request)