### Question:
CustomTask implements Task { @Override public void execute(Context ctx) throws Exception { String url = ContextUtils.assertString(ctx, "url"); OkHttpClient client = new OkHttpClient(); Request req = new Request.Builder() .url(url) .build(); try (Response resp = client.newCall(req).execute()) { if (!resp.isSuccessful()) { log.warn("Error while fetching {}: {}", url, resp.code()); ctx.setVariable("result", error(resp.code())); return; } ObjectMapper om = new ObjectMapper(); Object data = om.readValue(resp.body().byteStream(), Object.class); ctx.setVariable("result", ok(data)); } }  @Override void execute(Context ctx);  }### Answer:
@Test public void test() throws Exception { Map<String, Object> args = new HashMap<>(); args.put("url", "https: MockContext ctx = new MockContext(args); CustomTask task = new CustomTask(); task.execute(ctx); Map<String, Object> result = ContextUtils.getMap(ctx, "result", Collections.emptyMap()); assertEquals(true, result.get("ok")); System.out.println(result.get("data")); }