|
16 | 16 | package io.flamingock.springboot.testsupport; |
17 | 17 |
|
18 | 18 | import io.flamingock.internal.core.builder.AbstractChangeRunnerBuilder; |
19 | | -import io.flamingock.support.FlamingockTestSupport; |
20 | | -import io.flamingock.support.stages.GivenStage; |
21 | 19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; |
22 | 20 | import org.springframework.context.annotation.Bean; |
23 | 21 | import org.springframework.context.annotation.Configuration; |
24 | 22 | import org.springframework.context.annotation.Scope; |
25 | 23 |
|
26 | 24 | /** |
27 | | - * Auto-configuration that provides a {@link GivenStage} bean for Flamingock testing. |
| 25 | + * Autoconfiguration that provides a {@link FlamingockSpringBootTestSupport} bean for Flamingock testing. |
28 | 26 | * |
29 | 27 | * <p>This configuration is automatically picked up when using {@link FlamingockSpringBootTest} |
30 | | - * and provides a ready-to-use {@code GivenStage} bean that can be autowired directly in tests.</p> |
| 28 | + * and provides a ready-to-use {@code FlamingockSpringBootTestSupport} bean that can be autowired |
| 29 | + * directly in tests.</p> |
31 | 30 | * |
32 | 31 | * <p><strong>Example usage:</strong></p> |
33 | 32 | * <pre>{@code |
34 | 33 | * @FlamingockSpringBootTest(classes = {MyApp.class, TestConfig.class}) |
35 | 34 | * class MyFlamingockTest { |
36 | 35 | * |
37 | 36 | * @Autowired |
38 | | - * private GivenStage givenStage; |
| 37 | + * private FlamingockSpringBootTestSupport flamingockTestSupport; |
39 | 38 | * |
40 | 39 | * @Test |
41 | 40 | * void testMigration() { |
42 | | - * givenStage |
| 41 | + * flamingockTestSupport.givenBuilderFromContext() |
43 | 42 | * .whenRun() |
44 | 43 | * .thenExpectAuditSequenceStrict(APPLIED(MyChange.class)) |
45 | 44 | * .verify(); |
46 | 45 | * } |
47 | 46 | * } |
48 | 47 | * }</pre> |
49 | 48 | * |
50 | | - * <p><strong>Note:</strong> The {@code GivenStage} bean has prototype scope, meaning a new instance |
51 | | - * is created for each injection point. This is necessary because {@code GivenStage} accumulates |
52 | | - * internal state (preconditions, expectations) and is not reusable between tests.</p> |
| 49 | + * <p><strong>Note:</strong> The {@code FlamingockSpringBootTestSupport} bean has prototype scope, |
| 50 | + * meaning a new instance is created for each injection point. This is necessary because the |
| 51 | + * underlying {@code GivenStage} accumulates internal state (preconditions, expectations) and |
| 52 | + * is not reusable between tests.</p> |
53 | 53 | * |
54 | 54 | * @see FlamingockSpringBootTest |
55 | | - * @see FlamingockTestSupport |
56 | | - * @see GivenStage |
| 55 | + * @see FlamingockSpringBootTestSupport |
| 56 | + * @see io.flamingock.support.FlamingockTestSupport |
57 | 57 | * @since 1.0 |
58 | 58 | */ |
59 | 59 | @Configuration |
60 | 60 | public class FlamingockTestAutoConfiguration { |
61 | 61 |
|
62 | 62 | /** |
63 | | - * Creates a {@link GivenStage} bean for Flamingock testing. |
| 63 | + * Creates a {@link FlamingockSpringBootTestSupport} bean for Flamingock testing. |
64 | 64 | * |
65 | 65 | * <p>The bean has prototype scope to ensure each test gets its own fresh instance, |
66 | | - * as {@code GivenStage} accumulates state and cannot be shared between tests.</p> |
| 66 | + * as the underlying {@code GivenStage} accumulates state and cannot be shared between tests.</p> |
67 | 67 | * |
68 | 68 | * @param builderFromContext the Flamingock builder, automatically configured by Spring Boot |
69 | | - * @return a new {@code GivenStage} instance ready for testing |
| 69 | + * @return a new {@code FlamingockSpringBootTestSupport} instance ready for testing |
70 | 70 | */ |
71 | 71 | @Bean |
72 | 72 | @Scope("prototype") |
|
0 commit comments