You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/jenkinsx/java-native-prod/03-quarkus.md
+18-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
title: Jenkins X - Java Native Image Prod
2
-
description: Creating a Java Native Image application and run it as Production with Jenkins X - Quarkus - 3/8
3
-
hero: Quarkus - 3/8
2
+
description: Creating a Java Native Image application and run it as Production with Jenkins X - Quarkus - 3/9
3
+
hero: Quarkus - 3/9
4
4
5
5
# Create Quarkus Application
6
6
@@ -220,6 +220,22 @@ And add `quarkus-resteasy-jackson`.
220
220
</dependency>
221
221
```
222
222
223
+
## Update FruitResource findAll
224
+
225
+
If you have tested our application, you might have noticed our `findAll()` method no longer works. This is because the `RestEasy Jackson` library doesn't properly marshall the Fruit's iterator. To solve this, we make and return a List instead.
226
+
227
+
!!! example "FruitResource.java"
228
+
229
+
```java
230
+
public List<Fruit> findAll() {
231
+
var it = fruitRepository.findAll();
232
+
List<Fruit> fruits = new ArrayList<Fruit>();
233
+
it.forEach(fruits::add);
234
+
return fruits;
235
+
}
236
+
```
237
+
238
+
223
239
## Next Steps
224
240
225
241
Running `mvn clean test` should result in a succesful build, with two tests testing most of our application.
In the example I've gone for option #4, but I recommend you make your own choice.
260
264
261
-
## Integration Test with PostMan
265
+
## Next Steps
262
266
267
+
The next step is to add Integration Tests via Preview Environments, so we increase the confidence in our application's stability prior to promoting it to (semi-)permanent environments - such as Staging and Production.
0 commit comments