CalvalusExecuteResponseConverter { public ExecuteResponse getAcceptedResponse(String jobId, WpsServerContext context) { StatusType statusType = new StatusType(); GregorianCalendar gregorianCalendar = new GregorianCalendar(); XMLGregorianCalendar currentTime = getXmlGregorianCalendar(gregorianCalendar); statusType.setCreationTime(currentTime); statusType.setProcessAccepted("The request has been accepted. In order to check the status, use GetStatus" + " with JobId '" + jobId + "'."); executeResponse.setStatus(statusType); String getStatusUrl = getStatusUrl(jobId, context); executeResponse.setStatusLocation(getStatusUrl); return executeResponse; } CalvalusExecuteResponseConverter(); ExecuteResponse getAcceptedResponse(String jobId, WpsServerContext context); ExecuteResponse getAcceptedWithLineageResponse(String jobId,
                                                          DataInputsType dataInputs,
                                                          List<DocumentOutputDefinitionType> rawDataOutput,
                                                          WpsServerContext context); ExecuteResponse getSuccessfulResponse(List<String> resultUrls, Date stopTime); ExecuteResponse getSuccessfulWithLineageResponse(List<String> resultUrls,
                                                            DataInputsType dataInputs,
                                                            List<DocumentOutputDefinitionType> outputType); ExecuteResponse getFailedResponse(String exceptionMessage); ExecuteResponse getStartedResponse(String state, float progress); ExecuteResponse getQuotationResponse(String username, String remoteRef, DataInputsType dataInputs);  }
@Test public void canGetAcceptedResponse() throws Exception { String jobId = "job-01"; Calendar calendar = Calendar.getInstance(); ExecuteResponse executeResponse = calvalusExecuteResponse.getAcceptedResponse(jobId, mockServerContext); assertThat(executeResponse.getStatus().getCreationTime().getDay(), equalTo(calendar.get(Calendar.DAY_OF_MONTH))); assertThat(executeResponse.getStatus().getCreationTime().getMonth(), equalTo(calendar.get(Calendar.MONTH) + 1)); assertThat(executeResponse.getStatus().getCreationTime().getYear(), equalTo(calendar.get(Calendar.YEAR))); assertThat(executeResponse.getStatus().getProcessAccepted(), equalTo("The request has been accepted. In order to check the status, use GetStatus with JobId 'job-01'.")); assertThat(executeResponse.getStatusLocation(), equalTo("http: }