### Question:
JdbcExecuteInterceptor implements Installable { @Advice.OnMethodEnter public static ServiceRequestEvent enter(@Advice.AllArguments final Object[] args, @Advice.Origin final String origin, @Advice.This final Statement stmt) { if (LogManager.isDebugEnabled()) { log.debug("DiSCo(Sql) interception of " + origin); } String query = null; String db = null; try { query = parseQueryFromStatement(stmt, args); } catch (Exception e) { log.warn("Disco(Sql) failed to retrieve query string for SQL Downstream Service event", e); } try { db = stmt.getConnection().getCatalog(); } catch (Exception e) { log.warn("Disco(Sql) failed to retrieve Database name for SQL Downstream Service event", e); } ServiceRequestEvent requestEvent = new ServiceDownstreamRequestEvent(SQL_ORIGIN, db, query) .withRequest(stmt); EventBus.publish(requestEvent); return requestEvent; }  @Advice.OnMethodEnter static ServiceRequestEvent enter(@Advice.AllArguments final Object[] args,
                                            @Advice.Origin final String origin,
                                            @Advice.This final Statement stmt); @Advice.OnMethodExit(onThrowable = Throwable.class) static void exit(@Advice.Enter final ServiceRequestEvent requestEvent,
                            @Advice.Return final Object response,
                            @Advice.Thrown final Throwable thrown); @Override AgentBuilder install(final AgentBuilder agentBuilder); static String parseQueryFromStatement(Statement stmt, Object[] params); static final Logger log; static final String SQL_ORIGIN; }### Answer:
@Test public void testRequestEventCreation() { Object[] params = {QUERY}; ServiceRequestEvent event = JdbcExecuteInterceptor.enter(params, null, mockStatement); assertEquals(JdbcExecuteInterceptor.SQL_ORIGIN, event.getOrigin()); assertEquals(DB_NAME, event.getService()); assertEquals(QUERY, event.getOperation()); assertEquals(mockStatement, event.getRequest()); }
@Test public void testRequestEventPublish() { Object[] params = {QUERY}; ServiceRequestEvent event = JdbcExecuteInterceptor.enter(params, null, mockStatement); assertEquals(event, mockListener.getReceivedEvents().get(0)); }