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

Two boolean parameters with the same value in @DataProvider are not recognized properly #104

Closed
nikowitt opened this issue Aug 24, 2015 · 2 comments
Assignees
Milestone

Comments

@nikowitt
Copy link
Contributor

Given the following test

@Test
@DataProvider({
        "true, true"
        "false, false"
})
public void validate_read_access_for_supplier_contact(
        boolean isSupplierAuditForHisCompany, boolean success) throws Exception {
    given().supplier_audit_which_$_for_company_of_supplier_contact(isSupplierAuditForHisCompany)
            .and().logged_in_user(SumaDatabasePopulation.USER_SUPPLIER_CONTACT);
    when().user_tries_to_read_supplier_audit();
    then().check_that_object_$_exist_afterwards(success);
}

creates the following report:

Scenario: validate read access for supplier contact

Given supplier audit which <arg0> for company of supplier contact
And logged in user suma.contact
When user tries to read supplier audit
Then check that object <arg0> exist afterwards

Cases:

| # | arg0   | Status  |
+---+--------+---------+
| 1 | is     | Success |
| 2 | is not | Success |

Even though the parameters 0 and 1 are the same, I expect arg0 and arg1 to occur since these two parameters are formatted differently.

What I expect:

Scenario: validate read access for supplier contact

Given supplier audit which <arg0> for company of supplier contact
And logged in user suma.contact
When user tries to read supplier audit
Then check that object <arg1> exist afterwards

Cases:

| # | arg0   | arg1     | Status  |
+---+--------+----------+---------+
| 1 | is     | does     | Success |
| 2 | is not | does not | Success |
@janschaefer
Copy link
Contributor

That is definitely a bug. Thanks for reporting. Btw. if you compile your test classes with the -parameters option of javac, you will get better placeholder names.

@janschaefer janschaefer added this to the 0.8.1 milestone Aug 25, 2015
@janschaefer janschaefer self-assigned this Aug 25, 2015
@janschaefer
Copy link
Contributor

Corresponding scenario: http://jgiven.org/jgiven-report/html5/#/tag/Issue/%23104

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

No branches or pull requests

2 participants