### Question:
StartDatabaseServerFinishedAction extends AbstractRedbeamsStartAction<StartDatabaseServerSuccess> { @Override protected void prepareExecution(StartDatabaseServerSuccess payload, Map<Object, Object> variables) { Optional<DBStack> dbStack = dbStackStatusUpdater.updateStatus(payload.getResourceId(), DetailedDBStackStatus.STARTED); metricService.incrementMetricCounter(MetricType.DB_START_FINISHED, dbStack); } StartDatabaseServerFinishedAction();   }### Answer:
@Test public void shouldUpdateStatusOnPrepare() { Optional<DBStack> dbStackOptional = Optional.of(dbStack); when(dbStackStatusUpdater.updateStatus(RESOURCE_ID, DetailedDBStackStatus.STARTED)).thenReturn(dbStackOptional); StartDatabaseServerSuccess event = new StartDatabaseServerSuccess(RESOURCE_ID); victim.prepareExecution(event, null); verify(dbStackStatusUpdater).updateStatus(RESOURCE_ID, DetailedDBStackStatus.STARTED); verify(metricService).incrementMetricCounter(MetricType.DB_START_FINISHED, dbStackOptional); }