import org.wamblee.inject.Injector;
import org.wamblee.inject.InjectorFactory;
-import org.wamblee.inject.InjectorFactoryBuilder;
+import org.wamblee.inject.InjectorBuilder;
import org.wamblee.test.persistence.JpaBuilder;
/**
*
* <p>
* To use it, construct the factory using one of the available constructors and set
- * <code>InjectorFactoryBuilder.setInjectorFactory(InjectorFactory</code>.
+ * <code>InjectorBuilder.setInjectorFactory(InjectorFactory)</code>.
* </p>
*
* @author Erik Brakkee
/**
* Constructs the factory with the default injector factory obtained from
- * {@link InjectorFactoryBuilder#getInjector()}.
+ * {@link InjectorBuilder#getInjector()}.
* @param aEntityManager Contextual entity manager to inject.
*/
public JavaEETestInjectorFactory(EntityManager aEntityManager) {
}
private static InjectorFactory getDefaultInjectorFactory() {
- InjectorFactoryBuilder.setInjectorFactory(null);
- return InjectorFactoryBuilder.getInjectorFactory();
+ InjectorBuilder.setInjectorFactory(null);
+ return InjectorBuilder.getInjectorFactory();
}
@Override
import javax.persistence.PersistenceContext;
import org.junit.Test;
-import org.wamblee.inject.InjectorFactoryBuilder;
+import org.wamblee.inject.InjectorBuilder;
import static org.mockito.Mockito.*;
import static junit.framework.TestCase.*;
@Test
public void testXyz() {
EntityManager em = mock(EntityManager.class);
- InjectorFactoryBuilder.setInjectorFactory(new JavaEETestInjectorFactory(em));
+ InjectorBuilder.setInjectorFactory(new JavaEETestInjectorFactory(em));
assertNull(entityManager);
assertNull(entityManager2);
- InjectorFactoryBuilder.getInjector().inject(this);
+ InjectorBuilder.getInjector().inject(this);
assertNotNull(em);
assertSame(em, entityManager);
@Test(expected = IllegalArgumentException.class)
public void testWrongType() {
EntityManager em = mock(EntityManager.class);
- InjectorFactoryBuilder.setInjectorFactory(new JavaEETestInjectorFactory(em));
+ InjectorBuilder.setInjectorFactory(new JavaEETestInjectorFactory(em));
X x= new X();
- InjectorFactoryBuilder.getInjector().inject(x);
+ InjectorBuilder.getInjector().inject(x);
}
}