@Override public boolean matches(Object object) { if (!HttpTimerData.class.isInstance(object)) { return false; } HttpTimerData other = (HttpTimerData) object; assertThat(data.getHttpInfo().getUri(), is(equalTo(other.getHttpInfo().getUri()))); assertThat(data.getHttpInfo().getRequestMethod(), is(equalTo(other.getHttpInfo().getRequestMethod()))); assertThat(data.getAttributes(), is(equalTo(other.getAttributes()))); assertThat(data.getHeaders(), is(equalTo(other.getHeaders()))); assertThat(data.getSessionAttributes(), is(equalTo(other.getSessionAttributes()))); assertThat(data.getParameters(), is(equalTo(other.getParameters()))); assertThat(data.isCharting(), is(equalTo(other.isCharting()))); assertThat(data.getHttpResponseStatus(), is(equalTo(other.getHttpResponseStatus()))); return true; } }
when(httpTimerData.isCharting()).thenReturn(false); processor.process(timerData, entityManager); processor.process(httpTimerData, entityManager); when(httpTimerData.isCharting()).thenReturn(true); processor.process(timerData, entityManager); processor.process(httpTimerData, entityManager);
/** * {@inheritDoc} */ @Override public IAggregatedData<HttpTimerData> getClone(HttpTimerData httpData) { AggregatedHttpTimerData clone = new AggregatedHttpTimerData(); clone.setPlatformIdent(httpData.getPlatformIdent()); clone.setSensorTypeIdent(httpData.getSensorTypeIdent()); clone.setMethodIdent(httpData.getMethodIdent()); clone.setCharting(httpData.isCharting()); if (uriBased) { clone.getHttpInfo().setUri(httpData.getHttpInfo().getUri()); } else { // Aggregation based on Usecase. We reset the URI so that we can easily know // that use case aggregation is used. clone.getHttpInfo().setUri(HttpInfo.UNDEFINED); clone.getHttpInfo().setInspectItTaggingHeaderValue(httpData.getHttpInfo().getInspectItTaggingHeaderValue()); } clone.getHttpInfo().setRequestMethod(httpData.getHttpInfo().getRequestMethod()); return clone; }