Skip to content

Commit a6aed97

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
CSTACKEX-46:removed unrelated changes
1 parent 698b4ce commit a6aed97

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

server/src/test/java/com/cloud/server/ManagementServerImplTest.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,49 +1059,4 @@ public void testGetExternalVmConsole() {
10591059
Assert.assertNotNull(spy.getExternalVmConsole(virtualMachine, host));
10601060
Mockito.verify(extensionManager).getInstanceConsole(virtualMachine, host);
10611061
}
1062-
1063-
@Test
1064-
public void getStatesForIpAddressSearchReturnsValidStates() {
1065-
ListPublicIpAddressesCmd cmd = Mockito.mock(ListPublicIpAddressesCmd.class);
1066-
Mockito.when(cmd.getState()).thenReturn("Allocated ,free");
1067-
List<IpAddress.State> result = spy.getStatesForIpAddressSearch(cmd);
1068-
Assert.assertEquals(2, result.size());
1069-
Assert.assertTrue(result.contains(IpAddress.State.Allocated));
1070-
Assert.assertTrue(result.contains(IpAddress.State.Free));
1071-
}
1072-
1073-
@Test
1074-
public void getStatesForIpAddressSearchReturnsEmptyListForNullState() {
1075-
ListPublicIpAddressesCmd cmd = Mockito.mock(ListPublicIpAddressesCmd.class);
1076-
Mockito.when(cmd.getState()).thenReturn(null);
1077-
List<IpAddress.State> result = spy.getStatesForIpAddressSearch(cmd);
1078-
Assert.assertTrue(result.isEmpty());
1079-
}
1080-
1081-
@Test
1082-
public void getStatesForIpAddressSearchReturnsEmptyListForBlankState() {
1083-
ListPublicIpAddressesCmd cmd = Mockito.mock(ListPublicIpAddressesCmd.class);
1084-
Mockito.when(cmd.getState()).thenReturn(" ");
1085-
List<IpAddress.State> result = spy.getStatesForIpAddressSearch(cmd);
1086-
Assert.assertTrue(result.isEmpty());
1087-
}
1088-
1089-
@Test(expected = InvalidParameterValueException.class)
1090-
public void getStatesForIpAddressSearchThrowsExceptionForInvalidState() {
1091-
ListPublicIpAddressesCmd cmd = Mockito.mock(ListPublicIpAddressesCmd.class);
1092-
Mockito.when(cmd.getState()).thenReturn("InvalidState");
1093-
spy.getStatesForIpAddressSearch(cmd);
1094-
}
1095-
1096-
@Test
1097-
public void getStatesForIpAddressSearchHandlesMixedValidAndInvalidStates() {
1098-
ListPublicIpAddressesCmd cmd = Mockito.mock(ListPublicIpAddressesCmd.class);
1099-
Mockito.when(cmd.getState()).thenReturn("Allocated,InvalidState");
1100-
try {
1101-
spy.getStatesForIpAddressSearch(cmd);
1102-
Assert.fail("Expected InvalidParameterValueException to be thrown");
1103-
} catch (InvalidParameterValueException e) {
1104-
Assert.assertEquals("Invalid state: InvalidState", e.getMessage());
1105-
}
1106-
}
11071062
}

0 commit comments

Comments
 (0)