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/plugins/LastModPluginTestCase.java |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
index 07ab0e7..81f6e2d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/LastModPluginTestCase.java
@@ -26,6 +26,10 @@
  */
 package org.opends.server.plugins;
 
+import static org.assertj.core.api.Assertions.*;
+import static org.opends.server.protocols.internal.InternalClientConnection.*;
+import static org.testng.Assert.*;
+
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
@@ -53,9 +57,6 @@
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
-import static org.opends.server.protocols.internal.InternalClientConnection.*;
-import static org.testng.Assert.*;
-
 /**
  * This class defines a set of tests for the
  * org.opends.server.plugins.LastModPlugin class.
@@ -285,8 +286,8 @@
                                       "objectClass: top",
                                       "objectClass: device",
                                       "cn: test");
-    assertNotNull(e.getAttribute("creatorsname"));
-    assertNotNull(e.getAttribute("createtimestamp"));
+    assertThat(e.getAttribute("creatorsname")).isNotEmpty();
+    assertThat(e.getAttribute("createtimestamp")).isNotEmpty();
   }
 
 
@@ -314,8 +315,8 @@
 
     Entry e = DirectoryConfig.getEntry(DN.valueOf("o=test"));
     assertNotNull(e);
-    assertNotNull(e.getAttribute("modifiersname"));
-    assertNotNull(e.getAttribute("modifytimestamp"));
+    assertThat(e.getAttribute("modifiersname")).isNotEmpty();
+    assertThat(e.getAttribute("modifytimestamp")).isNotEmpty();
   }
 
 
@@ -341,8 +342,7 @@
 
     e = DirectoryConfig.getEntry(DN.valueOf("cn=test2,o=test"));
     assertNotNull(e);
-    assertNotNull(e.getAttribute("modifiersname"));
-    assertNotNull(e.getAttribute("modifytimestamp"));
+    assertThat(e.getAttribute("modifiersname")).isNotEmpty();
+    assertThat(e.getAttribute("modifytimestamp")).isNotEmpty();
   }
 }
-

--
Gitblit v1.10.0