Added null tests.
This commit is contained in:
@@ -27,7 +27,6 @@ import javax.naming.directory.ModificationItem;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Tests the DirContextAdapter class.
|
||||
*
|
||||
@@ -681,6 +680,18 @@ public class DirContextAdapterTest extends TestCase {
|
||||
assertEquals("nisse hult", modificationAttribute.get());
|
||||
}
|
||||
|
||||
public void testGetStringAttributes_NullValue() {
|
||||
String result = classUnderTest
|
||||
.getStringAttribute("someAbsentAttribute");
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
public void testGetStringAttributes_AttributeExists_NullValue() {
|
||||
classUnderTest.setAttribute(new BasicAttribute("someAttribute", null));
|
||||
String result = classUnderTest.getStringAttribute("someAttribute");
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
private ModificationItem getModificationItem(ModificationItem[] mods,
|
||||
int operation) {
|
||||
for (int i = 0; i < mods.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user