Removed the requirement that the COPSData member (aka. _data) cannot be null. Found...
[packetcable.git] / packetcable-driver / src / test / java / org / umu / cops / stack / COPSDecisionTest.java
index 4a80f87e36c8d43ab3139e8a0146938efe89d98b..79582127fd688a70e2b18bd463cc5c7bb64734cc 100644 (file)
@@ -31,11 +31,6 @@ public class COPSDecisionTest {
         new COPSDecision(CType.NA, new COPSData());
     }
 
-    @Test(expected = IllegalArgumentException.class)
-    public void constructor2NullData() {
-        new COPSDecision(CType.DEF, null);
-    }
-
     @Test(expected = IllegalArgumentException.class)
     public void constructor3NullCommand() {
         new COPSDecision(null, DecisionFlag.NA);
@@ -87,11 +82,6 @@ public class COPSDecisionTest {
         new COPSDecision(CType.CSI, Command.INSTALL, null, new COPSData());
     }
 
-    @Test(expected = IllegalArgumentException.class)
-    public void constructor5NullData() {
-        new COPSDecision(CType.CSI, Command.INSTALL, DecisionFlag.NA, null);
-    }
-
     @Test(expected = IllegalArgumentException.class)
     public void constructor6NullHeader() {
         final COPSObjHeader hdr = null;
@@ -116,7 +106,14 @@ public class COPSDecisionTest {
 
     @Test(expected = IllegalArgumentException.class)
     public void constructor6NullData() {
-        new COPSDecision(new COPSObjHeader(CNum.DEC, CType.CSI), Command.INSTALL, DecisionFlag.NA, null);
+        new COPSDecision(new COPSObjHeader(CNum.CSI, CType.CSI), Command.INSTALL, DecisionFlag.NA, null);
+    }
+
+    @Test
+    public void cNumDECAndNullData() {
+        final COPSDecision decision = new COPSDecision(CType.DEF, null);
+        Assert.assertNotNull(decision.getData());
+        Assert.assertEquals(0, decision.getData().getData().length);
     }
 
     @Test