### Question:
NewRelicTokenInjectorFilter implements WebFilter { public static Optional<Transaction> getTransaction(Context context) { return context.getOrEmpty(TRANSACTION_CONTEXT_KEY); } NewRelicTokenInjectorFilter(Agent agent); @Override @Trace(async = true) Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain); static Optional<Token> getToken(Context context); static Optional<Transaction> getTransaction(Context context); static final String TRANSACTION_CONTEXT_KEY; static final String TOKEN_CONTEXT_KEY; }### Answer:
@Test public void getTransaction() { Context ctx = Context.of(NewRelicTokenInjectorFilter.TRANSACTION_CONTEXT_KEY, transaction, NewRelicTokenInjectorFilter.TOKEN_CONTEXT_KEY, token); final Optional<Transaction> actual = NewRelicTokenInjectorFilter.getTransaction(ctx); assertTrue(actual.isPresent()); assertEquals(transaction, actual.get()); }