Skip to content

Instantly share code, notes, and snippets.

@vorburger
Created July 27, 2016 18:07
Show Gist options
  • Select an option

  • Save vorburger/37ac79aaf375cc43238cbf139d188d2b to your computer and use it in GitHub Desktop.

Select an option

Save vorburger/37ac79aaf375cc43238cbf139d188d2b to your computer and use it in GitHub Desktop.
package org.opendaylight.netvirt.aclservice.tests.utils.tests.inject;
import static org.junit.Assert.assertEquals;
import dagger.Component;
import javax.inject.Inject;
import javax.inject.Provider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.netvirt.aclservice.tests.utils.inject.InstanceProvidedBy;
import org.opendaylight.netvirt.aclservice.tests.utils.inject.ProviderRunner;
@RunWith(ProviderRunner.class)
@InstanceProvidedBy(DaggerExampleRunWithTest_Configuration.class)
public class ExampleRunWithTest {
@Component(modules = TestModule1.class)
interface Configuration extends Provider<ExampleRunWithTest> {
ExampleRunWithTest get();
}
@Inject Service service;
@Inject
public ExampleRunWithTest() {
}
@Test
public void serviceTest() {
assertEquals("hello, world", service.hi());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment