package io.quarkus.hibernate.search.elasticsearch.test.configuration;

import java.sql.SQLException;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.deployment.configuration.ConfigurationError;
import io.quarkus.test.QuarkusUnitTest;

public class NoConfigIndexedEntityTest {

    @RegisterExtension
    static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer(
            () -> ShrinkWrap.create(JavaArchive.class).addClass(IndexedEntity.class)
                    .addAsResource("application-nohsearchconfig.properties", "application.properties"))
            .setExpectedException(ConfigurationError.class);

    @Test
    public void testNoConfig() throws SQLException {
        // an exception should be thrown
    }
}

@@ -60,24 +60,83 @@
 iguration;%0A%0A
+import static org.assertj.core.api.Assertions.assertThat;%0A%0A
 import java.
@@ -801,53 +801,309 @@
    .
+as
 se
+r
 tEx
-pectedException(ConfigurationError.class
+ception(throwable -%3E assertThat(throwable)%0A                    .isInstanceOf(ConfigurationError.class)%0A                    .hasMessageContaining(%22The Elasticsearch version needs to be defined via properties:%22%0A                            + %22 quarkus.hibernate-search-orm.elasticsearch.version%22)
 );%0A%0A

Clarify expectations in NoConfigIndexedEntityTest