Jersey 2 inject dependencies into unit test
<p>I have a controller like this </p>

<pre><code>@Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class AccountController implements CRUDController&lt;Long, Account&gt; {

    private AccountDao accountDao;
    private AccountService accountService;

    @Inject
    public AccountController(AccountDao accountDao, AccountService accountService) {
        this.accountDao = accountDao;
        this.accountService = accountService;
    }
...
</code></pre>

<p>I'm injecting AccountDao and AccountService using </p>

<pre><code>ResourceConfig config = new ResourceConfig()
               .packages("controller", "exception")
               .register(new MyDIBinder());
</code></pre>

<p>Where MyDIBinder is contains all the bindings (e.g </p>

<pre><code>AccountDaoImpl accountDaoImpl = new AccountDaoImpl();
bind(accountDaoImpl).to(AccountDao.class);
</code></pre>

<p>)</p>

<p>Now I want to write a unit test for this controller, is it possible to inject the whole AccountController instance with all of it's transitive dependencies into the test?</p>

<p>Something like </p>

<pre><code>    @Inject
    AccountController accountController;
</code></pre>