Skip to content

Commit 7f12730

Browse files
committed
Polishing
1 parent 1521094 commit 7f12730

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.
@@ -19,20 +19,23 @@
1919
import java.util.HashSet;
2020
import java.util.Set;
2121

22-
22+
/**
23+
* @author Rossen Stoyanchev
24+
*/
2325
public 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())));

spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.
@@ -13,25 +13,29 @@
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

1919
import org.springframework.util.ObjectUtils;
2020

21+
/**
22+
* @author Rossen Stoyanchev
23+
*/
2124
public 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) {

spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.
@@ -13,25 +13,29 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
package org.springframework.messaging.simp.user;
1718

1819
import java.util.HashMap;
1920
import java.util.HashSet;
2021
import java.util.Map;
2122
import java.util.Set;
2223

23-
24+
/**
25+
* @author Rossen Stoyanchev
26+
*/
2427
public 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())));

0 commit comments

Comments
 (0)