- @SuppressWarnings("unchecked")
- public void testStartOperationAsync_testStartQueryAsync_testPostProcessResponse() throws Exception {
-
- // return a map in the reply
- Map<String, String> reply = Map.of(INPUT_FIELD, TEXT);
- when(rawResponse.readEntity(String.class)).thenReturn(new StandardCoder().encode(reply));
-
- when(webAsync.get(any(InvocationCallback.class))).thenAnswer(provideResponse(rawResponse));
-
- CompletableFuture<OperationOutcome> future2 = oper.startOperationAsync(1, outcome);
- assertFalse(future2.isDone());
-
- executor.runAll(100);
- assertTrue(future2.isDone());
-
- assertEquals(PolicyResult.SUCCESS, future2.get().getResult());
-
- // data should have been cached within the context
- StandardCoderObject data = context.getProperty(AaiGetOperation.getTenantKey(TARGET_ENTITY));
- assertNotNull(data);
- assertEquals(TEXT, data.getString(INPUT_FIELD));
-
- assertEquals("1", future2.get().getSubRequestId());
+ public void testGenerateSubRequestId() {
+ oper.generateSubRequestId(3);
+ assertEquals("3", oper.getSubRequestId());