org.dbunit.dataset.NoSuchTableException: users
Opened this issue · 0 comments
arthurdn commented
org.dbunit.dataset.NoSuchTableException: users
My test based on com.github.springtestdbunit:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestDataConfiguration.class})
@TestExecutionListeners({DependencyInjectionTestExecutionListener.class,
DirtiesContextTestExecutionListener.class,
TransactionalTestExecutionListener.class,
DbUnitTestExecutionListener.class})
public class OrderServiceTest {//...
@Test
@Rollback
@DirtiesContext
@DatabaseSetup(value = "/db.unit/beforeSaveOrder.xml")
@ExpectedDatabase(assertionMode = NON_STRICT, value = "/db.unit/afterSaveOrder.xml")
public void save() {/****/};}
Here is hibernate.hbm2ddl.auto property from spring boot app:
hibernate.hbm2ddl.auto=create-drop
User class:
@Data
@Entity
@Where(clause = BaseConstants.BASE_MODEL_CONDITION)
@Table(name = "users", schema = BaseConstants.SCHEMA)
public class User extends BaseModel implements Serializable {/****/}
How to fix this?
Works in not test env.