Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
带水的鱼儿
spring-framework
提交
f0f450a1
S
spring-framework
项目概览
带水的鱼儿
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f0f450a1
编写于
6月 07, 2021
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
f854803e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
25 deletion
+19
-25
spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java
...ingframework/beans/factory/config/YamlProcessorTests.java
+1
-0
spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
...ingframework/jms/connection/CachingConnectionFactory.java
+1
-0
spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/Jetty10WebSocketHandlerAdapter.java
...active/socket/adapter/Jetty10WebSocketHandlerAdapter.java
+3
-4
spring-webmvc/src/test/java/org/springframework/web/servlet/function/SseServerResponseTests.java
...ramework/web/servlet/function/SseServerResponseTests.java
+4
-4
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/PrincipalMethodArgumentResolverTests.java
...thod/annotation/PrincipalMethodArgumentResolverTests.java
+9
-17
spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderTests.java
...mework/web/servlet/resource/ResourceUrlProviderTests.java
+1
-0
未找到文件。
spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java
浏览文件 @
f0f450a1
...
@@ -141,6 +141,7 @@ class YamlProcessorTests {
...
@@ -141,6 +141,7 @@ class YamlProcessorTests {
}
}
@Test
@Test
@SuppressWarnings
(
"unchecked"
)
void
standardTypesSupportedByDefault
()
throws
Exception
{
void
standardTypesSupportedByDefault
()
throws
Exception
{
setYaml
(
"value: !!set\n ? first\n ? second"
);
setYaml
(
"value: !!set\n ? first\n ? second"
);
this
.
processor
.
process
((
properties
,
map
)
->
{
this
.
processor
.
process
((
properties
,
map
)
->
{
...
...
spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
浏览文件 @
f0f450a1
...
@@ -423,6 +423,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
...
@@ -423,6 +423,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
return
new
CachedMessageProducer
(
producer
);
return
new
CachedMessageProducer
(
producer
);
}
}
@SuppressWarnings
(
"resource"
)
private
MessageConsumer
getCachedConsumer
(
Destination
dest
,
@Nullable
String
selector
,
private
MessageConsumer
getCachedConsumer
(
Destination
dest
,
@Nullable
String
selector
,
@Nullable
Boolean
noLocal
,
@Nullable
String
subscription
,
boolean
durable
)
throws
JMSException
{
@Nullable
Boolean
noLocal
,
@Nullable
String
subscription
,
boolean
durable
)
throws
JMSException
{
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/Jetty10WebSocketHandlerAdapter.java
浏览文件 @
f0f450a1
...
@@ -48,9 +48,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
...
@@ -48,9 +48,6 @@ import org.springframework.web.reactive.socket.WebSocketSession;
@WebSocket
@WebSocket
public
class
Jetty10WebSocketHandlerAdapter
{
public
class
Jetty10WebSocketHandlerAdapter
{
private
static
final
ByteBuffer
EMPTY_PAYLOAD
=
ByteBuffer
.
wrap
(
new
byte
[
0
]);
private
final
WebSocketHandler
delegateHandler
;
private
final
WebSocketHandler
delegateHandler
;
private
final
Function
<
Session
,
JettyWebSocketSession
>
sessionFactory
;
private
final
Function
<
Session
,
JettyWebSocketSession
>
sessionFactory
;
...
@@ -97,7 +94,9 @@ public class Jetty10WebSocketHandlerAdapter {
...
@@ -97,7 +94,9 @@ public class Jetty10WebSocketHandlerAdapter {
// TODO: onWebSocketFrame can't be declared without compiling against Jetty 10
// TODO: onWebSocketFrame can't be declared without compiling against Jetty 10
// Jetty 10: org.eclipse.jetty.websocket.api.Frame
// Jetty 10: org.eclipse.jetty.websocket.api.Frame
// Jetty 9: org.eclipse.jetty.websocket.api.extensions.Frame
// Jetty 9: org.eclipse.jetty.websocket.api.extensions.Frame
//
// private static final ByteBuffer EMPTY_PAYLOAD = ByteBuffer.wrap(new byte[0]);
//
// @OnWebSocketFrame
// @OnWebSocketFrame
// public void onWebSocketFrame(Frame frame) {
// public void onWebSocketFrame(Frame frame) {
// if (this.delegateSession != null) {
// if (this.delegateSession != null) {
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/function/SseServerResponseTests.java
浏览文件 @
f0f450a1
/*
/*
* Copyright 2002-202
0
the original author or authors.
* Copyright 2002-202
1
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -90,8 +90,7 @@ class SseServerResponseTests {
...
@@ -90,8 +90,7 @@ class SseServerResponseTests {
}
}
@Test
@Test
public
void
builder
()
throws
Exception
{
void
builder
()
throws
Exception
{
String
body
=
"foo bar"
;
ServerResponse
response
=
ServerResponse
.
sse
(
sse
->
{
ServerResponse
response
=
ServerResponse
.
sse
(
sse
->
{
try
{
try
{
sse
.
id
(
"id"
)
sse
.
id
(
"id"
)
...
@@ -132,14 +131,15 @@ class SseServerResponseTests {
...
@@ -132,14 +131,15 @@ class SseServerResponseTests {
this
.
age
=
age
;
this
.
age
=
age
;
}
}
@SuppressWarnings
(
"unused"
)
public
String
getName
()
{
public
String
getName
()
{
return
this
.
name
;
return
this
.
name
;
}
}
@SuppressWarnings
(
"unused"
)
public
int
getAge
()
{
public
int
getAge
()
{
return
this
.
age
;
return
this
.
age
;
}
}
}
}
}
}
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/PrincipalMethodArgumentResolverTests.java
浏览文件 @
f0f450a1
/*
/*
* Copyright 2002-202
0
the original author or authors.
* Copyright 2002-202
1
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.Test;
...
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.Test;
import
org.springframework.core.MethodParameter
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.web.context.request.ServletWebRequest
;
import
org.springframework.web.context.request.ServletWebRequest
;
import
org.springframework.web.method.support.ModelAndViewContainer
;
import
org.springframework.web.testfixture.servlet.MockHttpServletRequest
;
import
org.springframework.web.testfixture.servlet.MockHttpServletRequest
;
import
org.springframework.web.testfixture.servlet.MockHttpServletResponse
;
import
org.springframework.web.testfixture.servlet.MockHttpServletResponse
;
...
@@ -41,32 +40,25 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -41,32 +40,25 @@ import static org.assertj.core.api.Assertions.assertThat;
*
*
* @author Rossen Stoyanchev
* @author Rossen Stoyanchev
*/
*/
public
class
PrincipalMethodArgumentResolverTests
{
class
PrincipalMethodArgumentResolverTests
{
private
PrincipalMethodArgumentResolver
resolver
;
private
PrincipalMethodArgumentResolver
resolver
=
new
PrincipalMethodArgumentResolver
()
;
private
Mo
delAndViewContainer
mavContainer
;
private
Mo
ckHttpServletRequest
servletRequest
=
new
MockHttpServletRequest
(
"GET"
,
""
)
;
private
MockHttpServletRequest
servletRequest
;
private
ServletWebRequest
webRequest
=
new
ServletWebRequest
(
servletRequest
,
new
MockHttpServletResponse
());
private
ServletWebRequest
webRequest
;
private
Method
method
;
private
Method
method
;
@BeforeEach
@BeforeEach
public
void
setup
()
throws
Exception
{
void
setup
()
throws
Exception
{
resolver
=
new
PrincipalMethodArgumentResolver
();
mavContainer
=
new
ModelAndViewContainer
();
servletRequest
=
new
MockHttpServletRequest
(
"GET"
,
""
);
webRequest
=
new
ServletWebRequest
(
servletRequest
,
new
MockHttpServletResponse
());
method
=
getClass
().
getMethod
(
"supportedParams"
,
ServletRequest
.
class
,
Principal
.
class
);
method
=
getClass
().
getMethod
(
"supportedParams"
,
ServletRequest
.
class
,
Principal
.
class
);
}
}
@Test
@Test
public
void
principal
()
throws
Exception
{
void
principal
()
throws
Exception
{
Principal
principal
=
()
->
"Foo"
;
Principal
principal
=
()
->
"Foo"
;
servletRequest
.
setUserPrincipal
(
principal
);
servletRequest
.
setUserPrincipal
(
principal
);
...
@@ -78,7 +70,7 @@ public class PrincipalMethodArgumentResolverTests {
...
@@ -78,7 +70,7 @@ public class PrincipalMethodArgumentResolverTests {
}
}
@Test
@Test
public
void
principalAsNull
()
throws
Exception
{
void
principalAsNull
()
throws
Exception
{
MethodParameter
principalParameter
=
new
MethodParameter
(
method
,
1
);
MethodParameter
principalParameter
=
new
MethodParameter
(
method
,
1
);
assertThat
(
resolver
.
supportsParameter
(
principalParameter
)).
as
(
"Principal not supported"
).
isTrue
();
assertThat
(
resolver
.
supportsParameter
(
principalParameter
)).
as
(
"Principal not supported"
).
isTrue
();
...
@@ -87,7 +79,7 @@ public class PrincipalMethodArgumentResolverTests {
...
@@ -87,7 +79,7 @@ public class PrincipalMethodArgumentResolverTests {
}
}
@Test
// gh-25780
@Test
// gh-25780
public
void
annotatedPrincipal
()
throws
Exception
{
void
annotatedPrincipal
()
throws
Exception
{
Principal
principal
=
()
->
"Foo"
;
Principal
principal
=
()
->
"Foo"
;
servletRequest
.
setUserPrincipal
(
principal
);
servletRequest
.
setUserPrincipal
(
principal
);
Method
principalMethod
=
getClass
().
getMethod
(
"supportedParamsWithAnnotatedPrincipal"
,
Principal
.
class
);
Method
principalMethod
=
getClass
().
getMethod
(
"supportedParamsWithAnnotatedPrincipal"
,
Principal
.
class
);
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/resource/ResourceUrlProviderTests.java
浏览文件 @
f0f450a1
...
@@ -151,6 +151,7 @@ public class ResourceUrlProviderTests {
...
@@ -151,6 +151,7 @@ public class ResourceUrlProviderTests {
}
}
@Test
@Test
@SuppressWarnings
(
"resource"
)
void
initializeOnCurrentContext
()
{
void
initializeOnCurrentContext
()
{
AnnotationConfigWebApplicationContext
parentContext
=
new
AnnotationConfigWebApplicationContext
();
AnnotationConfigWebApplicationContext
parentContext
=
new
AnnotationConfigWebApplicationContext
();
parentContext
.
setServletContext
(
new
MockServletContext
());
parentContext
.
setServletContext
(
new
MockServletContext
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录