@Test
public void findDomainObjectByNameInvokesNestedRulesOnlyOnceForUnknownDomainObject() {
final Bean bean1 = new Bean();
final Bean bean2 = new Bean();
container.addRule(new Rule() {
public String getDescription() {
return "rule1";
}
public void apply(String domainObjectName) {
if (domainObjectName.equals("bean1")) {
container.addObject("bean1", bean1);
}
}
});
container.addRule(new Rule() {
private boolean applyHasBeenCalled;
public String getDescription() {
return "rule2";
}