Apply and enforce spring-javaformat

This commit is contained in:
Simon DeMartini
2022-03-18 21:19:05 -07:00
committed by Dave Syer
parent ad60397400
commit 7254dc8be7
44 changed files with 1060 additions and 825 deletions

View File

@@ -26,14 +26,17 @@ public class SimpleWiringTests {
@Test
public void springyFoo() {
@SuppressWarnings("resource")
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestConfig.class, MyService.class);
context.getDefaultListableBeanFactory().registerBeanDefinition(Foo.class.getSimpleName(), new RootBeanDefinition(Foo.class));
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestConfig.class,
MyService.class);
context.getDefaultListableBeanFactory().registerBeanDefinition(Foo.class.getSimpleName(),
new RootBeanDefinition(Foo.class));
assertNotNull(context.getBean(Foo.class));
}
@Test
public void hybridFoo() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestConfig.class, ModulesConfig.class);
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestConfig.class,
ModulesConfig.class);
Injector app = new SpringInjector(context);
assertNotNull(app.getInstance(Foo.class));
}
@@ -41,23 +44,28 @@ public class SimpleWiringTests {
@Configuration
@EnableGuiceModules
static class ModulesConfig {
}
public static class TestConfig extends AbstractModule {
@Override
protected void configure() {
bind(Service.class).to(MyService.class);
}
}
interface Service {
interface Service {
}
public static class MyService implements Service {
}
public static class Foo {
@Inject
public Foo(Service service) {
}