### Question:
DoorObstructionGenerator extends AlertGenerator { @Override public void onStarted(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch) { context.models().getModels(MOTORIZED_DOOR).forEach(door -> handleModelChanged(context, door, scratch)); } @Inject  DoorObstructionGenerator(ProductCatalogManager prodCat); @Override void onStarted(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch); static final String ERR_KEY; }### Answer:
@Test public void testOnStartedAddsAlert() { replay(); modelStore.updateModel(door.getAddress(), ImmutableMap.of(DeviceAdvancedCapability.ATTR_ERRORS, ImmutableMap.of(DoorObstructionGenerator.ERR_KEY, "obstructed"))); generator.onStarted(context, scratchPad); String key = AlertKeys.key(SmartHomeAlert.ALERTTYPE_DEV_ERR_GARAGEDOOR_OBSTRUCTION, door.getAddress()); assertScratchPadHasAlert(key); SmartHomeAlert expected = createAlert(); assertAlert(expected, scratchPad.getAlert(key)); }