1

I wrote integration test but it doesn't work. It throws Failed load ApplicationContext. I think problem with liquibase but I hadn't fix that. Other tests are worked but it didn't.

My entity liquibase xml file:

<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">

    <!--
        Added the entity Todo.
    -->
    <changeSet id="20221116131213-1" author="jhipster">
        <createTable tableName="todo_list">
            <column name="id" type="bigint">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="created_at" type="date">
                <constraints nullable="true" />
            </column>
            <column name="none" type="boolean">
                <constraints nullable="true" />
            </column>
            <column name="task_id" type="bigint">
                <constraints nullable="true" />
            </column>
            <column name="customer_id" type="bigint">
                <constraints nullable="true" />
            </column>
            <!-- jhipster-needle-liquibase-add-column - JHipster will add columns here -->
        </createTable>
    </changeSet>

    <!-- jhipster-needle-liquibase-add-changeset - JHipster will add changesets here -->

    <!--
        Load sample data generated with Faker.js
        - This data can be easily edited using a CSV editor (or even MS Excel) and
          is located in the 'src/main/resources/config/liquibase/fake-data' directory
        - By default this data is applied when running with the JHipster 'dev' profile.
          This can be customized by adding or removing 'faker' in the 'spring.liquibase.contexts'
          Spring Boot configuration key.
    -->
    <changeSet id="20221116131213-1-data" author="jhipster" context="faker">
        <loadData
                  file="config/liquibase/fake-data/todo.csv"
                  separator=";"
                  tableName="todo"
                  usePreparedStatements="true">
            <column name="id" type="numeric"/>
            <column name="created_at" type="date"/>
            <column name="none" type="boolean"/>
            <!-- jhipster-needle-liquibase-add-loadcolumn - JHipster (and/or extensions) can add load columns here -->
        </loadData>
    </changeSet>
</databaseChangeLog>

Application yml: enter image description here

Error: enter image description here

Thanks for answers

I had tried to fix liquibase but can't.

  • title and error screenshot point different errors. in the screen shot `failed to determine a suitable driver class`means you need to check properties of db (url maybe). – muhammed ozbilici Nov 23 '22 at 15:15
  • We found the cause. Problem was on name of class. At first I've created class with name `MarkTaskTest`, in that situation, program throws exception, than we change name of class to `MarkTask`, after that program has run without problem. At first I didn't believe that, than I've checked all test class which is created by JHipster. Any class hasn't named with `Test`) – Sardor Shorahimov Nov 23 '22 at 19:48
  • By convention, in JHipster, integration tests class names are suffixed by `IT` and annotated with `@IntegrationTest`, it has some importance for maven/gradle configuration and for application context. – Gaël Marziou Nov 24 '22 at 08:55

0 Answers0