From 33bd8bce82055745f7ba4ddbb5d81525d20c2ca8 Mon Sep 17 00:00:00 2001 From: Josh Cummings <3627351+jzheaux@users.noreply.github.com> Date: Thu, 3 Apr 2025 16:51:53 -0600 Subject: [PATCH] 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 --- .../ldap/test/unboundid/EmbeddedLdapServer.java | 2 +- .../ldap/test/unboundid/EmbeddedLdapServerTests.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test-support/src/main/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServer.java b/test-support/src/main/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServer.java index 94379ae4..06d3baeb 100644 --- a/test-support/src/main/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServer.java +++ b/test-support/src/main/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServer.java @@ -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) diff --git a/test-support/src/test/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServerTests.java b/test-support/src/test/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServerTests.java index 3b1a176a..1e2e5dfd 100644 --- a/test-support/src/test/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServerTests.java +++ b/test-support/src/test/java/org/springframework/ldap/test/unboundid/EmbeddedLdapServerTests.java @@ -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); }