JsCacheAnnotationServices { public long getJsCacheResultDeadline(JsCacheResult jcr) { Calendar deadline = getNowCalendar(); if ((jcr.year() + jcr.month() + jcr.day() + jcr.hour() + jcr.minute() + jcr.second() + jcr.millisecond()) == 0) { deadline.add(Calendar.YEAR, 1); } else { deadline.add(Calendar.YEAR, jcr.year()); deadline.add(Calendar.MONTH, jcr.month()); deadline.add(Calendar.DATE, jcr.day()); deadline.add(Calendar.HOUR, jcr.hour()); deadline.add(Calendar.MINUTE, jcr.minute()); deadline.add(Calendar.SECOND, jcr.second()); deadline.add(Calendar.MILLISECOND, jcr.millisecond()); } return deadline.getTime().getTime(); }  void processJsCacheRemoveAll(); long getJsCacheResultDeadline(JsCacheResult jcr); void processJsCacheRemove(JsCacheRemove jcr, List<String> paramNames, List<String> jsonArgs);  }
@Test public void testGetJsCacheResultDeadline() { System.out.println("getJsCacheResultDeadline"); Calendar c = Calendar.getInstance(); doReturn(c).when(instance).getNowCalendar(); long expResult = c.getTime().getTime() + YEAR; JsCacheResult jcr = new LiteralJsCacheResult(); long result = instance.getJsCacheResultDeadline(jcr); assertThat(result).isGreaterThanOrEqualTo(expResult); }