org.dbunit.dataset.NoSuchTableException:用户
我的测试基于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() {/****/};}
这是Spring Boot应用程序中的hibernate.hbm2ddl.auto属性:
hibernate.hbm2ddl.auto=create-drop
用户类别:
@Data
@Entity
@Where(clause = BaseConstants.BASE_MODEL_CONDITION)
@Table(name = "users", schema = BaseConstants.SCHEMA)
public class User extends BaseModel implements Serializable {/****/}
该如何解决?
可在非测试环境中使用。