This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new 31e2828d0c Feat::Supports JDK 19 build and JUnit testing #10719 
(#10722)
31e2828d0c is described below

commit 31e2828d0c902264eb519eca130912a501a24166
Author: XS <[email protected]>
AuthorDate: Fri Oct 21 10:35:30 2022 +0800

    Feat::Supports JDK 19 build and JUnit testing #10719 (#10722)
    
    * :arrow_up: Upgrade Mockito version
    
    * :pencil2: fix Mockito isNotNull
    
    * Mockito isNull()
    
    * :pencil2: fix Mockito
    
    * :pencil2: Specify byte-buddy version
    
    * :pencil2: fix version number specification
---
 .github/workflows/build-and-test-3.1.yml                  |  6 +++---
 .../apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java |  9 +++++----
 .../dubbo/metadata/report/MetadataReportInstanceTest.java |  3 ++-
 dubbo-spring-boot/pom.xml                                 | 15 ++++++++++++++-
 pom.xml                                                   |  2 +-
 5 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build-and-test-3.1.yml 
b/.github/workflows/build-and-test-3.1.yml
index 94a7fa319b..e9ae3f8c0d 100644
--- a/.github/workflows/build-and-test-3.1.yml
+++ b/.github/workflows/build-and-test-3.1.yml
@@ -83,7 +83,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ ubuntu-20.04, windows-2019 ]
-        jdk: [ 8, 11, 17 ]
+        jdk: [ 8, 11, 17, 19 ]
     env:
       DISABLE_FILE_SYSTEM_TEST: true
       ZOOKEEPER_VERSION: 3.6.3
@@ -135,7 +135,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ ubuntu-20.04, windows-2019 ]
-        jdk: [ 8, 11, 17 ]
+        jdk: [ 8, 11, 17, 19 ]
     env:
       DISABLE_FILE_SYSTEM_TEST: true
     steps:
@@ -170,7 +170,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [ ubuntu-20.04, windows-2019 ]
-        jdk: [ 8, 11, 17 ]
+        jdk: [ 8, 11, 17, 19 ]
     env:
       DISABLE_FILE_SYSTEM_TEST: true
       DUBBO_DEFAULT_SERIALIZATION: fastjson2
diff --git 
a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
 
b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
index 0f2f2ce75b..17d01d9f27 100644
--- 
a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
+++ 
b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
@@ -23,6 +23,7 @@ import org.slf4j.spi.LocationAwareLogger;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.isNotNull;
 import static org.mockito.ArgumentMatchers.isNull;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
@@ -41,8 +42,8 @@ public class Slf4jLoggerTest {
         logger.debug("debug");
         logger.trace("info");
 
-        verify(locationAwareLogger, times(5)).log(isNull(Marker.class), 
anyString(),
-                anyInt(), anyString(), isNull(Object[].class), 
isNull(Throwable.class));
+        verify(locationAwareLogger, times(5)).log(isNull(), anyString(),
+                anyInt(), anyString(), isNull(), isNull());
 
         logger.error(new Exception("error"));
         logger.warn(new Exception("warn"));
@@ -56,7 +57,7 @@ public class Slf4jLoggerTest {
         logger.debug("debug", new Exception("debug"));
         logger.trace("trace", new Exception("trace"));
 
-        verify(locationAwareLogger, times(10)).log(isNull(Marker.class), 
anyString(),
-                anyInt(), anyString(), isNull(Object[].class), 
any(Throwable.class));
+        verify(locationAwareLogger, times(10)).log(isNull(), anyString(),
+                anyInt(), anyString(), isNull(), any(Throwable.class));
     }
 }
diff --git 
a/dubbo-metadata/dubbo-metadata-api/src/test/java/org/apache/dubbo/metadata/report/MetadataReportInstanceTest.java
 
b/dubbo-metadata/dubbo-metadata-api/src/test/java/org/apache/dubbo/metadata/report/MetadataReportInstanceTest.java
index 703b3d9955..1e8f7e6c4a 100644
--- 
a/dubbo-metadata/dubbo-metadata-api/src/test/java/org/apache/dubbo/metadata/report/MetadataReportInstanceTest.java
+++ 
b/dubbo-metadata/dubbo-metadata-api/src/test/java/org/apache/dubbo/metadata/report/MetadataReportInstanceTest.java
@@ -62,6 +62,7 @@ class MetadataReportInstanceTest {
 
         
when(configManager.getMetadataConfigs()).thenReturn(Collections.emptyList());
         
when(applicationModel.getApplicationConfigManager()).thenReturn(configManager);
+        
when(applicationModel.getApplicationConfigManager().getApplicationOrElseThrow()).thenReturn(new
 ApplicationConfig("test"));
         when(applicationModel.getCurrentConfig()).thenReturn(new 
ApplicationConfig("test"));
 
     }
@@ -71,7 +72,7 @@ class MetadataReportInstanceTest {
         
Assertions.assertNull(metadataReportInstance.getMetadataReport(registryId), 
"the metadata report was not initialized.");
         assertThat(metadataReportInstance.getMetadataReports(true), 
Matchers.anEmptyMap());
 
-        metadataReportInstance.init(Arrays.asList(metadataReportConfig));
+        
metadataReportInstance.init(Collections.singletonList(metadataReportConfig));
         MetadataReport metadataReport = 
metadataReportInstance.getMetadataReport(registryId);
         Assertions.assertNotNull(metadataReport);
 
diff --git a/dubbo-spring-boot/pom.xml b/dubbo-spring-boot/pom.xml
index 94505500b4..867a2dcc2d 100644
--- a/dubbo-spring-boot/pom.xml
+++ b/dubbo-spring-boot/pom.xml
@@ -43,6 +43,8 @@
         <dubbo.version>${revision}</dubbo.version>
         <!-- Fix the bug of log4j 
refer:https://github.com/apache/logging-log4j2/pull/608 -->
         <log4j2_version>2.17.2</log4j2_version>
+        <!-- Spring boot buddy is lower than the delivery dependency package 
version and can only show the defined dependency version -->
+        <byte-buddy.version>1.12.14</byte-buddy.version>
     </properties>
 
     <dependencyManagement>
@@ -79,7 +81,18 @@
             <version>${junit_jupiter_version}</version>
             <scope>test</scope>
         </dependency>
-
+        <dependency>
+            <groupId>net.bytebuddy</groupId>
+            <artifactId>byte-buddy</artifactId>
+            <version>${byte-buddy.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.bytebuddy</groupId>
+            <artifactId>byte-buddy-agent</artifactId>
+            <version>${byte-buddy.version}</version>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.dubbo</groupId>
             <artifactId>dubbo-test-check</artifactId>
diff --git a/pom.xml b/pom.xml
index 3f70a85a76..61c952d48c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,7 +95,7 @@
         <el_api_version>2.2.4</el_api_version>
         <jaxb_api_version>2.2.7</jaxb_api_version>
         <cglib_version>2.2</cglib_version>
-        <mockito_version>3.12.4</mockito_version>
+        <mockito_version>4.8.0</mockito_version>
         <!-- Build args -->
         <argline>-server -Xms256m -Xmx512m -Dfile.encoding=UTF-8
             -Djava.net.preferIPv4Stack=true -XX:MetaspaceSize=64m 
-XX:MaxMetaspaceSize=128m

Reply via email to