Replace junit assertThrows w/ AssertJ assertThatExceptionOfType

Signed-off-by: Chris Bono <chris.bono@gmail.com>
This commit is contained in:
Chris Bono
2024-11-20 23:26:15 -06:00
committed by Dave Syer
parent ab55182304
commit f97487c768

View File

@@ -17,7 +17,7 @@
package org.springframework.grpc.autoconfigure.server;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import java.time.Duration;
import java.util.HashMap;
@@ -173,7 +173,7 @@ class GrpcServerPropertiesTests {
Map<String, String> map = new HashMap<>();
map.put("spring.grpc.server.address", "my-server-ip:3130");
map.put("spring.grpc.server.port", "10000");
assertThrows(BindException.class, () -> bindProperties(map));
assertThatExceptionOfType(BindException.class).isThrownBy(() -> bindProperties(map));
}
}