{"action":"created","issue":{"url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/18","labels_url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/18/comments","events_url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/18/events","html_url":"https://github.com/vert-x3/vertx-unit/issues/18","id":107107950,"number":18,"title":"JUnit tests don't fail in Gradle","user":{"login":"VoidNugget","id":6811933,"avatar_url":"https://avatars.githubusercontent.com/u/6811933?v=3","gravatar_id":"","url":"https://api.github.com/users/VoidNugget","html_url":"https://github.com/VoidNugget","followers_url":"https://api.github.com/users/VoidNugget/followers","following_url":"https://api.github.com/users/VoidNugget/following{/other_user}","gists_url":"https://api.github.com/users/VoidNugget/gists{/gist_id}","starred_url":"https://api.github.com/users/VoidNugget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoidNugget/subscriptions","organizations_url":"https://api.github.com/users/VoidNugget/orgs","repos_url":"https://api.github.com/users/VoidNugget/repos","events_url":"https://api.github.com/users/VoidNugget/events{/privacy}","received_events_url":"https://api.github.com/users/VoidNugget/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"vietj","id":225674,"avatar_url":"https://avatars.githubusercontent.com/u/225674?v=3","gravatar_id":"","url":"https://api.github.com/users/vietj","html_url":"https://github.com/vietj","followers_url":"https://api.github.com/users/vietj/followers","following_url":"https://api.github.com/users/vietj/following{/other_user}","gists_url":"https://api.github.com/users/vietj/gists{/gist_id}","starred_url":"https://api.github.com/users/vietj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vietj/subscriptions","organizations_url":"https://api.github.com/users/vietj/orgs","repos_url":"https://api.github.com/users/vietj/repos","events_url":"https://api.github.com/users/vietj/events{/privacy}","received_events_url":"https://api.github.com/users/vietj/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-09-18T00:36:30Z","updated_at":"2015-09-18T10:24:09Z","closed_at":"2015-09-18T10:24:08Z","body":"I'm trying to run vertx JUnit tests in Gradle, like this one\r\n```\r\n@RunWith(VertxUnitRunner.class)\r\npublic class MainVerticleTests {\r\n\r\n    @ClassRule\r\n    public static RunTestOnContext rule = new RunTestOnContext();\r\n\r\n    static HttpServerOptions opts = MasterVerticle.getHttpServerOptions();\r\n    static String id = \"\";\r\n\r\n    static Vertx vertx;\r\n\r\n    @BeforeClass\r\n    public static void setupVerticle(TestContext ctx) {\r\n        ctx.assertNotNull(opts);\r\n        vertx = rule.vertx();\r\n        vertx.deployVerticle(MasterVerticle.class.getName(),\r\n            ctx.asyncAssertSuccess(res -> id = res));\r\n    }\r\n\r\n    @Test\r\n    public void testSessionCookiePresent(TestContext ctx) {\r\n        rule.vertx().createHttpClient()\r\n            .get(opts.getPort(), \"localhost\", \"/\", res -> {\r\n                ctx.assertEquals(res.statusCode(), 404);\r\n            }).exceptionHandler(e -> {\r\n            ctx.fail(e);\r\n        }).end();\r\n    }\r\n\r\n    @AfterClass\r\n    public static void tearDownVerticle(TestContext ctx) {\r\n        if (!id.isEmpty()) {\r\n            vertx.undeploy(id, ctx.asyncAssertSuccess(res -> {\r\n                vertx.close();\r\n            }));\r\n        }\r\n    }\r\n}\r\n```\r\nIt does not fail at all - just reporting exceptions to console, which misleads the ```gradle``` test reporter and producing wrong reports. Am I missing something and there should be some kind of reporter configured ? I've thought it should be done automatically in VertxUnitRunner."},"comment":{"url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/comments/141412813","html_url":"https://github.com/vert-x3/vertx-unit/issues/18#issuecomment-141412813","issue_url":"https://api.github.com/repos/vert-x3/vertx-unit/issues/18","id":141412813,"user":{"login":"VoidNugget","id":6811933,"avatar_url":"https://avatars.githubusercontent.com/u/6811933?v=3","gravatar_id":"","url":"https://api.github.com/users/VoidNugget","html_url":"https://github.com/VoidNugget","followers_url":"https://api.github.com/users/VoidNugget/followers","following_url":"https://api.github.com/users/VoidNugget/following{/other_user}","gists_url":"https://api.github.com/users/VoidNugget/gists{/gist_id}","starred_url":"https://api.github.com/users/VoidNugget/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoidNugget/subscriptions","organizations_url":"https://api.github.com/users/VoidNugget/orgs","repos_url":"https://api.github.com/users/VoidNugget/repos","events_url":"https://api.github.com/users/VoidNugget/events{/privacy}","received_events_url":"https://api.github.com/users/VoidNugget/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T10:24:08Z","updated_at":"2015-09-18T10:24:08Z","body":"[Test project](https://www.dropbox.com/s/30varvjeedhwd4p/testproj.zip?dl=0)\r\nWell, I've found my error, I should use async objects everytime I have to assert something async'ly.\r\n\r\nInstread of \r\n```\r\n  @Test\r\n    public void testSessionCookiePresent(TestContext ctx) {\r\n        rule.vertx().createHttpClient()\r\n            .get(opts.getPort(), \"localhost\", \"/\", res -> {\r\n                ctx.assertEquals(res.statusCode(), 404);\r\n            }).exceptionHandler(e -> {\r\n            ctx.fail(e);\r\n        }).end();\r\n    }\r\n```\r\n\r\nI have to use async\r\n```\r\n  @Test\r\n    public void testSessionCookiePresent(TestContext ctx) {\r\n        Async async = ctx.async();\r\n        rule.vertx().createHttpClient()\r\n            .get(opts.getPort(), \"localhost\", \"/\", res -> {\r\n                ctx.assertEquals(res.statusCode(), 404);\r\n                async.complete();\r\n            }).exceptionHandler(e -> {\r\n            ctx.fail(e);\r\n            async.complete();\r\n        }).end();\r\n    }\r\n```\r\n'cause assertions do not get executed at all.\r\n\r\nIt looks ugly, but it works...\r\nI think this should be documented properly.\r\n@vietj thanks for your attention."}}