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 11/*
2- * Copyright 2002-2016 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1919import java .util .HashSet ;
2020import java .util .Set ;
2121
22-
22+ /**
23+ * @author Rossen Stoyanchev
24+ */
2325public class TestSimpSession implements SimpSession {
2426
25- private String id ;
27+ private final String id ;
2628
2729 private TestSimpUser user ;
2830
29- private Set <SimpSubscription > subscriptions = new HashSet <>();
31+ private final Set <SimpSubscription > subscriptions = new HashSet <>();
3032
3133
3234 public TestSimpSession (String id ) {
3335 this .id = id ;
3436 }
3537
38+
3639 @ Override
3740 public String getId () {
3841 return id ;
@@ -59,6 +62,7 @@ public void addSubscriptions(TestSimpSubscription... subscriptions) {
5962 }
6063 }
6164
65+
6266 @ Override
6367 public boolean equals (Object other ) {
6468 return (this == other || (other instanceof SimpSession && this .id .equals (((SimpSession ) other ).getId ())));
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2016 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- package org .springframework .messaging .simp .user ;
1716
17+ package org .springframework .messaging .simp .user ;
1818
1919import org .springframework .util .ObjectUtils ;
2020
21+ /**
22+ * @author Rossen Stoyanchev
23+ */
2124public class TestSimpSubscription implements SimpSubscription {
2225
23- private String id ;
26+ private final String destination ;
2427
25- private TestSimpSession session ;
28+ private final String id ;
2629
27- private String destination ;
30+ private TestSimpSession session ;
2831
2932
3033 public TestSimpSubscription (String id , String destination ) {
3134 this .destination = destination ;
3235 this .id = id ;
3336 }
3437
38+
3539 @ Override
3640 public String getId () {
3741 return id ;
@@ -51,6 +55,7 @@ public String getDestination() {
5155 return destination ;
5256 }
5357
58+
5459 @ Override
5560 public boolean equals (Object other ) {
5661 if (this == other ) {
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2015 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16+
1617package org .springframework .messaging .simp .user ;
1718
1819import java .util .HashMap ;
1920import java .util .HashSet ;
2021import java .util .Map ;
2122import java .util .Set ;
2223
23-
24+ /**
25+ * @author Rossen Stoyanchev
26+ */
2427public class TestSimpUser implements SimpUser {
2528
26- private String name ;
29+ private final String name ;
2730
28- private Map <String , SimpSession > sessions = new HashMap <>();
31+ private final Map <String , SimpSession > sessions = new HashMap <>();
2932
3033
3134 public TestSimpUser (String name ) {
3235 this .name = name ;
3336 }
3437
38+
3539 @ Override
3640 public String getName () {
3741 return name ;
@@ -59,6 +63,7 @@ public void addSessions(TestSimpSession... sessions) {
5963 }
6064 }
6165
66+
6267 @ Override
6368 public boolean equals (Object other ) {
6469 return (this == other || (other instanceof SimpUser && this .name .equals (((SimpUser ) other ).getName ())));
You can’t perform that action at this time.
0 commit comments