Skip to content

Commit

Permalink
Fix processTestAot
Browse files Browse the repository at this point in the history
  • Loading branch information
hsw0 committed Nov 30, 2023
1 parent 7175049 commit 11dac20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
package io.syscall.hsw.study.apiserver.infra;

import io.syscall.hsw.study.apiserver.ApiApplicationTests;
import org.junit.jupiter.api.TestInstance;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration;
import org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration;
import org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters;
import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFlux;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTypeExcludeFilter;
import org.springframework.boot.test.context.SpringBootTest;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@SpringBootTest(classes = ApiInfraLayerTest.Config.class)
@OverrideAutoConfiguration(enabled = false)
@TypeExcludeFilters(WebFluxTypeExcludeFilter.class)
@AutoConfigureJson
@AutoConfigureWebFlux
@AutoConfigureWebTestClient
@ImportAutoConfiguration(ApplicationAvailabilityAutoConfiguration.class)
public abstract class ApiInfraLayerTest {
public abstract class ApiInfraLayerTest extends ApiApplicationTests {

@SpringBootApplication
static class Config {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package io.syscall.hsw.study.apiserver

import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest(classes = [ApiApplication::class])
@AutoConfigureWebTestClient
class ApiApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package io.syscall.hsw.study.apiserver.example.repository

import io.syscall.hsw.study.apiserver.ApiApplication
import io.syscall.hsw.study.apiserver.ApiApplicationTests
import io.syscall.hsw.study.apiserver.example.entity.PersonEntity
import io.syscall.hsw.study.apiserver.example.model.PersonId
import jakarta.persistence.EntityManager
import org.assertj.core.api.Assertions.assertThat
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest
import org.springframework.test.context.ContextConfiguration
import kotlin.test.Test

@DataJpaTest
@ContextConfiguration(classes = [ApiApplication::class])
class PersonRepositoryTest {
class PersonRepositoryTest : ApiApplicationTests() {

@Autowired
lateinit var repository: PersonRepository
Expand Down

0 comments on commit 11dac20

Please sign in to comment.