public void testAlreadyHasPhysAddingVirtQuantityInstanceBased() {
ActivationKey key = new ActivationKey();
key.addPool(genPhysOnlyPool(), new Long(1));
Pool pool = genInstanceBased();
ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
assertTrue(result.getWarnings().isEmpty());
assertEquals(1, result.getErrors().size());
String expected = "rulefailed.invalid.quantity.instancebased.physical";
assertEquals(expected, result.getErrors().get(0).getResourceKey());
try {
actKeyRules.validatePoolForActKey(key, pool, new Long(1));
fail("Should have thrown an exception");
}
catch (BadRequestException bre) {