From e8296b41258f9e09d39bbd38d8e6121f54852f2b Mon Sep 17 00:00:00 2001 From: David Chan Date: Tue, 4 Feb 2020 01:26:05 -0500 Subject: [PATCH] fix async Signed-off-by: David Chan --- .../metrics/test/optional/MetricAppBeanOptional.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tck/optional/src/main/java/org/eclipse/microprofile/metrics/test/optional/MetricAppBeanOptional.java b/tck/optional/src/main/java/org/eclipse/microprofile/metrics/test/optional/MetricAppBeanOptional.java index 47100bdd..cc2e4324 100644 --- a/tck/optional/src/main/java/org/eclipse/microprofile/metrics/test/optional/MetricAppBeanOptional.java +++ b/tck/optional/src/main/java/org/eclipse/microprofile/metrics/test/optional/MetricAppBeanOptional.java @@ -227,18 +227,17 @@ public String getNameObject(@QueryParam("qp1") NameObject v1) throws Exception @GET @Path("/get-async") - public void getAsync(@Suspended final AsyncResponse ayncResponse) throws Exception { + public void getAsync(@Suspended final AsyncResponse asyncResponse) throws Exception { Thread thread = new Thread ( () -> { try { Thread.sleep(5000); - } + asyncResponse.resume("This is a GET request with AsyncResponse"); + } catch (Exception e) { System.err.println(e.toString()); } }); - thread.run(); - - ayncResponse.resume("This is a GET request with AsyncResponse"); + thread.start(); }