{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-http/issues/216","repository_url":"https://api.github.com/repos/akka/akka-http","labels_url":"https://api.github.com/repos/akka/akka-http/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/216/comments","events_url":"https://api.github.com/repos/akka/akka-http/issues/216/events","html_url":"https://github.com/akka/akka-http/issues/216","id":175966670,"number":216,"title":"[akka-testkit] JUnitRouteTest has dependency on scalatest, and is Serializable","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akka/akka-http/labels/1%20-%20triaged","name":"1 - triaged","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-09T09:29:16Z","updated_at":"2016-09-19T07:22:31Z","closed_at":null,"body":"<a href=\"https://github.com/jypma\"><img src=\"https://avatars.githubusercontent.com/u/483519?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [jypma](https://github.com/jypma)**\n_Thursday May 19, 2016 at 09:26 GMT_\n_Originally opened as https://github.com/akka/akka/issues/20559_\n\n----\n\nSince 2.4.5, `JUnitRouteTest` pulls in the trait `JUnitSuiteLike` from scalatest. This has two (unintended?) side-effects:\r\n\r\n1. Projects using `JUnitRouteTest` must declare a dependency on scalatest themselves, since it's not a declared compile dependency for akka-testkit (apparently).\r\n2. All Java test classes now are marked `Serializable` (since `Suite` is), triggering compiler warnings by default.\r\n\n"},"comment":{"url":"https://api.github.com/repos/akka/akka-http/issues/comments/247925726","html_url":"https://github.com/akka/akka-http/issues/216#issuecomment-247925726","issue_url":"https://api.github.com/repos/akka/akka-http/issues/216","id":247925726,"user":{"login":"jypma","id":483519,"avatar_url":"https://avatars.githubusercontent.com/u/483519?v=3","gravatar_id":"","url":"https://api.github.com/users/jypma","html_url":"https://github.com/jypma","followers_url":"https://api.github.com/users/jypma/followers","following_url":"https://api.github.com/users/jypma/following{/other_user}","gists_url":"https://api.github.com/users/jypma/gists{/gist_id}","starred_url":"https://api.github.com/users/jypma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jypma/subscriptions","organizations_url":"https://api.github.com/users/jypma/orgs","repos_url":"https://api.github.com/users/jypma/repos","events_url":"https://api.github.com/users/jypma/events{/privacy}","received_events_url":"https://api.github.com/users/jypma/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T07:22:31Z","updated_at":"2016-09-19T07:22:31Z","body":"@richard-imaoka here's the base class we're currently using:\r\n```\r\npublic class JUnitRouteTest extends akka.http.javadsl.testkit.RouteTest {\r\n    private static final Config config = ConfigFactory.defaultReference();\r\n    private static final ActorSystem _system = ActorSystem.create(\"route-test\", config);\r\n    private static final Materializer _materializer = ActorMaterializer.create(_system);\r\n    \r\n    @Override\r\n    public TestRouteResult createTestRouteResult(HttpRequest arg0, RouteResult arg1) {\r\n        return new TestRouteResult(arg1, awaitDuration(), _system.dispatcher(), _materializer) {\r\n            @Override\r\n            public void assertEquals(Object expected, Object actual, String message) {\r\n                Assert.assertEquals(message, expected, actual);\r\n            }\r\n\r\n            @Override\r\n            public void assertEquals(int expected, int actual, String message) {\r\n                Assert.assertEquals(message, expected, actual);\r\n            }\r\n\r\n            @Override\r\n            public void assertTrue(boolean predicate, String message) {\r\n                Assert.assertTrue(message, predicate);\r\n            }\r\n\r\n            @Override\r\n            public void fail(String message) {\r\n                Assert.fail(message);\r\n            }\r\n        };\r\n    }\r\n\r\n    @Override\r\n    public Materializer materializer() {\r\n        return _materializer;\r\n    }\r\n\r\n    @Override\r\n    public ActorSystem system() {\r\n        return _system;\r\n    }\r\n}\r\n```\r\nThat works for us, but lacks the ability to customize the `config`. One could look into integrating the existing `ActorSystemResource`."}}
{"actor":{"display_login":"jypma"}}