@Test
    void testActiveLocalPort() throws Exception {
        final Server server = Server.builder()
                                    .http(0)
                                    .https(0)
                                    .tlsSelfSigned()
                                    .service("/", (ctx, res) -> HttpResponse.of(""))
                                    .build();

        // not started yet
        assertThatThrownBy(server::activeLocalPort)
                .isInstanceOf(IllegalStateException.class)
                .hasMessageContaining("no active local ports");

        server.start().get();

        assertThat(server.activeLocalPort()).isPositive();
        assertThat(server.activeLocalPort(SessionProtocol.HTTP)).isPositive();
        assertThat(server.activeLocalPort(SessionProtocol.HTTPS)).isPositive();
        assertThatThrownBy(() -> server.activeLocalPort(SessionProtocol.PROXY))
                .isInstanceOf(IllegalStateException.class)
                .hasMessageContaining("no active local ports for " + SessionProtocol.PROXY);
    }
Ensure that the connection is not broken even if {@link Service#serve(ServiceRequestContext, Request)}
raises an exception.
core/src/test/java/com/linecorp/armeria/server/ServerTest.java