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