PropertyOverridesImpl implements PropertyOverrides { public Block getOverrideBlock(String name) { return resources.getBlockParameter(name); } PropertyOverridesImpl(ComponentResources resources); Block getOverrideBlock(String name); Messages getOverrideMessages();  }
@Test public void block_found() { Messages messages = mockMessages(); ComponentResources resources = mockInternalComponentResources(); Block block = mockBlock(); String name = "alfred"; train_getContainerMessages(resources, messages); train_getBlockParameter(resources, name, block); replay(); PropertyOverrides po = new PropertyOverridesImpl(resources); assertSame(po.getOverrideBlock(name), block); verify(); }
@Test public void block_not_found() { Messages messages = mockMessages(); ComponentResources resources = mockInternalComponentResources(); String name = "alfred"; train_getContainerMessages(resources, messages); train_getBlockParameter(resources, name, null); replay(); PropertyOverrides po = new PropertyOverridesImpl(resources); assertNull(po.getOverrideBlock(name)); verify(); }