Restore Missing Exception

In order to remain binary compatible, we cannot remove checked exceptions
from signatures. And since this method is deprecated anyway, there is little
to be gained from changing its signature.

Issue gh-938
This commit is contained in:
Josh Cummings
2025-04-03 16:51:53 -06:00
parent 553b5edd51
commit 33bd8bce82
2 changed files with 4 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ public final class EmbeddedLdapServer implements AutoCloseable {
*/
@Deprecated(since = "3.3")
public static EmbeddedLdapServer newEmbeddedServer(String defaultPartitionName, String defaultPartitionSuffix,
int port) {
int port) throws Exception {
EmbeddedLdapServer server = EmbeddedLdapServer.withPartitionSuffix(defaultPartitionSuffix)
.partitionName(defaultPartitionName)
.port(port)

View File

@@ -49,7 +49,7 @@ public class EmbeddedLdapServerTests {
}
@Test
public void shouldStartAndCloseServer() {
public void shouldStartAndCloseServer() throws Exception {
assertPortIsFree(this.port);
EmbeddedLdapServer server = EmbeddedLdapServer.newEmbeddedServer("jayway", "dc=jayway,dc=se", this.port);
@@ -60,7 +60,7 @@ public class EmbeddedLdapServerTests {
}
@Test
public void shouldStartAndAutoCloseServer() {
public void shouldStartAndAutoCloseServer() throws Exception {
assertPortIsFree(this.port);
try (EmbeddedLdapServer ignored = EmbeddedLdapServer.newEmbeddedServer("jayway", "dc=jayway,dc=se",
@@ -82,7 +82,7 @@ public class EmbeddedLdapServerTests {
}
@Test
public void startWhenNewEmbeddedServerThenException() {
public void startWhenNewEmbeddedServerThenException() throws Exception {
EmbeddedLdapServer server = EmbeddedLdapServer.newEmbeddedServer("jayway", "dc=jayway,dc=se", this.port);
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(server::start);
}