Browse Source

fix_bug: add Exception to ...DaoRemoveByIdWithException...

pull/7145/head
nickAS21 4 years ago
parent
commit
d27b4ecf8a
  1. 8
      application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java

8
application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java

@ -732,12 +732,12 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
assertThat(findRelationsByTo(entityTo)).hasSize(1);
}
protected <T> void entityDaoRemoveByIdWithException (Dao<T> dao) {
BDDMockito.willThrow(new ConstraintViolationException("mock message", new SQLException(), "MOCK_CONSTRAINT"))
.given(dao).removeById(any(), any());
protected <T> void entityDaoRemoveByIdWithException (Dao<T> dao) throws Exception {
BDDMockito.willThrow(new ConstraintViolationException("mock message", new SQLException(), "MOCK_CONSTRAINT"))
.given(dao).removeById(any(), any());
}
protected <T> void afterTestEntityDaoRemoveByIdWithException (Dao<T> dao) {
protected <T> void afterTestEntityDaoRemoveByIdWithException (Dao<T> dao) throws Exception {
BDDMockito.willCallRealMethod().given(dao).removeById(any(), any());
}

Loading…
Cancel
Save