Skip to content

DBRider support #624

@Jenson3210

Description

@Jenson3210

What problem are you trying to solve?

Internally, we're using dbrider for integration test that assert db state. It's an extension on top of dbunit that allows for csv datasource annotations on top of test cases.
Between junit4 and 5, there are some changes to the usage.
We could try and create support for this.

Describe the situation before applying the recipe

@AutoConfigureMockMvc
@ActiveProfiles(INTEGRATION_TEST)
@SpringBootTest
@TestExecutionListeners(mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS, listeners = {DBRiderTestExecutionListener.class})
@DBUnit(mergeDataSets = true, mergingStrategy = DataSetMergingStrategy.CLASS)
@DataSet(cleanBefore = true, cleanAfter = true, value = "")
public abstract class AbstractIntegrationTest {
    ...
}

Describe the situation after applying the recipe

@AutoConfigureMockMvc
@ActiveProfiles(INTEGRATION_TEST)
@SpringBootTest
@DBRider
@DBUnit(mergeDataSets = true, mergingStrategy = DataSetMergingStrategy.CLASS)
@DataSet(cleanBefore = true, cleanAfter = true, value = "")
public abstract class AbstractIntegrationTest {
    ...
}

Have you considered any alternatives or workarounds?

Manual changes? 🤢

Any additional context

see docs on dbrider here

Are you interested in contributing this recipe to OpenRewrite?

I will try to come up with certain aspects, but additional support is always welcome as this is completely greenfielded topic from open rewrite perspective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    recipeRecipe request

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions