From b53ae7fdbebd118f53ea8297c21cb36127db1841 Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Mon, 20 Jan 2025 17:14:39 +0100 Subject: [PATCH] remove useless public modifier --- .../puzzle/okr/service/business/QuarterBusinessService.java | 6 +++--- .../service/persistence/QuarterPersistenceServiceIT.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/ch/puzzle/okr/service/business/QuarterBusinessService.java b/backend/src/main/java/ch/puzzle/okr/service/business/QuarterBusinessService.java index 2cc45c590a..2c7cbf933b 100644 --- a/backend/src/main/java/ch/puzzle/okr/service/business/QuarterBusinessService.java +++ b/backend/src/main/java/ch/puzzle/okr/service/business/QuarterBusinessService.java @@ -83,7 +83,7 @@ private int getStartOfBusinessYear(YearMonth startOfQuarter, int quarter) { return startOfQuarter.minusMonths((quarter - 1) * 3L).getYear(); } - protected void generateQuarter(LocalDate start, String label, String schema) { + private void generateQuarter(LocalDate start, String label, String schema) { TenantContext.setCurrentTenant(schema); YearMonth yearMonth = YearMonth.from(start); @@ -104,11 +104,11 @@ private boolean isInLastMonthOfQuarter(int currentQuarter, int nextQuarter) { return Math.abs(nextQuarter - currentQuarter) == 2; } - public YearMonth getCurrentYearMonth() { + YearMonth getCurrentYearMonth() { return YearMonth.now(); } - public Map generateQuarters() { + Map generateQuarters() { Map quarters = new HashMap<>(); int quarterIndexZeroBased = quarterStart - 1; for (int i = 0; i < 12; i++) { diff --git a/backend/src/test/java/ch/puzzle/okr/service/persistence/QuarterPersistenceServiceIT.java b/backend/src/test/java/ch/puzzle/okr/service/persistence/QuarterPersistenceServiceIT.java index 407184a390..5cc962ebbe 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/persistence/QuarterPersistenceServiceIT.java +++ b/backend/src/test/java/ch/puzzle/okr/service/persistence/QuarterPersistenceServiceIT.java @@ -153,8 +153,8 @@ void testCronJob(int month, int quarterIndex, int amountOfInvocations) { quarterBusinessService.scheduledGenerationQuarters(); - Mockito.verify(quarterBusinessService, Mockito.times(amountOfInvocations)).generateQuarter(ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any()); Mockito.verify(quarterPersistenceService, Mockito.times(amountOfInvocations)).save(ArgumentMatchers.any()); + List createdQuarters = quarterPersistenceService.findAll().stream().filter(quarter -> quarter.getLabel().equals(expectedLabel)).toList(); assertEquals(amountOfInvocations, createdQuarters.size()); assertEquals(4+ amountOfInvocations, quarterBusinessService.getQuarters().size());