### Question:
QueryMetricsBean { @GET @Path("/summary") @Interceptors(ResponseInterceptor.class) public QueryMetricsSummaryResponse getTotalQueriesSummaryCounts( @QueryParam("begin") @DateFormat(defaultTime = "000000", defaultMillisec = "000") Date begin, @QueryParam("end") @DateFormat( defaultTime = "235959", defaultMillisec = "999") Date end) { if (null == begin) { Calendar ninetyDaysAgo = Calendar.getInstance(DateUtils.UTC_TIME_ZONE); ninetyDaysAgo.add(Calendar.DATE, -90); begin = DateUtils.truncate(ninetyDaysAgo, Calendar.DATE).getTime(); } else { begin = DateUtils.truncate(begin, Calendar.SECOND); } if (null == end) { end = new Date(); } else { end = DateUtils.truncate(end, Calendar.SECOND); } DatawavePrincipal dp = getPrincipal(); return queryHandler.getTotalQueriesSummaryCounts(begin, end, dp); }  @PermitAll void updateMetric(BaseQueryMetric metric); @GET @POST @Path("/id/{id}") @Interceptors({RequiredInterceptor.class, ResponseInterceptor.class}) BaseQueryMetricListResponse query(@PathParam("id") @Required("id") String id); @GET @POST @Path("/id/{id}/map") @Interceptors({RequiredInterceptor.class, ResponseInterceptor.class}) QueryGeometryResponse map(@PathParam("id") @Required("id") String id); @GET @Path("/summaryCounts") @Interceptors(ResponseInterceptor.class) QueryMetricsSummaryHtmlResponse getTotalQueriesSummary(@QueryParam("begin") @DateFormat(defaultTime = "000000", defaultMillisec = "000") Date begin,
                    @QueryParam("end") @DateFormat(defaultTime = "235959", defaultMillisec = "999") Date end); @GET @Path("/summary") @Interceptors(ResponseInterceptor.class) QueryMetricsSummaryResponse getTotalQueriesSummaryCounts(
                    @QueryParam("begin") @DateFormat(defaultTime = "000000", defaultMillisec = "000") Date begin, @QueryParam("end") @DateFormat(
                                    defaultTime = "235959", defaultMillisec = "999") Date end); @GET @Path("/summaryCounts/user") @Interceptors(ResponseInterceptor.class) QueryMetricsSummaryHtmlResponse getUserQueriesSummary(@QueryParam("begin") @DateFormat(defaultTime = "000000", defaultMillisec = "000") Date begin,
                    @QueryParam("end") @DateFormat(defaultTime = "235959", defaultMillisec = "999") Date end); void sendQueryMetric(DatawavePrincipal principal, BaseQueryMetric queryMetric);  }### Answer:
@Test public void testQuery_TotalQueriesSummary() throws Exception { Date beginDate = new Date(System.currentTimeMillis() - 2000); Date endDate = new Date(System.currentTimeMillis() - 1000); expect(this.ejbContext.getCallerPrincipal()).andReturn(this.callerPrincipal); expect(this.queryMetricHandler.getTotalQueriesSummaryCounts(isA(Date.class), isA(Date.class), isA(DatawavePrincipal.class))).andReturn( this.summaryResponse); replayAll(); QueryMetricsSummaryResponse result1 = subject.getTotalQueriesSummaryCounts(beginDate, endDate); verifyAll(); assertSame("Query result should not be null", this.summaryResponse, result1); }