@Test
public void shouldArchiveProjectIfItExists() {

  String projectName = "project1";
  Project project = new Project(projectName);
  when(projectRepository.findById(projectName)).thenReturn(Optional.of(project));
  projectService.archiveProject(projectName);
  verify(projectRepository, times(1)).saveAndFlush(project);
}