From 14f94c13789b8ace4eae258b5f1d64494518f9c3 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 21 Dec 2015 14:04:12 +0000
Subject: [PATCH] Remove null checks on returned values of Entry.get*Attribute*() methods.

---
 opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
index 4c2a84c..db48a96 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/ModifyConflictTest.java
@@ -1244,8 +1244,7 @@
     testModify(entry, hist, 1, true, newModification(DELETE, DISPLAYNAME, "aValue"));
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1275,8 +1274,7 @@
     assertEquals(hist.encodeAndPurge(), attr);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1318,8 +1316,7 @@
     assertEquals(hist.encodeAndPurge(), attrDel);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1364,8 +1361,7 @@
 
     // The entry should have no value
     List<Attribute> attrs = entry.getAttribute(DESCRIPTION);
-    attr = Attributes.create(DESCRIPTION, "value2", "value3", "value4");
-    assertEquals(attrs.get(0), attr);
+    assertEquals(attrs.get(0), Attributes.create(DESCRIPTION, "value2", "value3", "value4"));
   }
 
   /**
@@ -1412,8 +1408,7 @@
 
     // The entry should have no value
     List<Attribute> attrs = entry.getAttribute(DESCRIPTION);
-    attr = Attributes.create(DESCRIPTION, "value3", "value4");
-    assertEquals(attrs.get(0), attr);
+    assertEquals(attrs.get(0), Attributes.create(DESCRIPTION, "value3", "value4"));
   }
 
   /**
@@ -1455,8 +1450,7 @@
     assertEquals(hist.encodeAndPurge(), attrDel);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1486,8 +1480,7 @@
     assertEquals(hist.encodeAndPurge(), attr);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1517,8 +1510,7 @@
     assertEquals(hist.encodeAndPurge(), attr);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1557,8 +1549,7 @@
     assertEquals(hist.encodeAndPurge(), attrDel);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**
@@ -1597,8 +1588,7 @@
     assertEquals(hist.encodeAndPurge(), attrDel);
 
     // The entry should have no value
-    List<Attribute> attrs = entry.getAttribute(DISPLAYNAME);
-    assertNull(attrs);
+    assertThat(entry.getAttribute(DISPLAYNAME)).isEmpty();
   }
 
   /**

--
Gitblit v1.10.0