SlaCheckerService { SlaIncident createIncident(List<Repository> ooslaRepositories) { logger.debug("Create incidents"); SlaIncident ooslaIncident = new SlaIncident(); ooslaIncident.setRepositories(new LinkedHashSet<>(ooslaRepositories)); return slaIncidentRepository.save(ooslaIncident); }    }
@Test public void testCreateIncident() { SlaIncident slaIncidentForTest = getSlaIncidentForTest(); doReturn(slaIncidentForTest).when(slaIncidentRepository).save(any(SlaIncident.class)); SlaIncident createIncident = slaCheckerService.createIncident(getRepositoriesForTest()); assertEquals(slaIncidentForTest, createIncident); }