File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
integration-tests/jpa/src/test/java/org/apache/camel/quarkus/component/jpa/it Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 2121
2222import io .restassured .RestAssured ;
2323import io .restassured .http .ContentType ;
24+ import jakarta .json .bind .Jsonb ;
2425import jakarta .json .bind .JsonbBuilder ;
2526import org .apache .camel .quarkus .component .jpa .it .model .Fruit ;
2627import org .eclipse .microprofile .config .Config ;
@@ -81,7 +82,7 @@ public void testProducerNativeQuery() {
8182
8283 @ Test
8384 public void testConsumer () {
84- IntStream .range (1 , 3 ).parallel (). forEach ((id ) -> {
85+ IntStream .range (1 , 3 ).forEach ((id ) -> {
8586 await ().atMost (10L , TimeUnit .SECONDS ).until (() -> findFruit (id ).getProcessed ());
8687 });
8788
@@ -157,12 +158,14 @@ public void testJpaMessageIdRepository() {
157158 .body ("size()" , is (3 ));
158159 }
159160
160- public Fruit findFruit (int id ) {
161- return JsonbBuilder .create ().fromJson (
162- RestAssured .get ("/jpa/fruit/" + id )
163- .then ()
164- .statusCode (200 )
165- .extract ().body ().asString (),
166- Fruit .class );
161+ public Fruit findFruit (int id ) throws Exception {
162+ try (Jsonb jsonb = JsonbBuilder .create ()) {
163+ return jsonb .fromJson (
164+ RestAssured .get ("/jpa/fruit/" + id )
165+ .then ()
166+ .statusCode (200 )
167+ .extract ().body ().asString (),
168+ Fruit .class );
169+ }
167170 }
168171}
You can’t perform that action at this time.
0 commit comments