File tree Expand file tree Collapse file tree 17 files changed +1403
-57
lines changed
jooby-archetype/src/main/resources/archetype-resources
jooby-thymeleaf/src/main/java/org/jooby/thymeleaf Expand file tree Collapse file tree 17 files changed +1403
-57
lines changed Original file line number Diff line number Diff line change 667667 <dependency >
668668 <groupId >junit</groupId >
669669 <artifactId >junit</artifactId >
670- <scope >test</ scope >
670+ <optional >true</ optional >
671671 </dependency >
672672
673673 <dependency >
Original file line number Diff line number Diff line change 4545 </dependency >
4646
4747 <dependency >
48- <groupId >org.jooby</groupId >
49- <artifactId >jooby</artifactId >
50- <scope >test</scope >
51- <classifier >tests</classifier >
52- </dependency >
53-
54- <!-- Fluent HC -->
55- <dependency >
56- <groupId >org.apache.httpcomponents</groupId >
57- <artifactId >fluent-hc</artifactId >
48+ <groupId >io.rest-assured</groupId >
49+ <artifactId >rest-assured</artifactId >
5850 <scope >test</scope >
5951 </dependency >
60-
61- <dependency >
62- <groupId >org.apache.httpcomponents</groupId >
63- <artifactId >httpmime</artifactId >
64- <scope >test</scope >
65- </dependency >
66-
6752 </dependencies >
6853
6954 <build >
Original file line number Diff line number Diff line change 11package $ {package };
22
3+ import static io .restassured .RestAssured .get ;
4+ import static org .hamcrest .Matchers .equalTo ;
5+ import static org .junit .Assert .assertEquals ;
6+
7+ import org .jooby .test .JoobyRule ;
8+ import org .jooby .test .MockRouter ;
9+ import org .junit .ClassRule ;
310import org .junit .Test ;
411
512/**
613 * @author jooby generator
714 */
8- public class AppTest extends BaseTest {
15+ public class AppTest {
16+
17+ /**
18+ * One app/server for all the test of this class. If you want to start/stop a new server per test,
19+ * remove the static modifier and replace the {@link ClassRule} annotation with {@link Rule}.
20+ */
21+ @ ClassRule
22+ public static JoobyRule app = new JoobyRule (new App ());
23+
24+ @ Test
25+ public void integrationTest () {
26+ get ("/" )
27+ .then ()
28+ .assertThat ()
29+ .body (equalTo ("Hello World!" ))
30+ .statusCode (200 )
31+ .contentType ("text/html;charset=UTF-8" );
32+ }
933
1034 @ Test
11- public void index () throws Exception {
12- server .get ("/" )
13- .expect (200 )
14- .header ("Content-Type" , "text/html;charset=UTF-8" );
35+ public void unitTest () throws Throwable {
36+ String result = new MockRouter (new App ())
37+ .get ("/" );
38+
39+ assertEquals ("Hello World!" , result );
1540 }
1641
1742}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * Licensed to the Apache Software Foundation (ASF) under one
3+ * or more contributor license agreements. See the NOTICE file
4+ * distributed with this work for additional information
5+ * regarding copyright ownership. The ASF licenses this file
6+ * to you under the Apache License, Version 2.0 (the
7+ * "License"); you may not use this file except in compliance
8+ * with the License. You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
119package org .jooby .thymeleaf ;
220
321import static java .util .Objects .requireNonNull ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Licensed to the Apache Software Foundation (ASF) under one
3+ * or more contributor license agreements. See the NOTICE file
4+ * distributed with this work for additional information
5+ * regarding copyright ownership. The ASF licenses this file
6+ * to you under the Apache License, Version 2.0 (the
7+ * "License"); you may not use this file except in compliance
8+ * with the License. You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
119package org .jooby .thymeleaf ;
220
321import java .io .FileNotFoundException ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Licensed to the Apache Software Foundation (ASF) under one
3+ * or more contributor license agreements. See the NOTICE file
4+ * distributed with this work for additional information
5+ * regarding copyright ownership. The ASF licenses this file
6+ * to you under the Apache License, Version 2.0 (the
7+ * "License"); you may not use this file except in compliance
8+ * with the License. You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
119package org .jooby .thymeleaf ;
220
321import org .jooby .Env ;
Original file line number Diff line number Diff line change 135135 <dependency >
136136 <groupId >junit</groupId >
137137 <artifactId >junit</artifactId >
138- <scope >test</ scope >
138+ <optional >true</ optional >
139139 </dependency >
140140
141141 <dependency >
Original file line number Diff line number Diff line change @@ -287,6 +287,7 @@ public void resolve(final Object value) {
287287 } else {
288288 Result result ;
289289 if (value instanceof Result ) {
290+ super .set (value );
290291 result = (Result ) value ;
291292 } else {
292293 super .set (value );
@@ -303,6 +304,7 @@ public void resolve(final Object value) {
303304 * @param cause A value for this deferred.
304305 */
305306 public void reject (final Throwable cause ) {
307+ super .set (cause );
306308 handler .handle (null , cause );
307309 }
308310
You can’t perform that action at this time.
0 commit comments