{"action":"opened","issue":{"url":"https://api.github.com/repos/twitter/finatra/issues/373","repository_url":"https://api.github.com/repos/twitter/finatra","labels_url":"https://api.github.com/repos/twitter/finatra/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/twitter/finatra/issues/373/comments","events_url":"https://api.github.com/repos/twitter/finatra/issues/373/events","html_url":"https://github.com/twitter/finatra/issues/373","id":193662576,"number":373,"title":"TestInjector does not respect default value for Boolean flag","user":{"login":"komsit37","id":7501978,"avatar_url":"https://avatars.githubusercontent.com/u/7501978?v=3","gravatar_id":"","url":"https://api.github.com/users/komsit37","html_url":"https://github.com/komsit37","followers_url":"https://api.github.com/users/komsit37/followers","following_url":"https://api.github.com/users/komsit37/following{/other_user}","gists_url":"https://api.github.com/users/komsit37/gists{/gist_id}","starred_url":"https://api.github.com/users/komsit37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/komsit37/subscriptions","organizations_url":"https://api.github.com/users/komsit37/orgs","repos_url":"https://api.github.com/users/komsit37/repos","events_url":"https://api.github.com/users/komsit37/events{/privacy}","received_events_url":"https://api.github.com/users/komsit37/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-06T01:56:34Z","updated_at":"2016-12-06T01:56:34Z","closed_at":null,"body":"When using TestInjector to inject Module with Boolean flag, default value was never used and is always returning true. The default value is correct when injecting in finatra http or thrift server.\r\n\r\n### Expected behavior\r\n\r\nTest pass\r\n\r\n### Actual behavior\r\n\r\nTest fails with 'f.bar was true'\r\n\r\n### Steps to reproduce the behavior\r\n```scala\r\nobject BooleanFlagModule extends TwitterModule {\r\n  flag[Boolean](\"x\", false, \"default to false\")\r\n}\r\n\r\nclass Foo @Inject()(@Flag(\"x\") x: Boolean) {\r\n  def bar = x\r\n}\r\n\r\nclass BooleanFlagTest extends FlatSpec {\r\n  \"flag\" should \"be false\" in {\r\n    val inj = TestInjector(BooleanFlagModule)\r\n    val f = inj.instance[Foo]\r\n    assert(!f.bar) //fails: f.bar was true\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"komsit37"}}