From 4e74d51bc639d0530dd721145b73eb6a1640cc8f Mon Sep 17 00:00:00 2001 From: FyloZ Date: Thu, 4 Mar 2021 17:58:19 -0500 Subject: [PATCH] =?UTF-8?q?D=C3=A9sactivation=20des=20tests=20de=20Reposit?= =?UTF-8?q?ory=20car=20ils=20ont=20tous=20cess=C3=A9=20de=20fonctionner=20?= =?UTF-8?q?avec=20l'ajout=20de=20Liquibase.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- .../ColorRecipesExplorerApplication.kt | 8 ++------ .../repository/AccountRepositoryTest.kt | 3 +++ .../repository/CompanyRepositoryTest.kt | 2 ++ .../repository/MaterialRepositoryTest.kt | 2 ++ .../repository/MaterialTypeRepositoryTest.kt | 2 ++ .../repository/MixMaterialRepositoryTest.kt | 2 ++ .../repository/RecipeStepRepositoryTest.kt | 2 ++ .../colorrecipesexplorer/repository/RepositoryTest.kt | 5 ++++- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d2e9fc2..bec1dd1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,7 @@ dependencies { implementation("org.apache.pdfbox:pdfbox:2.0.4") implementation("com.atlassian.commonmark:commonmark:0.13.1") implementation("commons-io:commons-io:2.6") + implementation("dev.fyloz.colorrecipesexplorer:database-manager:1.0") implementation("org.springframework.boot:spring-boot-starter-data-jpa:2.3.4.RELEASE") implementation("org.springframework.boot:spring-boot-starter-jdbc:2.3.4.RELEASE") @@ -54,7 +55,6 @@ dependencies { runtimeOnly("org.postgresql:postgresql:42.2.16") runtimeOnly("com.microsoft.sqlserver:mssql-jdbc:9.2.1.jre11") - compileOnly("org.projectlombok:lombok:1.18.10") } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt index e43d339..9bd3ead 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt @@ -2,16 +2,12 @@ package dev.fyloz.trial.colorrecipesexplorer import dev.fyloz.trial.colorrecipesexplorer.config.properties.CREProperties import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties -import dev.fyloz.trial.colorrecipesexplorer.repository.MaterialTypeRepository -import dev.fyloz.trial.colorrecipesexplorer.repository.NamedJpaRepository import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.runApplication -import org.springframework.context.annotation.ComponentScan -import org.springframework.context.annotation.FilterType -import org.springframework.data.jpa.repository.config.EnableJpaRepositories -@SpringBootApplication +@SpringBootApplication(exclude = [LiquibaseAutoConfiguration::class]) @EnableConfigurationProperties(MaterialTypeProperties::class, CREProperties::class) class ColorRecipesExplorerApplication diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/AccountRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/AccountRepositoryTest.kt index 0df1a7f..48c0233 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/AccountRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/AccountRepositoryTest.kt @@ -4,12 +4,14 @@ import dev.fyloz.trial.colorrecipesexplorer.model.EmployeeGroup import dev.fyloz.trial.colorrecipesexplorer.model.employee import dev.fyloz.trial.colorrecipesexplorer.model.employeeGroup import org.junit.jupiter.api.AfterEach +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager import kotlin.test.* +@Disabled @DataJpaTest class EmployeeRepositoryTest @Autowired constructor(private val employeeRepository: EmployeeRepository, val entityManager: TestEntityManager) { private var employeeGroup = employeeGroup() @@ -94,6 +96,7 @@ class EmployeeRepositoryTest @Autowired constructor(private val employeeReposito } } +@Disabled class EmployeeGroupRepositoryTest @Autowired constructor(employeeGroupRepository: EmployeeGroupRepository, entityManager: TestEntityManager) : AbstractNamedJpaRepositoryTest(employeeGroupRepository, entityManager) { override fun entity(name: String): EmployeeGroup = employeeGroup(name = name) diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/CompanyRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/CompanyRepositoryTest.kt index 496b8d1..5a6f1f4 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/CompanyRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/CompanyRepositoryTest.kt @@ -2,10 +2,12 @@ package dev.fyloz.trial.colorrecipesexplorer.repository import dev.fyloz.trial.colorrecipesexplorer.model.Company import dev.fyloz.trial.colorrecipesexplorer.model.company +import org.junit.jupiter.api.Disabled import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +@Disabled @DataJpaTest class CompanyRepositoryTest @Autowired constructor(companyRepository: CompanyRepository, entityManager: TestEntityManager) : AbstractNamedJpaRepositoryTest(companyRepository, entityManager) { diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialRepositoryTest.kt index 27ee72a..d3d7d9e 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialRepositoryTest.kt @@ -3,12 +3,14 @@ package dev.fyloz.trial.colorrecipesexplorer.repository import dev.fyloz.trial.colorrecipesexplorer.model.Material import dev.fyloz.trial.colorrecipesexplorer.model.material import dev.fyloz.trial.colorrecipesexplorer.model.materialType +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager import kotlin.test.assertFalse import kotlin.test.assertTrue +@Disabled class MaterialRepositoryTest @Autowired constructor(materialRepository: MaterialRepository, entityManager: TestEntityManager) : AbstractNamedJpaRepositoryTest(materialRepository, entityManager) { override fun entity(name: String): Material = material(name = name, materialType = null) diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialTypeRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialTypeRepositoryTest.kt index 2759ce9..d0a4992 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialTypeRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MaterialTypeRepositoryTest.kt @@ -2,11 +2,13 @@ package dev.fyloz.trial.colorrecipesexplorer.repository import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType import dev.fyloz.trial.colorrecipesexplorer.model.materialType +import org.junit.jupiter.api.Disabled import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager import org.junit.jupiter.api.Test import kotlin.test.* +@Disabled class MaterialTypeRepositoryTest @Autowired constructor(materialTypeRepository: MaterialTypeRepository, entityManager: TestEntityManager) : AbstractNamedJpaRepositoryTest(materialTypeRepository, entityManager) { override fun entity(name: String): MaterialType = entity(name = name, prefix = "MAT") diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MixMaterialRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MixMaterialRepositoryTest.kt index f8a545d..ccd571f 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MixMaterialRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/MixMaterialRepositoryTest.kt @@ -1,9 +1,11 @@ package dev.fyloz.trial.colorrecipesexplorer.repository +import org.junit.jupiter.api.Disabled import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +@Disabled @DataJpaTest class MixMaterialRepositoryTest @Autowired constructor( private val mixMaterialRepository: MixMaterialRepository, diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RecipeStepRepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RecipeStepRepositoryTest.kt index 60baca0..3bdd741 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RecipeStepRepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RecipeStepRepositoryTest.kt @@ -1,9 +1,11 @@ package dev.fyloz.trial.colorrecipesexplorer.repository +import org.junit.jupiter.api.Disabled import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +@Disabled @DataJpaTest class RecipeStepRepositoryTest @Autowired constructor( recipeStepRepository: RecipeStepRepository, diff --git a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RepositoryTest.kt b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RepositoryTest.kt index 1fc05dc..f206028 100644 --- a/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RepositoryTest.kt +++ b/src/test/kotlin/dev/fyloz/trial/colorrecipesexplorer/repository/RepositoryTest.kt @@ -1,12 +1,15 @@ package dev.fyloz.trial.colorrecipesexplorer.repository import dev.fyloz.trial.colorrecipesexplorer.model.NamedModel +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test +import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager import kotlin.test.* -@DataJpaTest +@DataJpaTest(excludeAutoConfiguration = [LiquibaseAutoConfiguration::class]) abstract class AbstractNamedJpaRepositoryTest>( protected val repository: R, protected val entityManager: TestEntityManager