OpaClientService { public OpaCompilerResponse getOpaCompilerApiResponse() { PartialRequest partialRequest = defaultPartialRequest.getDefaultPartialRequest(); return getOpaCompilerApiResponse(partialRequest); } OpaClientService(OpaConfig opaConfig);  OpaClientService(OpaConfig opaConfig, RestTemplate restTemplate); String getExecutableSqlStatements(); String getExecutableSqlStatements(PartialRequest partialRequest); OpaCompilerResponse getOpaCompilerApiResponse(); OpaCompilerResponse getOpaCompilerApiResponse(PartialRequest partialRequest);  }
@Test void shouldGetOpaCompileApiResponse() { when(restTemplate.postForEntity(anyString(), any(HttpEntity.class), eq(OpaCompilerResponse.class))) .thenReturn(new ResponseEntity<>(opaCompilerResponse, HttpStatus.OK)); PartialRequest partialRequest = PartialRequest.builder() .query("data.petclinic.authz.allow = true") .unknowns(Set.of("data.pets")).build(); OpaCompilerResponse result = target.getOpaCompilerApiResponse(partialRequest); assertThat(result, is(notNullValue())); }