diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java index 4ab378ad8f6..4138ce54b25 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,23 @@ package org.springframework.messaging.simp.user; import java.util.HashSet; import java.util.Set; - +/** + * @author Rossen Stoyanchev + */ public class TestSimpSession implements SimpSession { - private String id; + private final String id; private TestSimpUser user; - private Set subscriptions = new HashSet<>(); + private final Set subscriptions = new HashSet<>(); public TestSimpSession(String id) { this.id = id; } + @Override public String getId() { return id; @@ -59,6 +62,7 @@ public class TestSimpSession implements SimpSession { } } + @Override public boolean equals(Object other) { return (this == other || (other instanceof SimpSession && this.id.equals(((SimpSession) other).getId()))); diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java index 5a13c234535..94a0e0d4b61 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,18 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.messaging.simp.user; +package org.springframework.messaging.simp.user; import org.springframework.util.ObjectUtils; +/** + * @author Rossen Stoyanchev + */ public class TestSimpSubscription implements SimpSubscription { - private String id; + private final String destination; - private TestSimpSession session; + private final String id; - private String destination; + private TestSimpSession session; public TestSimpSubscription(String id, String destination) { @@ -32,6 +35,7 @@ public class TestSimpSubscription implements SimpSubscription { this.id = id; } + @Override public String getId() { return id; @@ -51,6 +55,7 @@ public class TestSimpSubscription implements SimpSubscription { return destination; } + @Override public boolean equals(Object other) { if (this == other) { diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java index 1607c20197d..eff57f97dc8 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/user/TestSimpUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.messaging.simp.user; import java.util.HashMap; @@ -20,18 +21,21 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; - +/** + * @author Rossen Stoyanchev + */ public class TestSimpUser implements SimpUser { - private String name; + private final String name; - private Map sessions = new HashMap<>(); + private final Map sessions = new HashMap<>(); public TestSimpUser(String name) { this.name = name; } + @Override public String getName() { return name; @@ -59,6 +63,7 @@ public class TestSimpUser implements SimpUser { } } + @Override public boolean equals(Object other) { return (this == other || (other instanceof SimpUser && this.name.equals(((SimpUser) other).getName())));