- public void testResetGetCount() {
- oper.resetGetCount();
- assertEquals(0, oper.getGetCount());
- }
-
- @Test
- public void testPostProcess() throws Exception {
-
- assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> {
- oper.postProcessResponse(outcome, PATH, rawResponse, response);
- });
-
- response.setResponseDescriptor(new VfcResponseDescriptor());
- response.setJobId("sampleJobId");
- CompletableFuture<OperationOutcome> future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response);
- assertFalse(future2.isDone());
- //assertSame(outcome, future2.get()); TODO Hanging
- assertEquals(PolicyResult.SUCCESS, outcome.getResult());
-
- response.getResponseDescriptor().setStatus("FinisHeD");
- future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response);
- assertTrue(future2.isDone());
- assertSame(outcome, future2.get());
- assertEquals(PolicyResult.SUCCESS, outcome.getResult());
-
- response.getResponseDescriptor().setStatus("eRRor");
- future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response);
- assertTrue(future2.isDone());
- assertSame(outcome, future2.get());
- assertEquals(PolicyResult.FAILURE, outcome.getResult());
-
- // failed
- /*response.getResponseDescriptor().setStatus("anything but finished");
- future2 = oper.postProcessResponse(outcome, PATH, rawResponse, response);
- assertTrue(future2.isDone());
- assertSame(outcome, future2.get());
- assertEquals(PolicyResult.FAILURE, outcome.getResult());*/