@Test
public void testRegisterProducer() {

    // GIVEN
    final JpaUnitCdiExtension extension = new JpaUnitCdiExtension();
    // WHEN
    extension.registerProducer(producer);
    // THEN
    verify(producer).getProducer();
    verify(producer).setProducer(producerCaptor.capture());
    verifyNoMoreInteractions(producer);
    final Producer<EntityManager> captured = producerCaptor.getValue();
    assertThat(captured, not(nullValue()));
    assertThat(captured, instanceOf(EntityManagerProducerProxy.class));
}