Skip to content

Commit

Permalink
remove useless public modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jan 20, 2025
1 parent 02b0558 commit b53ae7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<Integer, Integer> generateQuarters() {
Map<Integer, Integer> generateQuarters() {
Map<Integer, Integer> quarters = new HashMap<>();
int quarterIndexZeroBased = quarterStart - 1;
for (int i = 0; i < 12; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Quarter> createdQuarters = quarterPersistenceService.findAll().stream().filter(quarter -> quarter.getLabel().equals(expectedLabel)).toList();
assertEquals(amountOfInvocations, createdQuarters.size());
assertEquals(4+ amountOfInvocations, quarterBusinessService.getQuarters().size());
Expand Down

0 comments on commit b53ae7f

Please sign in to comment.