@Test public void cookieValueMatchesWithString() { Condition condition = condition("cookie('TheCookie') == 'foobar-foobar-baz'"); LiveHttpRequest request = newRequest() .cookies(requestCookie("TheCookie", "foobar-foobar-baz")) .header("App-Name", "app3") .build(); assertThat(condition.evaluate(request, context), is(true)); request = newRequest() .cookies(requestCookie("AnotherCookie", "foobar-baz")) .header("App-Name", "app3") .build(); assertThat(condition.evaluate(request, context), is(false)); request = newRequest() .header("App-Name", "app3") .build(); assertThat(condition.evaluate(request, context), is(false)); }
@Override public boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context) { return expression.evaluate(request, context); }
AntlrCondition implements Condition { @Override public boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context) { return expression.evaluate(request, context); } }
AntlrCondition implements Condition { @Override public boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context) { return expression.evaluate(request, context); } AntlrCondition(Expression<Boolean> expression); }
AntlrCondition implements Condition { @Override public boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context) { return expression.evaluate(request, context); } AntlrCondition(Expression<Boolean> expression); @Override boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context); }
AntlrCondition implements Condition { @Override public boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context) { return expression.evaluate(request, context); } AntlrCondition(Expression<Boolean> expression); @Override boolean evaluate(LiveHttpRequest request, HttpInterceptor.Context context);  }