// Path: core/src/main/java/eu/drus/jpa/unit/spi/Constants.java
// public final class Constants {
// 
//     private Constants() {}
// 
//     public static final String KEY_ENTITY_MANAGER_FACTORY = "eu.drus.jpa.unit.core.EntityManagerFactory";
//     public static final String KEY_ENTITY_MANAGER = "eu.drus.jpa.unit.core.EntityManager";
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/ExecutionContext.java
// public interface ExecutionContext {
// 
//     Field getPersistenceField();
// 
//     PersistenceUnitDescriptor getDescriptor();
// 
//     void storeData(String key, Object value);
// 
//     Object getData(String key);
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/TestInvocation.java
// public interface TestInvocation {
// 
//     Class<?> getTestClass();
// 
//     ExecutionContext getContext();
// 
//     Optional<Method> getTestMethod();
// 
//     Optional<Object> getTestInstance();
// 
//     Optional<Throwable> getException();
// 
//     FeatureResolver getFeatureResolver();
// }


import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import javax.persistence.EntityManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import eu.drus.jpa.unit.spi.Constants;
import eu.drus.jpa.unit.spi.ExecutionContext;
import eu.drus.jpa.unit.spi.TestInvocation;
package eu.drus.jpa.unit.cdi;





@RunWith(MockitoJUnitRunner.class)
public class CdiProducerDecoratorTest {

    @Mock
    private TestInvocation invocation;

    @Mock
    private EntityManager em;

    @Mock
    private ExecutionContext ctx;

    @Mock
    private EntityManagerHolder emh;

    @InjectMocks
    private CdiProducerDecorator fixture;

    @Before
    public void setUp() throws Exception {
        when(invocation.getContext()).thenReturn(ctx);
// Path: core/src/main/java/eu/drus/jpa/unit/spi/Constants.java
// public final class Constants {
// 
//     private Constants() {}
// 
//     public static final String KEY_ENTITY_MANAGER_FACTORY = "eu.drus.jpa.unit.core.EntityManagerFactory";
//     public static final String KEY_ENTITY_MANAGER = "eu.drus.jpa.unit.core.EntityManager";
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/ExecutionContext.java
// public interface ExecutionContext {
// 
//     Field getPersistenceField();
// 
//     PersistenceUnitDescriptor getDescriptor();
// 
//     void storeData(String key, Object value);
// 
//     Object getData(String key);
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/TestInvocation.java
// public interface TestInvocation {
// 
//     Class<?> getTestClass();
// 
//     ExecutionContext getContext();
// 
//     Optional<Method> getTestMethod();
// 
//     Optional<Object> getTestInstance();
// 
//     Optional<Throwable> getException();
// 
//     FeatureResolver getFeatureResolver();
// }


// Path: cdi/src/test/java/eu/drus/jpa/unit/cdi/CdiProducerDecoratorTest.java
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import javax.persistence.EntityManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import eu.drus.jpa.unit.spi.Constants;
import eu.drus.jpa.unit.spi.ExecutionContext;
import eu.drus.jpa.unit.spi.TestInvocation;

package eu.drus.jpa.unit.cdi;





@RunWith(MockitoJUnitRunner.class)
public class CdiProducerDecoratorTest {

    @Mock
    private TestInvocation invocation;

    @Mock
    private EntityManager em;

    @Mock
    private ExecutionContext ctx;

    @Mock
    private EntityManagerHolder emh;

    @InjectMocks
    private CdiProducerDecorator fixture;

    @Before
    public void setUp() throws Exception {
        when(invocation.getContext()).thenReturn(ctx);
        when(ctx.getData(eq(Constants.KEY_ENTITY_MANAGER))).thenReturn(em);