@Test(expected = NullPointerException.class) public void processShouldThrowOnNullMethodCallId() { testee.process(mock(GetMailboxesRequest.class), null, mock(MailboxSession.class)); }
@Override public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) { Preconditions.checkNotNull(request); Preconditions.checkNotNull(methodCallId); Preconditions.checkNotNull(mailboxSession); Preconditions.checkArgument(request instanceof GetVacationRequest); return Flux.from(metricFactory.decoratePublisherWithTimerMetricLogP99(JMAP_PREFIX + METHOD_NAME.getName(), process(mailboxSession) .map(response -> JmapResponse.builder() .methodCallId(methodCallId) .responseName(RESPONSE_NAME) .response(response) .build()) .flux())) .subscriberContext(jmapAction("VACATION")); }
GetVacationResponseMethod implements Method { @Override public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) { Preconditions.checkNotNull(request); Preconditions.checkNotNull(methodCallId); Preconditions.checkNotNull(mailboxSession); Preconditions.checkArgument(request instanceof GetVacationRequest); return Flux.from(metricFactory.decoratePublisherWithTimerMetricLogP99(JMAP_PREFIX + METHOD_NAME.getName(), process(mailboxSession) .map(response -> JmapResponse.builder() .methodCallId(methodCallId) .responseName(RESPONSE_NAME) .response(response) .build()) .flux())) .subscriberContext(jmapAction("VACATION")); } }
GetVacationResponseMethod implements Method { @Override public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) { Preconditions.checkNotNull(request); Preconditions.checkNotNull(methodCallId); Preconditions.checkNotNull(mailboxSession); Preconditions.checkArgument(request instanceof GetVacationRequest); return Flux.from(metricFactory.decoratePublisherWithTimerMetricLogP99(JMAP_PREFIX + METHOD_NAME.getName(), process(mailboxSession) .map(response -> JmapResponse.builder() .methodCallId(methodCallId) .responseName(RESPONSE_NAME) .response(response) .build()) .flux())) .subscriberContext(jmapAction("VACATION")); } @Inject  GetVacationResponseMethod(VacationRepository vacationRepository, ZonedDateTimeProvider zonedDateTimeProvider, MetricFactory metricFactory); }
GetVacationResponseMethod implements Method { @Override public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) { Preconditions.checkNotNull(request); Preconditions.checkNotNull(methodCallId); Preconditions.checkNotNull(mailboxSession); Preconditions.checkArgument(request instanceof GetVacationRequest); return Flux.from(metricFactory.decoratePublisherWithTimerMetricLogP99(JMAP_PREFIX + METHOD_NAME.getName(), process(mailboxSession) .map(response -> JmapResponse.builder() .methodCallId(methodCallId) .responseName(RESPONSE_NAME) .response(response) .build()) .flux())) .subscriberContext(jmapAction("VACATION")); } @Inject  GetVacationResponseMethod(VacationRepository vacationRepository, ZonedDateTimeProvider zonedDateTimeProvider, MetricFactory metricFactory); @Override Request.Name requestHandled(); @Override Class<? extends JmapRequest> requestType(); @Override Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession); }
GetVacationResponseMethod implements Method { @Override public Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession) { Preconditions.checkNotNull(request); Preconditions.checkNotNull(methodCallId); Preconditions.checkNotNull(mailboxSession); Preconditions.checkArgument(request instanceof GetVacationRequest); return Flux.from(metricFactory.decoratePublisherWithTimerMetricLogP99(JMAP_PREFIX + METHOD_NAME.getName(), process(mailboxSession) .map(response -> JmapResponse.builder() .methodCallId(methodCallId) .responseName(RESPONSE_NAME) .response(response) .build()) .flux())) .subscriberContext(jmapAction("VACATION")); } @Inject  GetVacationResponseMethod(VacationRepository vacationRepository, ZonedDateTimeProvider zonedDateTimeProvider, MetricFactory metricFactory); @Override Request.Name requestHandled(); @Override Class<? extends JmapRequest> requestType(); @Override Flux<JmapResponse> process(JmapRequest request, MethodCallId methodCallId, MailboxSession mailboxSession); static final Request.Name METHOD_NAME; static final Response.Name RESPONSE_NAME; }