UUIDs be gone.
[groupbasedpolicy.git] / neutron-mapper / src / test / java / org / opendaylight / groupbasedpolicy / neutron / mapper / mapping / rule / SecRuleEntityDecoderTest.java
index ed4c2d836a1c2d7787f255637f078b63a79e3cae..acc51417d5f8a51e5b9ca90a266310f306746053 100644 (file)
@@ -48,43 +48,43 @@ public class SecRuleEntityDecoderTest {
     @Test
     public final void testGetTenantId_lowercaseUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567-abcd-ef01-0123-0123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
     public final void testGetTenantId_uppercaseUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567-ABCD-EF01-0123-0123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
     public final void testGetTenantId_mixUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567-ABCD-ef01-0123-0123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
     public final void testGetTenantId_noSlashLowercaseUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567abcdef0101230123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
     public final void testGetTenantId_noSlashUppercaseUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567ABCDEF0101230123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
     public final void testGetTenantId_noSlashMixUuidTenantID() {
         secRule.setSecurityRuleTenantID("01234567ABCDef0101230123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getTenantId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getTenantId(secRule).getValue());
     }
 
     @Test
@@ -94,20 +94,6 @@ public class SecRuleEntityDecoderTest {
         SecRuleEntityDecoder.getTenantId(secRule);
     }
 
-    @Test
-    public final void testGetTenantId_badLengthUuidTenantID() {
-        secRule.setSecurityRuleTenantID("abc");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getTenantId(secRule);
-    }
-
-    @Test
-    public final void testGetTenantId_badContentUuidTenantID() {
-        secRule.setSecurityRuleTenantID("xyz34567-abcd-ef01-0123-0123456789ab");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getTenantId(secRule);
-    }
-
     @Test
     public final void testGetTenantId_nullUuidTenantID() {
         secRule.setSecurityRuleTenantID(null);
@@ -118,43 +104,43 @@ public class SecRuleEntityDecoderTest {
     @Test
     public final void testGetProviderEpgId_lowercaseUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567-abcd-ef01-0123-0123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetProviderEpgId_uppercaseUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567-ABCD-EF01-0123-0123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetProviderEpgId_mixUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567-ABCD-ef01-0123-0123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetProviderEpgId_noSlashLowercaseUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567abcdef0101230123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetProviderEpgId_noSlashUppercaseUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567ABCDEF0101230123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetProviderEpgId_noSlashMixUuidGroupID() {
         secRule.setSecurityRuleGroupID("01234567ABCDef0101230123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getProviderEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getProviderEpgId(secRule).getValue());
     }
 
     @Test
@@ -164,20 +150,6 @@ public class SecRuleEntityDecoderTest {
         SecRuleEntityDecoder.getProviderEpgId(secRule);
     }
 
-    @Test
-    public final void testGetProviderEpgId_badLengthUuidGroupID() {
-        secRule.setSecurityRuleGroupID("abcdxy");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getProviderEpgId(secRule);
-    }
-
-    @Test
-    public final void testGetProviderEpgId_badContentUuidGroupID() {
-        secRule.setSecurityRuleGroupID("xyz34567-abcd-ef01-0123-0123456789ab");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getProviderEpgId(secRule);
-    }
-
     @Test
     public final void testGetProviderEpgId_nullUuidGroupID() {
         secRule.setSecurityRuleGroupID(null);
@@ -188,43 +160,43 @@ public class SecRuleEntityDecoderTest {
     @Test
     public final void testGetConsumerEpgId_lowercaseUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567-abcd-ef01-0123-0123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetConsumerEpgId_uppercaseUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567-ABCD-EF01-0123-0123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetConsumerEpgId_mixUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567-ABCD-ef01-0123-0123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetConsumerEpgId_noSlashLowercaseUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567abcdef0101230123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetConsumerEpgId_noSlashUppercaseUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567ABCDEF0101230123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
     public final void testGetConsumerEpgId_noSlashMixUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID("01234567ABCDef0101230123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getConsumerEpgId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getConsumerEpgId(secRule).getValue());
     }
 
     @Test
@@ -233,20 +205,6 @@ public class SecRuleEntityDecoderTest {
         Assert.assertSame(null, SecRuleEntityDecoder.getConsumerEpgId(secRule));
     }
 
-    @Test
-    public final void testGetConsumerEpgId_badLengthUuidRemoteGroupID() {
-        secRule.setSecurityRemoteGroupID("abc");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getConsumerEpgId(secRule);
-    }
-
-    @Test
-    public final void testGetConsumerEpgId_badContentUuidRemoteGroupID() {
-        secRule.setSecurityRemoteGroupID("xyz34567-abcd-ef01-0123-0123456789ab");
-        thrown.expect(IllegalArgumentException.class);
-        SecRuleEntityDecoder.getConsumerEpgId(secRule);
-    }
-
     @Test
     public final void testGetConsumerEpgId_nullUuidRemoteGroupID() {
         secRule.setSecurityRemoteGroupID(null);
@@ -256,22 +214,22 @@ public class SecRuleEntityDecoderTest {
     @Test
     public final void testGetContractId_lowercaseUuidID() {
         secRule.setSecurityRuleUUID("01234567-abcd-ef01-0123-0123456789ab");
-        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab", SecRuleEntityDecoder.getContractId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-abcd-ef01-0123-0123456789ab",
+                SecRuleEntityDecoder.getContractId(secRule).getValue());
     }
 
     @Test
     public final void testGetContractId_uppercaseUuidID() {
         secRule.setSecurityRuleUUID("01234567-ABCD-EF01-0123-0123456789AB");
-        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB", SecRuleEntityDecoder.getContractId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-EF01-0123-0123456789AB",
+                SecRuleEntityDecoder.getContractId(secRule).getValue());
     }
 
     @Test
     public final void testGetContractId_mixUuidID() {
         secRule.setSecurityRuleUUID("01234567-ABCD-ef01-0123-0123456789Ab");
-        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab", SecRuleEntityDecoder.getContractId(secRule)
-            .getValue());
+        Assert.assertEquals("01234567-ABCD-ef01-0123-0123456789Ab",
+                SecRuleEntityDecoder.getContractId(secRule).getValue());
     }
 
     @Test
@@ -491,9 +449,11 @@ public class SecRuleEntityDecoderTest {
         Assert.assertNotNull(consumerMatchers);
         Assert.assertNull(consumerMatchers.getConditionMatcher());
         Assert.assertNull(consumerMatchers.getGroupIdentificationConstraints());
-        EndpointIdentificationConstraints endpointIdentificationConstraints = consumerMatchers.getEndpointIdentificationConstraints();
+        EndpointIdentificationConstraints endpointIdentificationConstraints =
+                consumerMatchers.getEndpointIdentificationConstraints();
         Assert.assertNotNull(endpointIdentificationConstraints);
-        L3EndpointIdentificationConstraints l3EndpointIdentificationConstraints = endpointIdentificationConstraints.getL3EndpointIdentificationConstraints();
+        L3EndpointIdentificationConstraints l3EndpointIdentificationConstraints =
+                endpointIdentificationConstraints.getL3EndpointIdentificationConstraints();
         Assert.assertNotNull(l3EndpointIdentificationConstraints);
         List<PrefixConstraint> prefixConstraints = l3EndpointIdentificationConstraints.getPrefixConstraint();
         Assert.assertNotNull(prefixConstraints);