{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/takes/issues/211","labels_url":"https://api.github.com/repos/yegor256/takes/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/211/comments","events_url":"https://api.github.com/repos/yegor256/takes/issues/211/events","html_url":"https://github.com/yegor256/takes/issues/211","id":71144952,"number":211,"title":"BkTimetable wrong design","user":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/takes/labels/bug","name":"bug","color":"c0c0c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-27T01:16:22Z","updated_at":"2015-04-27T10:07:36Z","closed_at":null,"body":"I think that current design of `BkTimetable` is too complex, that's why the unit test is very difficult to understand. I would refactor it and simplify. I would do it like this:\r\n\r\n```\r\nfinal class BkTimeable {\r\n  Back back;\r\n  long latency;\r\n  Thread monitor;\r\n  Map<Target, Long> threads; // thread and start time\r\n  public BkTimeable(Back back, long msec) {\r\n    //...\r\n  }\r\n}\r\n```\r\n\r\nJust one ctor, nothing else.\r\n\r\nCurrent unit tests are absolutely wrong. They don't test the class, but instead test its interaction with encapsulated elements. It's against the idea of OOP. Let's remove current tests and create a simple integration test, which will run a server (like it's done in `FtCLITest`) and make sure the request is interrupted in a few seconds."},"comment":{"url":"https://api.github.com/repos/yegor256/takes/issues/comments/96592564","html_url":"https://github.com/yegor256/takes/issues/211#issuecomment-96592564","issue_url":"https://api.github.com/repos/yegor256/takes/issues/211","id":96592564,"user":{"login":"davvd","id":6305016,"avatar_url":"https://avatars.githubusercontent.com/u/6305016?v=3","gravatar_id":"","url":"https://api.github.com/users/davvd","html_url":"https://github.com/davvd","followers_url":"https://api.github.com/users/davvd/followers","following_url":"https://api.github.com/users/davvd/following{/other_user}","gists_url":"https://api.github.com/users/davvd/gists{/gist_id}","starred_url":"https://api.github.com/users/davvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davvd/subscriptions","organizations_url":"https://api.github.com/users/davvd/orgs","repos_url":"https://api.github.com/users/davvd/repos","events_url":"https://api.github.com/users/davvd/events{/privacy}","received_events_url":"https://api.github.com/users/davvd/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T10:07:36Z","updated_at":"2015-04-27T10:07:36Z","body":"@yegor256 I will find a developer for the task soon..."}}