wido commented on a change in pull request #3681: Validate disk offering IOPS 
normal and maximum read/write values
URL: https://github.com/apache/cloudstack/pull/3681#discussion_r367079724
 
 

 ##########
 File path: 
server/src/test/java/com/cloud/configuration/ConfigurationManagerTest.java
 ##########
 @@ -854,36 +848,43 @@ public void hasSameSubnetTest() {
         Network ipV6Network = mock(Network.class);
         when(ipV6Network.getIp6Gateway()).thenReturn("2001:db8:0:f101::1");
         when(ipV6Network.getIp6Cidr()).thenReturn("2001:db8:0:f101::0/64");
-        doThrow(new InvalidParameterValueException("Exception from Mock: 
startIPv6 is not in ip6cidr indicated 
network!")).when(configurationMgr._networkModel).checkIp6Parameters("2001:db9:0:f101::2",
 "2001:db9:0:f101::a", "2001:db8:0:f101::1", "2001:db8:0:f101::0/64");
-        doThrow(new InvalidParameterValueException("Exception from Mock: 
endIPv6 is not in ip6cidr indicated 
network!")).when(configurationMgr._networkModel).checkIp6Parameters("2001:db8:0:f101::a",
 "2001:db9:0:f101::2", "2001:db8:0:f101::1", "2001:db8:0:f101::0/64");
-        doThrow(new InvalidParameterValueException("ip6Gateway and ip6Cidr 
should be defined when startIPv6/endIPv6 are passed 
in")).when(configurationMgr._networkModel).checkIp6Parameters(Mockito.anyString(),
 Mockito.anyString(), Mockito.isNull(String.class), 
Mockito.isNull(String.class));
-
-
-        configurationMgr.hasSameSubnet(false, null, null, null, null, null, 
null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::2", "2001:db8:0:f101::a", ipV6Network);
+        doThrow(new InvalidParameterValueException("Exception from Mock: 
startIPv6 is not in ip6cidr indicated 
network!")).when(configurationMgr._networkModel)
+                .checkIp6Parameters("2001:db9:0:f101::2", 
"2001:db9:0:f101::a", "2001:db8:0:f101::1", "2001:db8:0:f101::0/64");
+        doThrow(new InvalidParameterValueException("Exception from Mock: 
endIPv6 is not in ip6cidr indicated 
network!")).when(configurationMgr._networkModel)
+                .checkIp6Parameters("2001:db8:0:f101::a", 
"2001:db9:0:f101::2", "2001:db8:0:f101::1", "2001:db8:0:f101::0/64");
+        doThrow(new InvalidParameterValueException("ip6Gateway and ip6Cidr 
should be defined when startIPv6/endIPv6 are passed 
in")).when(configurationMgr._networkModel)
+                .checkIp6Parameters(Mockito.anyString(), Mockito.anyString(), 
Mockito.isNull(String.class), Mockito.isNull(String.class));
+
+        configurationMgr.hasSameSubnet(false, null, null, null, null, null, 
null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::2", "2001:db8:0:f101::a",
+                ipV6Network);
         Assert.assertTrue(result);
         try {
-            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::2", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::2", "2001:db8:0:f101::a", ipV6Network);
+            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::2", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::2",
+                    "2001:db8:0:f101::a", ipV6Network);
             Assert.fail();
-        } catch (InvalidParameterValueException e){
+        } catch (InvalidParameterValueException e) {
             Assert.assertEquals(e.getMessage(), "The input gateway 
2001:db8:0:f101::2 is not same as network gateway 2001:db8:0:f101::1");
         }
         try {
-            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/63", 
"2001:db8:0:f101::2", "2001:db8:0:f101::a", ipV6Network);
+            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/63", 
"2001:db8:0:f101::2",
+                    "2001:db8:0:f101::a", ipV6Network);
             Assert.fail();
-        } catch (InvalidParameterValueException e){
+        } catch (InvalidParameterValueException e) {
             Assert.assertEquals(e.getMessage(), "The input cidr 
2001:db8:0:f101::0/63 is not same as network cidr 2001:db8:0:f101::0/64");
         }
 
         try {
-            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db9:0:f101::2", "2001:db9:0:f101::a", ipV6Network);
+            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db9:0:f101::2",
+                    "2001:db9:0:f101::a", ipV6Network);
             Assert.fail();
         } catch (InvalidParameterValueException e) {
             Assert.assertEquals(e.getMessage(), "Exception from Mock: 
startIPv6 is not in ip6cidr indicated network!");
         }
         try {
-            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::a", "2001:db9:0:f101::2", ipV6Network);
+            configurationMgr.hasSameSubnet(false, null, null, null, null, 
null, null, true, "2001:db8:0:f101::1", "2001:db8:0:f101::0/64", 
"2001:db8:0:f101::a",
+                    "2001:db9:0:f101::2", ipV6Network);
             Assert.fail();
-        } catch(InvalidParameterValueException e){
+        } catch (InvalidParameterValueException e) {
 
 Review comment:
   See all the lines above. Maybe revert these checkstyle changes?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to