YearMonthRequestDto { public YearMonth getBeforeMonthByYearMonth () { return this.yearMonth.minusMonths(1); } YearMonthRequestDto(YearMonth yearMonth); @Builder  YearMonthRequestDto(YearMonth yearMonth, String strYearMonth); String getBeforeMonthByString(); YearMonth getBeforeMonthByYearMonth(); int getQuarterOfYear(); LocalDate getLocalDate(); LocalDateTime getLocalDateTime();  }
@Test void YearMonth로_직전월을_구한다() throws Exception { YearMonthRequestDto dto = new YearMonthRequestDto(of(2020,9)); YearMonth beforeMonth = dto.getBeforeMonthByYearMonth(); assertThat(beforeMonth).isEqualTo(of(2020,8)); }