@Test @Ignore("Only for testing uploading a real raport, don't do it every run") public void insertReporting() throws Exception { YearMonth period = new YearMonth(2006, 3); Institute institute = new InstituteFactory().setShortName("RUG").setName("Rijks Universiteit Groningen").create(); PhysicalResourceGroup group = new PhysicalResourceGroupFactory().setInstitute(institute).create(); ReservationReportView adminReport = new ReservationReportView(period.toInterval().getStart(), period.toInterval().getEnd()); adminReport.setAmountRunningReservationsFailed(1); adminReport.setAmountRequestsCreatedSucceeded(5); adminReport.setAmountRunningReservationsStillRunning(4); ReservationReportView nocReport = new ReservationReportView(period.toInterval().getStart(), period.toInterval().getEnd()); nocReport.setAmountRunningReservationsFailed(2); nocReport.setAmountRequestsCreatedSucceeded(10); nocReport.setAmountRunningReservationsStillRunning(8); when(physicalResourceGroupServiceMock.findAllWithPorts()).thenReturn(Lists.newArrayList(group)); when(reportingServiceMock.determineReportForAdmin(eq(period.toInterval()), any(BodRole.class))) .thenReturn(adminReport); when(reportingServiceMock.determineReportForNoc(period.toInterval())).thenReturn(nocReport); subject.sendReports(period); }