@@ -0,0 +1,2131 @@
+package io.quarkus.hibernate.reactive;%0A%0Aimport javax.inject.Inject;%0Aimport javax.persistence.Column;%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.Table;%0A%0Aimport org.hibernate.reactive.mutiny.Mutiny;%0Aimport org.hibernate.tool.schema.spi.SchemaManagementException;%0Aimport org.junit.jupiter.api.Assertions;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.RegisterExtension;%0A%0Aimport io.quarkus.test.QuarkusUnitTest;%0A%0Apublic class SchemaValidateTest %7B%0A%0A    @RegisterExtension%0A    static QuarkusUnitTest runner = new QuarkusUnitTest()%0A            .withApplicationRoot((jar) -%3E jar%0A                    .addClass(Hero.class))%0A            .withConfigurationResource(%22application.properties%22)%0A            .assertException(SchemaValidateTest::isSchemaValidationException)%0A            .overrideConfigKey(%22quarkus.hibernate-orm.database.generation%22, %22validate%22);%0A%0A    @Inject%0A    Mutiny.SessionFactory sessionFactory;%0A%0A    @Test%0A    public void testSchemaValidationException() %7B%0A        Assertions.fail(%22We expect an exception because the db is empty%22);%0A    %7D%0A%0A    private static void isSchemaValidationException(Throwable t) %7B%0A        Throwable cause = t;%0A        while (cause != null && !cause.getClass().getName().equals(SchemaManagementException.class.getName())) %7B%0A            cause = cause.getCause();%0A        %7D%0A        String causeName = cause != null ? cause.getClass().getName() : null;%0A        Assertions.assertEquals(SchemaManagementException.class.getName(), causeName);%0A        Assertions.assertTrue(cause.getMessage().contains(%22Schema-validation: missing table %5B%22 + Hero.TABLE + %22%5D%22));%0A    %7D%0A%0A    @Entity(name = %22Hero%22)%0A    @Table(name = Hero.TABLE)%0A    public static class Hero %7B%0A%0A        public static final String TABLE = %22Hero_for_validation%22;%0A%0A        @javax.persistence.Id%0A        @javax.persistence.GeneratedValue%0A        public java.lang.Long id;%0A%0A        @Column(unique = true)%0A        public String name;%0A%0A        public String otherName;%0A%0A        public int level;%0A%0A        public String picture;%0A%0A        @Column(columnDefinition = %22TEXT%22)%0A        public String powers;%0A%0A    %7D%0A%7D%0A

Test schema validation for Hibernate Reactive