Skip to content

Commit 1b45323

Browse files
committed
[feat] shenyu java client
1 parent 37a6c01 commit 1b45323

File tree

16 files changed

+59
-69
lines changed

16 files changed

+59
-69
lines changed

shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/dto/URIRegisterDTO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public class URIRegisterDTO implements DataTypeParent {
5555
* @param host the host
5656
* @param port the port
5757
* @param eventType the event type
58+
* @param namespaceId the namespace id
5859
*/
5960
public URIRegisterDTO(final String protocol, final String appName, final String contextPath,
6061
final String rpcType, final String host, final Integer port,

shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/utils/PortUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class PortUtils {
4343
*
4444
* @param beanFactory beanFactory
4545
* @return port number
46-
* @throws ShenyuException when can not find port
46+
* @throws RuntimeException when failed to get port
4747
*/
4848
@SuppressWarnings("all")
4949
public static int findPort(final BeanFactory beanFactory) {

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/pom.xml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
2626
<artifactId>shenyu-client-apache-dubbo</artifactId>
27-
27+
2828
<dependencies>
2929
<dependency>
3030
<groupId>org.apache.shenyu</groupId>
@@ -35,6 +35,7 @@
3535
<groupId>org.apache.dubbo</groupId>
3636
<artifactId>dubbo</artifactId>
3737
<version>${apache.dubbo.version}</version>
38+
<scope>provided</scope>
3839
</dependency>
3940
<dependency>
4041
<groupId>org.springframework</groupId>
@@ -52,32 +53,21 @@
5253
<scope>provided</scope>
5354
</dependency>
5455
<dependency>
55-
<groupId>jakarta.validation</groupId>
56-
<artifactId>jakarta.validation-api</artifactId>
56+
<groupId>javax.validation</groupId>
57+
<artifactId>validation-api</artifactId>
5758
<scope>provided</scope>
5859
</dependency>
5960
<dependency>
6061
<groupId>org.hibernate</groupId>
6162
<artifactId>hibernate-validator</artifactId>
62-
<version>8.0.1.Final</version>
63+
<version>5.2.5.Final</version>
6364
<scope>test</scope>
6465
</dependency>
6566
<dependency>
66-
<groupId>jakarta.el</groupId>
67-
<artifactId>jakarta.el-api</artifactId>
68-
<version>6.0.0</version>
67+
<groupId>javax.el</groupId>
68+
<artifactId>el-api</artifactId>
69+
<version>2.2</version>
6970
<scope>test</scope>
7071
</dependency>
71-
<dependency>
72-
<groupId>org.apache.tomcat.embed</groupId>
73-
<artifactId>tomcat-embed-el</artifactId>
74-
<version>10.1.16</version>
75-
<scope>test</scope>
76-
</dependency>
77-
<dependency>
78-
<groupId>org.apache.tomcat.embed</groupId>
79-
<artifactId>tomcat-embed-websocket</artifactId>
80-
</dependency>
81-
8272
</dependencies>
8373
</project>

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/ApacheDubboClientValidatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.jupiter.api.BeforeEach;
2525
import org.junit.jupiter.api.Test;
2626

27-
import jakarta.validation.ValidationException;
27+
import javax.validation.ValidationException;
2828
import java.util.Collections;
2929
import java.util.HashMap;
3030
import java.util.List;

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/mock/MockConstraint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
package org.apache.shenyu.client.apache.dubbo.validation.mock;
1919

20-
import jakarta.validation.Constraint;
21-
import jakarta.validation.Payload;
20+
import javax.validation.Constraint;
21+
import javax.validation.Payload;
2222
import java.lang.annotation.Documented;
2323
import java.lang.annotation.Retention;
2424
import java.lang.annotation.RetentionPolicy;

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/mock/MockConstraintValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
package org.apache.shenyu.client.apache.dubbo.validation.mock;
1919

20-
import jakarta.validation.ConstraintValidator;
21-
import jakarta.validation.ConstraintValidatorContext;
20+
import javax.validation.ConstraintValidator;
21+
import javax.validation.ConstraintValidatorContext;
2222

2323
/**
2424
* MockConstraintValidator.

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/mock/MockValidationParameter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.shenyu.client.apache.dubbo.validation.mock;
1919

20-
import jakarta.validation.constraints.NotNull;
20+
import javax.validation.constraints.NotNull;
2121

2222
/**
2323
* MockValidationParameter.

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/mock/MockValidatorTarget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.apache.dubbo.validation.MethodValidated;
2121

22-
import jakarta.validation.constraints.NotNull;
22+
import javax.validation.constraints.NotNull;
2323
import java.util.List;
2424
import java.util.Map;
2525

shenyu-client/shenyu-client-dubbo/shenyu-client-apache-dubbo/src/test/java/org/apache/shenyu/client/apache/dubbo/validation/service/TestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.shenyu.client.apache.dubbo.validation.service;
1919

20-
import jakarta.validation.constraints.NotNull;
20+
import javax.validation.constraints.NotNull;
2121
import java.util.Objects;
2222

2323
/**

shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/test/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListenerTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919

2020
import org.apache.shenyu.client.core.constant.ShenyuClientConstants;
2121
import org.apache.shenyu.client.core.exception.ShenyuClientIllegalArgumentException;
22+
import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepository;
2223
import org.apache.shenyu.client.core.register.ShenyuClientRegisterRepositoryFactory;
24+
import org.apache.shenyu.client.core.register.config.ShenyuClientConfig;
25+
import org.apache.shenyu.client.core.register.config.ShenyuClientConfig.ClientPropertiesConfig;
26+
import org.apache.shenyu.client.core.register.config.ShenyuRegisterCenterConfig;
27+
import org.apache.shenyu.client.core.utils.RegisterUtils;
2328
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
24-
import org.apache.shenyu.common.exception.ShenyuException;
2529
import org.apache.shenyu.client.core.utils.PortUtils;
26-
import org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository;
27-
import org.apache.shenyu.register.client.http.utils.RegisterUtils;
28-
import org.apache.shenyu.register.common.config.ShenyuClientConfig;
29-
import org.apache.shenyu.register.common.config.ShenyuClientConfig.ClientPropertiesConfig;
30-
import org.apache.shenyu.register.common.config.ShenyuRegisterCenterConfig;
3130
import org.junit.Assert;
3231
import org.junit.jupiter.api.Assertions;
3332
import org.junit.jupiter.api.Test;
@@ -174,7 +173,7 @@ public void testOnApplicationEvent() {
174173
public void testOnApplicationEventError() {
175174
init();
176175
SpringMvcClientEventListener springMvcClientEventListener = buildSpringMvcClientEventListener(false, false);
177-
Assert.assertThrows(ShenyuException.class, () -> springMvcClientEventListener.onApplicationEvent(contextRefreshedEvent));
176+
Assert.assertThrows(RuntimeException.class, () -> springMvcClientEventListener.onApplicationEvent(contextRefreshedEvent));
178177
registerUtilsMockedStatic.close();
179178
}
180179

0 commit comments

Comments
 (0)