@Before
public void setUp() {
query = new Query(queryBody, Optional.empty());
when(session.getId()).thenReturn("session-id");
when(statementParser.parseSingleStatement(anyString()))
.thenAnswer(invocation -> new PreparedStatement<>(invocation.getArgument(0).toString(), query));
when(serviceContext.getSchemaRegistryClient()).thenReturn(schemaRegistryClient);
when(serviceContext.getTopicClient()).thenReturn(topicClient);
when(ksqlEngine.isAcceptingStatements()).thenReturn(true);
givenRequest(VALID_REQUEST);
wsQueryEndpoint = new WSQueryEndpoint(
ksqlConfig, OBJECT_MAPPER, statementParser, ksqlEngine, serviceContext, commandQueue, exec,
queryPublisher, topicPublisher, activenessRegistrar, COMMAND_QUEUE_CATCHUP_TIMEOUT);
}