@@ -0,0 +1,3117 @@
+package io.quarkus.hibernate.reactive;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport javax.enterprise.context.control.ActivateRequestContext;%0Aimport javax.inject.Inject;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.GeneratedValue;%0Aimport javax.persistence.GenerationType;%0Aimport javax.persistence.Id;%0A%0Aimport org.hibernate.SessionFactory;%0Aimport org.hibernate.engine.spi.SessionFactoryImplementor;%0Aimport org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform;%0Aimport org.hibernate.reactive.mutiny.Mutiny;%0Aimport org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder;%0Aimport org.hibernate.service.spi.ServiceRegistryImplementor;%0Aimport org.jboss.shrinkwrap.api.ShrinkWrap;%0Aimport org.jboss.shrinkwrap.api.spec.JavaArchive;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.RegisterExtension;%0A%0Aimport io.quarkus.test.QuarkusUnitTest;%0A%0Apublic class NoJtaTest %7B%0A%0A    @RegisterExtension%0A    static QuarkusUnitTest runner = new QuarkusUnitTest()%0A            .setArchiveProducer(() -%3E ShrinkWrap.create(JavaArchive.class)%0A                    .addClass(MyEntity.class)%0A                    .addAsResource(%22application.properties%22));%0A%0A    @Inject%0A    SessionFactory sessionFactory; // This is an ORM SessionFactory, but it's backing Hibernate Reactive.%0A%0A    @Inject%0A    Mutiny.Session session;%0A%0A    @Test%0A    @ActivateRequestContext%0A    public void test() %7B%0A        ServiceRegistryImplementor serviceRegistry = sessionFactory.unwrap(SessionFactoryImplementor.class)%0A                .getServiceRegistry();%0A%0A        // Two assertions are necessary, because these values are influenced by separate configuration%0A        assertThat(serviceRegistry.getService(JtaPlatform.class).retrieveTransactionManager()).isNull();%0A        assertThat(serviceRegistry.getService(TransactionCoordinatorBuilder.class).isJta()).isFalse();%0A%0A        // Quick test to make sure HRX works%0A        MyEntity entity = new MyEntity(%22default%22);%0A        MyEntity retrievedEntity = session.withTransaction(tx -%3E session.persist(entity))%0A                .chain(() -%3E session.withTransaction(tx -%3E session.clear().find(MyEntity.class, entity.getId())))%0A                .await().indefinitely();%0A        assertThat(retrievedEntity)%0A                .isNotSameAs(entity)%0A                .returns(entity.getName(), MyEntity::getName);%0A    %7D%0A%0A    @Entity%0A    public static class MyEntity %7B%0A%0A        private long id;%0A%0A        private String name;%0A%0A        public MyEntity() %7B%0A        %7D%0A%0A        public MyEntity(String name) %7B%0A            this.name = name;%0A        %7D%0A%0A        @Override%0A        public String toString() %7B%0A            return getClass().getSimpleName() + %22:%22 + name;%0A        %7D%0A%0A        @Id%0A        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = %22defaultSeq%22)%0A        public long getId() %7B%0A            return id;%0A        %7D%0A%0A        public void setId(long id) %7B%0A            this.id = id;%0A        %7D%0A%0A        public String getName() %7B%0A            return name;%0A        %7D%0A%0A        public void setName(String name) %7B%0A            this.name = name;%0A        %7D%0A    %7D%0A%7D%0A

Test that JTA is disabled for Hibernate Reactive persistence units