File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
modules/jooby-cli/src/main Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ public class CreateCmd extends Cmd {
109109 String server ;
110110 boolean stork = !gradle && this .stork ;
111111 if (interactive ) {
112- gradle = yesNo (ctx .readLine ("Use Gradle (yes/No ): " ));
112+ gradle = yesNo (ctx .readLine ("Use Gradle (yes/no ): " ));
113113
114- kotlin = yesNo (ctx .readLine ("Use Kotlin (yes/No ): " ));
114+ kotlin = yesNo (ctx .readLine ("Use Kotlin (yes/no ): " ));
115115
116116 packageName = ctx .readLine ("Enter a groupId/package: " );
117117
@@ -120,9 +120,9 @@ public class CreateCmd extends Cmd {
120120 version = "1.0.0" ;
121121 }
122122
123- mvc = yesNo (ctx .readLine ("Use MVC (yes/No ): " ));
123+ mvc = yesNo (ctx .readLine ("Use MVC (yes/no ): " ));
124124
125- openapi = yesNo (ctx .readLine ("Configure OpenAPI (yes/No ): " ));
125+ openapi = yesNo (ctx .readLine ("Configure OpenAPI (yes/no ): " ));
126126
127127 server = server (ctx .readLine ("Choose a server (jetty, netty or undertow): " ));
128128
@@ -131,7 +131,7 @@ public class CreateCmd extends Cmd {
131131 .equals ("stork" );
132132 }
133133
134- docker = yesNo (ctx .readLine ("Generates Dockerfile (yes/No ): " ));
134+ docker = yesNo (ctx .readLine ("Generates Dockerfile (yes/no ): " ));
135135 } else {
136136 String [] parts = name .split (":" );
137137 switch (parts .length ) {
Original file line number Diff line number Diff line change 11package {{ package }} ;
22
3+ {{ #unless mvc }}
34import io.jooby.MockRouter;
45import io.jooby.StatusCode;
6+ {{ /unless }}
57import org.junit.jupiter.api.Test;
68
79import static org.junit.jupiter.api.Assertions.assertEquals;
810
911public class UnitTest {
1012 @Test
1113 public void welcome() {
14+ {{ #if mvc }}
15+ Controller controller = new Controller();
16+ assertEquals("Welcome to Jooby!", controller.sayHi());
17+ {{ else }}
1218 MockRouter router = new MockRouter(new App());
1319 router.get("/", rsp -> {
1420 assertEquals("Welcome to Jooby!", rsp.value());
1521 assertEquals(StatusCode.OK, rsp.getStatusCode());
1622 });
23+ {{ /if }}
1724 }
1825}
Original file line number Diff line number Diff line change 11package {{ package }}
22
3+ {{ #unless mvc }}
34import io.jooby.MockRouter
45import io.jooby.StatusCode
6+ {{ /unless }}
57import org.junit.jupiter.api.Test
68
79import org.junit.jupiter.api.Assertions.assertEquals
810
911class UnitTest {
1012 @Test
1113 fun welcome() {
14+ {{ #if mvc }}
15+ val controller = Controller()
16+ assertEquals("Welcome to Jooby!", controller.sayHi())
17+ {{ else }}
1218 val router = MockRouter(App())
1319 router.get("/") { rsp ->
1420 assertEquals("Welcome to Jooby!", rsp.value())
1521 assertEquals(StatusCode.OK, rsp.getStatusCode())
1622 }
23+ {{ /if }}
1724 }
1825}
You can’t perform that action at this time.
0 commit comments