This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 16cd6336d [type:Fixbug]springmvc example register error (#3277)
16cd6336d is described below
commit 16cd6336d7f6ade0f2d3564161dd006d9af8a482
Author: likeguo <[email protected]>
AuthorDate: Tue Apr 19 10:45:18 2022 +0800
[type:Fixbug]springmvc example register error (#3277)
* springmvc example register error
* springmvc example register error
* edit auth error
* edit auth error
---
.../java/org/apache/shenyu/admin/model/dto/AuthPathWarpDTO.java | 4 ++--
.../org/apache/shenyu/admin/controller/AppAuthControllerTest.java | 4 ++--
.../src/main/resources/context/shenyu.xml | 8 +++++++-
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/AuthPathWarpDTO.java
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/AuthPathWarpDTO.java
index 4b744391c..2cc52c601 100644
---
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/AuthPathWarpDTO.java
+++
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/model/dto/AuthPathWarpDTO.java
@@ -17,7 +17,7 @@
package org.apache.shenyu.admin.model.dto;
-import org.apache.shenyu.admin.mapper.AuthPathMapper;
+import org.apache.shenyu.admin.mapper.AppAuthMapper;
import org.apache.shenyu.admin.validation.annotation.Existed;
import javax.validation.constraints.NotEmpty;
@@ -32,7 +32,7 @@ public class AuthPathWarpDTO implements Serializable {
private static final long serialVersionUID = -3167442906221294444L;
- @Existed(message = "app key not existed", provider = AuthPathMapper.class)
+ @Existed(message = "app key not existed", provider = AppAuthMapper.class)
private String id;
@NotEmpty(message = "auth path is not empty")
diff --git
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/AppAuthControllerTest.java
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/AppAuthControllerTest.java
index 22652061e..43c639691 100644
---
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/AppAuthControllerTest.java
+++
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/controller/AppAuthControllerTest.java
@@ -228,8 +228,8 @@ public final class AppAuthControllerTest {
authPathWarpDTO.setAuthPathDTOList(authPathDTOS);
ConfigurableApplicationContext context =
mock(ConfigurableApplicationContext.class);
SpringBeanUtils.getInstance().setApplicationContext(context);
-
when(SpringBeanUtils.getInstance().getBean(AuthPathMapper.class)).thenReturn(authPathMapper);
- when(authPathMapper.existed(authPathWarpDTO.getId())).thenReturn(true);
+
when(SpringBeanUtils.getInstance().getBean(AppAuthMapper.class)).thenReturn(appAuthMapper);
+ when(appAuthMapper.existed(authPathWarpDTO.getId())).thenReturn(true);
given(this.appAuthService.updateDetailPath(authPathWarpDTO)).willReturn(ShenyuAdminResult.success());
this.mockMvc.perform(MockMvcRequestBuilders.post("/appAuth/updateDetailPath")
.contentType(MediaType.APPLICATION_JSON)
diff --git
a/shenyu-examples/shenyu-examples-springmvc/src/main/resources/context/shenyu.xml
b/shenyu-examples/shenyu-examples-springmvc/src/main/resources/context/shenyu.xml
index 479776eed..161879207 100644
---
a/shenyu-examples/shenyu-examples-springmvc/src/main/resources/context/shenyu.xml
+++
b/shenyu-examples/shenyu-examples-springmvc/src/main/resources/context/shenyu.xml
@@ -29,6 +29,12 @@
<bean id="shenyuRegisterCenterConfig"
class="org.apache.shenyu.register.common.config.ShenyuRegisterCenterConfig">
<property name="registerType" value="http"/>
<property name="serverLists" value="http://localhost:9095"/>
+ <property name="props">
+ <map>
+ <entry key="username" value="admin"/>
+ <entry key="password" value="123456"/>
+ </map>
+ </property>
</bean>
<!-- ClientPropertiesConfig -->
@@ -57,4 +63,4 @@
<bean id="contextRegisterListener"
class="org.apache.shenyu.client.springmvc.init.ContextRegisterListener">
<constructor-arg ref="clientPropertiesConfig"/>
</bean>
-</beans>
\ No newline at end of file
+</beans>