0

My expected dataset contains several tables. Is it possible to exclude columns from the specific table?

1 Answers1

0

no you can't specify the table, the excluded column will be removed for all tables in the datataset that have such column.

In case you have lots of tables involved it's better to use CONTAINS operation instead of excluding columns in expected dataset.

Consider the following dataset user.yml:

USER:
  - ID: 1
    NAME: "@realpestano"
  - ID: 2
    NAME: "@dbunit"

and expectedUsersContains.yml

 USER:
     NAME: "@dbrider"

And the integration test below:

@Test
@DataSet(value = "user.yml", transactional = true)
@ExpectedDataSet(value = "expectedUsersContains.yml", compareOperation = CompareOperation.CONTAINS)
public void shouldMatchExpectedDataSetContains() {
    User u = new User();
    u.setId(3);
    u.setName("@dbrider");
    em().persist(u);
}
rmpestano
  • 838
  • 1
  • 8
  • 17