File tree Expand file tree Collapse file tree 3 files changed +27
-13
lines changed
spring-messaging/src/test/java/org/springframework/messaging/simp/user Expand file tree Collapse file tree 3 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 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.
19
19
import java .util .HashSet ;
20
20
import java .util .Set ;
21
21
22
-
22
+ /**
23
+ * @author Rossen Stoyanchev
24
+ */
23
25
public class TestSimpSession implements SimpSession {
24
26
25
- private String id ;
27
+ private final String id ;
26
28
27
29
private TestSimpUser user ;
28
30
29
- private Set <SimpSubscription > subscriptions = new HashSet <>();
31
+ private final Set <SimpSubscription > subscriptions = new HashSet <>();
30
32
31
33
32
34
public TestSimpSession (String id ) {
33
35
this .id = id ;
34
36
}
35
37
38
+
36
39
@ Override
37
40
public String getId () {
38
41
return id ;
@@ -59,6 +62,7 @@ public void addSubscriptions(TestSimpSubscription... subscriptions) {
59
62
}
60
63
}
61
64
65
+
62
66
@ Override
63
67
public boolean equals (Object other ) {
64
68
return (this == other || (other instanceof SimpSession && this .id .equals (((SimpSession ) other ).getId ())));
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 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.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package org .springframework .messaging .simp .user ;
17
16
17
+ package org .springframework .messaging .simp .user ;
18
18
19
19
import org .springframework .util .ObjectUtils ;
20
20
21
+ /**
22
+ * @author Rossen Stoyanchev
23
+ */
21
24
public class TestSimpSubscription implements SimpSubscription {
22
25
23
- private String id ;
26
+ private final String destination ;
24
27
25
- private TestSimpSession session ;
28
+ private final String id ;
26
29
27
- private String destination ;
30
+ private TestSimpSession session ;
28
31
29
32
30
33
public TestSimpSubscription (String id , String destination ) {
31
34
this .destination = destination ;
32
35
this .id = id ;
33
36
}
34
37
38
+
35
39
@ Override
36
40
public String getId () {
37
41
return id ;
@@ -51,6 +55,7 @@ public String getDestination() {
51
55
return destination ;
52
56
}
53
57
58
+
54
59
@ Override
55
60
public boolean equals (Object other ) {
56
61
if (this == other ) {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 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.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
+
16
17
package org .springframework .messaging .simp .user ;
17
18
18
19
import java .util .HashMap ;
19
20
import java .util .HashSet ;
20
21
import java .util .Map ;
21
22
import java .util .Set ;
22
23
23
-
24
+ /**
25
+ * @author Rossen Stoyanchev
26
+ */
24
27
public class TestSimpUser implements SimpUser {
25
28
26
- private String name ;
29
+ private final String name ;
27
30
28
- private Map <String , SimpSession > sessions = new HashMap <>();
31
+ private final Map <String , SimpSession > sessions = new HashMap <>();
29
32
30
33
31
34
public TestSimpUser (String name ) {
32
35
this .name = name ;
33
36
}
34
37
38
+
35
39
@ Override
36
40
public String getName () {
37
41
return name ;
@@ -59,6 +63,7 @@ public void addSessions(TestSimpSession... sessions) {
59
63
}
60
64
}
61
65
66
+
62
67
@ Override
63
68
public boolean equals (Object other ) {
64
69
return (this == other || (other instanceof SimpUser && this .name .equals (((SimpUser ) other ).getName ())));
You can’t perform that action at this time.
0 commit comments