diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index bca2005d1..ef59dc8bd 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -21,7 +21,9 @@ jobs: strategy: fail-fast: false matrix: - java: [ '17' ] # We want to test on LTSs. + java: # We want to test on LTSs. + - '17' + - '21' steps: - name: actions/setup-java@v3 (JDK ${{ matrix.java }}) uses: actions/setup-java@v4 diff --git a/clients/line-bot-client-base/src/test/java/com/linecorp/bot/client/base/exception/AbstractLineClientExceptionTest.java b/clients/line-bot-client-base/src/test/java/com/linecorp/bot/client/base/exception/AbstractLineClientExceptionTest.java index 2c8b269ef..a8a273b2a 100644 --- a/clients/line-bot-client-base/src/test/java/com/linecorp/bot/client/base/exception/AbstractLineClientExceptionTest.java +++ b/clients/line-bot-client-base/src/test/java/com/linecorp/bot/client/base/exception/AbstractLineClientExceptionTest.java @@ -20,6 +20,7 @@ import static org.mockito.Mockito.when; import java.io.IOException; +import java.net.URI; import java.net.URL; import java.util.Map; @@ -71,7 +72,7 @@ void constructorNoException() { @Test void getRequestUrl() throws Exception { AbstractLineClientException exception = new AbstractLineClientException(response, "test message"); - assertThat(exception.getRequestUrl()).isEqualTo(new URL("https://example.com/")); + assertThat(exception.getRequestUrl()).isEqualTo(new URI("https://example.com/").toURL()); } @Test diff --git a/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/support/LineMessageHandlerSupport.java b/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/support/LineMessageHandlerSupport.java index 0c58bae46..bb355bcc2 100644 --- a/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/support/LineMessageHandlerSupport.java +++ b/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/support/LineMessageHandlerSupport.java @@ -20,6 +20,8 @@ import java.util.Collection; import java.util.List; +import jakarta.annotation.PostConstruct; + import org.slf4j.Logger; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -69,7 +71,10 @@ public LineMessageHandlerSupport( final ConfigurableApplicationContext applicationContext) { this.returnValueConsumerFactory = returnValueConsumerFactory; this.applicationContext = applicationContext; + } + @PostConstruct + public void initialize() { applicationContext.addApplicationListener(event -> { if (event instanceof ContextRefreshedEvent) { refresh();