|
1 | 1 | /*
|
2 |
| - * Copyright 2017 the original author or authors. |
| 2 | + * Copyright 2002-2017 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
15 | 15 | */
|
16 | 16 | package org.springframework.web.server.session;
|
17 | 17 |
|
18 |
| -import static org.hamcrest.collection.IsCollectionWithSize.*; |
19 |
| -import static org.hamcrest.core.Is.*; |
20 |
| -import static org.hamcrest.core.IsCollectionContaining.*; |
21 |
| -import static org.junit.Assert.*; |
22 |
| - |
23 | 18 | import java.time.Clock;
|
24 | 19 | import java.time.Duration;
|
25 | 20 | import java.time.Instant;
|
|
29 | 24 | import org.junit.Before;
|
30 | 25 | import org.junit.Test;
|
31 | 26 | import reactor.core.publisher.Mono;
|
| 27 | + |
32 | 28 | import org.springframework.http.codec.ServerCodecConfigurer;
|
33 | 29 | import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
34 | 30 | import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
|
37 | 33 | import org.springframework.web.server.adapter.DefaultServerWebExchange;
|
38 | 34 | import org.springframework.web.server.i18n.AcceptHeaderLocaleContextResolver;
|
39 | 35 |
|
| 36 | +import static org.hamcrest.collection.IsCollectionWithSize.hasSize; |
| 37 | +import static org.hamcrest.core.Is.is; |
| 38 | +import static org.hamcrest.core.IsCollectionContaining.hasItem; |
| 39 | +import static org.junit.Assert.assertEquals; |
| 40 | +import static org.junit.Assert.assertFalse; |
| 41 | +import static org.junit.Assert.assertNotNull; |
| 42 | +import static org.junit.Assert.assertNotSame; |
| 43 | +import static org.junit.Assert.assertNull; |
| 44 | +import static org.junit.Assert.assertThat; |
| 45 | + |
40 | 46 | /**
|
41 |
| - * Tests using {@link HeaderSessionIdResolver}. |
| 47 | + * Tests using {@link HeaderWebSessionIdResolver}. |
42 | 48 | *
|
43 | 49 | * @author Greg Turnquist
|
44 | 50 | */
|
45 |
| -public class HeaderSessionIdResolverTests { |
| 51 | +public class HeaderWebSessionIdResolverTests { |
46 | 52 |
|
47 | 53 | private static final Clock CLOCK = Clock.system(ZoneId.of("GMT"));
|
48 | 54 |
|
49 |
| - private HeaderSessionIdResolver idResolver; |
| 55 | + |
| 56 | + private HeaderWebSessionIdResolver idResolver; |
50 | 57 |
|
51 | 58 | private DefaultWebSessionManager manager;
|
52 | 59 |
|
53 | 60 | private ServerWebExchange exchange;
|
54 | 61 |
|
| 62 | + |
55 | 63 | @Before
|
56 | 64 | public void setUp() {
|
57 |
| - this.idResolver = new HeaderSessionIdResolver(); |
| 65 | + this.idResolver = new HeaderWebSessionIdResolver(); |
58 | 66 | this.manager = new DefaultWebSessionManager();
|
59 | 67 | this.manager.setSessionIdResolver(this.idResolver);
|
60 | 68 |
|
@@ -172,4 +180,5 @@ public void alternateHeaderName() throws Exception {
|
172 | 180 | private DefaultWebSession createDefaultWebSession(UUID sessionId) {
|
173 | 181 | return new DefaultWebSession(() -> sessionId, CLOCK, (s, session) -> Mono.empty(), s -> Mono.empty());
|
174 | 182 | }
|
| 183 | + |
175 | 184 | }
|
0 commit comments