diff --git a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java b/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java index 5af9d05659..09c40f263c 100644 --- a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java +++ b/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 void entityDaoRemoveByIdWithException (Dao dao) { - BDDMockito.willThrow(new ConstraintViolationException("mock message", new SQLException(), "MOCK_CONSTRAINT")) - .given(dao).removeById(any(), any()); + protected void entityDaoRemoveByIdWithException (Dao dao) throws Exception { + BDDMockito.willThrow(new ConstraintViolationException("mock message", new SQLException(), "MOCK_CONSTRAINT")) + .given(dao).removeById(any(), any()); } - protected void afterTestEntityDaoRemoveByIdWithException (Dao dao) { + protected void afterTestEntityDaoRemoveByIdWithException (Dao dao) throws Exception { BDDMockito.willCallRealMethod().given(dao).removeById(any(), any()); }