mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8656: use catch block for validation
This commit is contained in:
parent
384a2e9cee
commit
adcd0c0c0d
@ -103,16 +103,19 @@ public class ModuleBasedContextFactoryTest {
|
||||
assertEquals(parent, parentBean);
|
||||
}
|
||||
|
||||
int notfound = 0;
|
||||
for (String notThere : notTheres) {
|
||||
try {
|
||||
context.getBean(notThere, String.class);
|
||||
fail();
|
||||
} catch (NoSuchBeanDefinitionException e) {
|
||||
notfound++;
|
||||
}
|
||||
}
|
||||
|
||||
int count = context.getBean("count", InstantiationCounter.class).getCount();
|
||||
|
||||
assertEquals(notTheres.length, notfound);
|
||||
assertEquals(order, count);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user