Skip to content

Commit c9e5f99

Browse files
committed
Fix tests according HTTPS for origin urls
1 parent fd30d1b commit c9e5f99

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ subprojects { subproject ->
142142
springSecurityVersion = '5.2.0.BUILD-SNAPSHOT'
143143
springRetryVersion = '1.2.4.RELEASE'
144144
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.0.BUILD-SNAPSHOT'
145-
springWsVersion = '3.0.6.RELEASE'
145+
springWsVersion = '3.0.7.RELEASE'
146146
tomcatVersion = "9.0.16"
147147
xstreamVersion = '1.4.11.1'
148148
}
@@ -301,7 +301,7 @@ subprojects { subproject ->
301301

302302
checkstyle {
303303
configFile = file("$rootDir/src/checkstyle/checkstyle.xml")
304-
toolVersion = "8.17"
304+
toolVersion = "8.18"
305305
}
306306

307307
artifacts {

spring-integration-http/src/test/java/org/springframework/integration/http/inbound/CrossOriginTests-context.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</int-http:inbound-channel-adapter>
3232

3333
<int-http:inbound-channel-adapter path="/customized" supported-methods="GET,POST" channel="nullChannel">
34-
<int-http:cross-origin origin="https://site1.com,http://site2.com"
34+
<int-http:cross-origin origin="https://site1.com,https://site2.com"
3535
allowed-headers="header1, header2"
3636
exposed-headers="header3, header4"
3737
method="DELETE"

spring-integration-http/src/test/java/org/springframework/integration/http/inbound/CrossOriginTests.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
/**
3838
* @author Artem Bilan
39+
*
3940
* @since 4.2
4041
*/
4142
@RunWith(SpringJUnit4ClassRunner.class)
@@ -52,7 +53,7 @@ public class CrossOriginTests {
5253
public void setUp() {
5354
this.request = new MockHttpServletRequest();
5455
this.request.setMethod("GET");
55-
this.request.addHeader(HttpHeaders.ORIGIN, "http://domain.com/");
56+
this.request.addHeader(HttpHeaders.ORIGIN, "https://domain.com/");
5657
}
5758

5859
@Test
@@ -102,7 +103,7 @@ public void customized() throws Exception {
102103
assertThat(config).isNotNull();
103104
assertThat(config.getAllowedMethods().toArray()).isEqualTo(new String[] { "DELETE" });
104105
assertThat(config.getAllowedOrigins().toArray())
105-
.isEqualTo(new String[] { "http://site1.com", "http://site2.com" });
106+
.isEqualTo(new String[] { "https://site1.com", "https://site2.com" });
106107
assertThat(config.getAllowedHeaders().toArray()).isEqualTo(new String[] { "header1", "header2" });
107108
assertThat(config.getExposedHeaders().toArray()).isEqualTo(new String[] { "header3", "header4" });
108109
assertThat(config.getMaxAge()).isEqualTo(new Long(123));
@@ -161,7 +162,7 @@ public void ambiguousProducesPreFlightRequest() throws Exception {
161162
@Test
162163
public void testOptionsHeaderHandling() throws Exception {
163164
MockHttpServletRequest request = new MockHttpServletRequest("OPTIONS", "/default");
164-
request.addHeader(HttpHeaders.ORIGIN, "http://domain2.com");
165+
request.addHeader(HttpHeaders.ORIGIN, "https://domain2.com");
165166
HandlerExecutionChain handler = this.handlerMapping.getHandler(request);
166167
assertThat(handler).isNotNull();
167168
Object handlerMethod = handler.getHandler();

spring-integration-websocket/src/test/java/org/springframework/integration/websocket/config/WebSocketParserTests-context.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
handshake-handler="handshakeHandler"
2121
handshake-interceptors="handshakeInterceptor"
2222
decorator-factories="decoratorFactory"
23-
allowed-origins="http://www.foo.com/">
23+
allowed-origins="https://foo.com">
2424
<int-websocket:sockjs client-library-url="https://foo.sock.js"
2525
disconnect-delay="4000"
2626
heartbeat-time="30000"

spring-integration-websocket/src/test/java/org/springframework/integration/websocket/config/WebSocketParserTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void testDefaultInboundChannelAdapterAndServerContainer() {
159159
assertThat(TestUtils.getPropertyValue(this.serverWebSocketContainer, "sendTimeLimit")).isEqualTo(100);
160160
assertThat(TestUtils.getPropertyValue(this.serverWebSocketContainer, "sendBufferSizeLimit")).isEqualTo(100000);
161161
assertThat(TestUtils.getPropertyValue(this.serverWebSocketContainer, "origins", String[].class))
162-
.isEqualTo(new String[] { "http://foo.com" });
162+
.isEqualTo(new String[] { "https://foo.com" });
163163

164164
WebSocketHandlerDecoratorFactory[] decoratorFactories =
165165
TestUtils.getPropertyValue(this.serverWebSocketContainer, "decoratorFactories",

0 commit comments

Comments
 (0)