Simplify Test Case ApplicationLoadBalancerTest.searchForNonExistingLoadBalancer (#6882)

This commit is contained in:
Codegass 2022-11-28 10:06:50 -05:00 committed by GitHub
parent a880109d50
commit 7aeb5b0810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 14 deletions

View File

@ -186,22 +186,11 @@ public class ApplicationLoadBalancerTest extends TestCase {
assertNotNull("Couldn't find existing application load balancer", rule);
}
@Test
@Test(expected = InvalidParameterValueException.class)
//Negative test - try to retrieve non-existing lb
public
void searchForNonExistingLoadBalancer() {
boolean notFound = false;
ApplicationLoadBalancerRule rule = null;
try {
rule = _appLbSvc.getApplicationLoadBalancer(nonExistingLbId);
if (rule != null) {
notFound = false;
}
} catch (InvalidParameterValueException ex) {
notFound = true;
}
assertTrue("Found non-existing load balancer; no invalid parameter value exception was thrown", notFound);
void searchForNonExistingLoadBalancer() throws InvalidParameterValueException {
_appLbSvc.getApplicationLoadBalancer(nonExistingLbId);
}
/**