### Question:
DatabaseBackupRestoreService { public FlowIdentifier backupDatabase(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId) { Stack stack = stackService.getByNameOrCrnInWorkspace(nameOrCrn, workspaceId); MDCBuilder.buildMdcContext(stack); LOGGER.info("Initiating database backup flow for stack {}", stack.getId()); return flowManager.triggerDatalakeDatabaseBackup(stack.getId(), location, backupId); }  void validate(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId); FlowIdentifier backupDatabase(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId); FlowIdentifier restoreDatabase(Long workspaceId, NameOrCrn nameOrCrn, String location, String backupId);  }### Answer:
@Test public void testSuccessfulBackup() { Stack stack = getStack(); when(stackService.findStackByNameAndWorkspaceId(any(), anyLong())).thenReturn(Optional.of(stack)); when(stackService.getByNameOrCrnInWorkspace(any(), anyLong())).thenReturn(stack); when(flowLogService.findAllByResourceIdAndFinalizedIsFalseOrderByCreatedDesc(1L)).thenReturn(Collections.EMPTY_LIST); when(flowManager.triggerDatalakeDatabaseBackup(anyLong(), any(), any())).thenReturn(FlowIdentifier.notTriggered()); service.backupDatabase(WORKSPACE_ID, ofName, null, null); }