@Test void testProvideUsersDao() { var factory = mock(EmailServiceFactory.class); var emailService = mock(EmailService.class); when(factory.createEmailService(any(MetricRegistry.class))).thenReturn(emailService); EmailModule module = new EmailModule(factory); Assert.assertEquals(emailService, module.provideEmailService(new MetricRegistry())); }
@Singleton @Provides EmailService provideEmailService(MetricRegistry metrics) { return emailServiceFactory.createEmailService(metrics); }
EmailModule { @Singleton @Provides EmailService provideEmailService(MetricRegistry metrics) { return emailServiceFactory.createEmailService(metrics); } }
EmailModule { @Singleton @Provides EmailService provideEmailService(MetricRegistry metrics) { return emailServiceFactory.createEmailService(metrics); } EmailModule(EmailServiceFactory emailServiceFactory); }
EmailModule { @Singleton @Provides EmailService provideEmailService(MetricRegistry metrics) { return emailServiceFactory.createEmailService(metrics); } EmailModule(EmailServiceFactory emailServiceFactory);  }
EmailModule { @Singleton @Provides EmailService provideEmailService(MetricRegistry metrics) { return emailServiceFactory.createEmailService(metrics); } EmailModule(EmailServiceFactory emailServiceFactory);   }