Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Spock.DbUnit content for each case in one Specification #2

Closed
arthurdn opened this issue May 21, 2016 · 1 comment
Closed

Comments

@arthurdn
Copy link

Content is called for all cases.

How specify it for each case?

    @DbUnit def content =  {
       CATEGORY(CATEGORY_ID: 1L, CATEGORY_NAME: "N", CATEGORY_IMAGE:"I")
    }
@janbols
Copy link
Owner

janbols commented May 22, 2016

Hi @arthurdn , indeed, this is currently not foreseen. However, it shouldn't be too difficult to add this.

How would you see this happening? Add a @dbunit annotation above the feature containing a content field with the closure? Like in the following...

    @DbUnit(content = {
        User(id: 1, name: 'janbols')
    })
    def "test"() {
        when:
        def result = new Sql(dataSource).firstRow("select * from User where name = 'janbols'")
        then:
        result.id == 1
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants