GH-2760: use assertThatExceptionOfType in tests
Fixes https://github.com/spring-projects/spring-integration/issues/2760 * The `assertThatExceptionOfType()` is more convenient, than `assertThatThrownBy`, so, replace all the usages accordingly * Fix JavaDoc typo in the `AbstractScriptExecutingMessageProcessor` * Fix Sonar smells for `throws Exception` in `AbstractScriptExecutingMessageProcessor` hierarchy and some code polishing for them
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.redis.util;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -347,9 +347,9 @@ public class RedisLockRegistryTests extends RedisAvailableTests {
|
||||
Lock lock1 = registry.obtain("foo");
|
||||
assertThat(lock1.tryLock()).isTrue();
|
||||
waitForExpire("foo");
|
||||
assertThatThrownBy(lock1::unlock)
|
||||
.isInstanceOf(IllegalStateException.class)
|
||||
.hasMessageContaining("Lock was released in the store due to expiration.");
|
||||
assertThatIllegalStateException()
|
||||
.isThrownBy(lock1::unlock)
|
||||
.withMessageContaining("Lock was released in the store due to expiration.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user