### Question:
StandaloneExecutor implements Executable { public void start() throws Exception { try { executeStatements(readQueriesFile(queriesFile)); showWelcomeMessage(); } catch (Exception e) { log.error("Failed to start KSQL Server with query file: " + queriesFile, e); stop(); throw e; } } StandaloneExecutor(final KsqlEngine ksqlEngine,
                     final String queriesFile); void start(); void stop(); @Override void join(); static StandaloneExecutor create(final Properties properties, final String queriesFile);  }### Answer:
@Test public void shouldCreateQueries() throws Exception { EasyMock.expect(engine.createQueries(query + "\n")).andReturn(Collections.emptyList()); EasyMock.replay(engine); executor.start(); EasyMock.verify(engine); }
@Test public void shouldExecutePersistentQueries() throws Exception { final PersistentQueryMetadata query = EasyMock.niceMock(PersistentQueryMetadata.class); EasyMock.expect(engine.createQueries(anyString())).andReturn(Collections.singletonList(query)); query.start(); EasyMock.expectLastCall(); EasyMock.replay(query, engine); executor.start(); EasyMock.verify(query); }
@Test public void shouldNotExecuteNonPersistentQueries() throws Exception { final QueryMetadata query = EasyMock.createMock(QueryMetadata.class); EasyMock.expect(engine.createQueries(anyString())).andReturn(Collections.singletonList(query)); EasyMock.expect(query.getStatementString()).andReturn(""); EasyMock.replay(query, engine); executor.start(); EasyMock.verify(query); }