From d27b4ecf8a3de65fe0986586e962439e8b72c613 Mon Sep 17 00:00:00 2001 From: nickAS21 Date: Sat, 27 Aug 2022 08:18:58 +0300 Subject: [PATCH] fix_bug: add Exception to ...DaoRemoveByIdWithException... --- .../thingsboard/server/controller/AbstractWebTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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()); }