This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit bf9c6cd30a6655c186510402f2f7aa656a933be7
Author: Gautier DI FOLCO <gdifo...@linagora.com>
AuthorDate: Tue May 12 15:37:14 2020 +0200

    JAMES-3179 UploadResponse equals
---
 .../james/jmap/draft/model/UploadResponse.java     |  6 ++---
 .../james/jmap/draft/model/UploadResponseTest.java | 31 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UploadResponse.java
 
b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UploadResponse.java
index 9443ed9..6a674e8 100644
--- 
a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UploadResponse.java
+++ 
b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/draft/model/UploadResponse.java
@@ -113,10 +113,10 @@ public class UploadResponse {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public final boolean equals(Object obj) {
         if (obj instanceof UploadResponse) {
             UploadResponse other = (UploadResponse) obj;
-            return Objects.equal(accountId, accountId)
+            return Objects.equal(accountId, other.accountId)
                 && Objects.equal(blobId, other.blobId)
                 && Objects.equal(type, other.type)
                 && Objects.equal(size, other.size)
@@ -126,7 +126,7 @@ public class UploadResponse {
     }
 
     @Override
-    public int hashCode() {
+    public final int hashCode() {
         return Objects.hashCode(accountId, blobId, type, size, expires);
     }
 
diff --git 
a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/UploadResponseTest.java
 
b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/UploadResponseTest.java
new file mode 100644
index 0000000..904f363
--- /dev/null
+++ 
b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/model/UploadResponseTest.java
@@ -0,0 +1,31 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ * http://www.apache.org/licenses/LICENSE-2.0                   *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ***************************************************************/
+
+package org.apache.james.jmap.draft.model;
+
+import org.junit.jupiter.api.Test;
+
+import nl.jqno.equalsverifier.EqualsVerifier;
+
+class UploadResponseTest {
+    @Test
+    void shouldRespectBeanContract() {
+        EqualsVerifier.forClass(UploadResponse.class).verify();
+    }
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to