### Question:
JsLoadProcessor implements JsProcessor { public boolean process(JsRequest request, JsResponseBuilder builder) throws JsException { JsUri jsUri = request.getJsUri(); if (jsUri.isJsload()) { if (requireOnload && jsUri.getOnload() == null) { throw new JsException(HttpServletResponse.SC_BAD_REQUEST, JSLOAD_ONLOAD_ERROR); } int refresh = getCacheTtlSecs(jsUri); builder.setCacheTtlSecs(refresh); builder.setProxyCacheable(true); doJsload(jsUri, builder); return false; } return true; } @Inject  JsLoadProcessor(
      JsUriManager jsUriManager,
      @Named("shindig.jsload.ttl-secs") int jsloadTtlSecs,
      @Named("shindig.jsload.require-onload-with-jsload") boolean requireOnload); @Inject(optional = true) void setUseAsync(@Named("shindig.jsload.async-mode") Boolean jsloadAsync); boolean process(JsRequest request, JsResponseBuilder builder); @VisibleForTesting
  static final String JSLOAD_ONLOAD_ERROR; @VisibleForTesting
  static final String JSLOAD_JS_TPL; @VisibleForTesting
  static final String ASYNC_JSLOAD_JS_TPL; }### Answer:
@Test public void testSkipsWhenNoJsLoad() throws Exception { EasyMock.expect(jsUri.isJsload()).andReturn(false); response = control.createMock(JsResponseBuilder.class); control.replay(); assertTrue(processor.process(request, response)); control.verify(); }
@Test public void testFailsWhenNoOnloadIsSpecified() throws Exception { EasyMock.expect(jsUri.isJsload()).andReturn(true); EasyMock.expect(jsUri.getOnload()).andReturn(null); control.replay(); try { processor.process(request, response); fail("A JsException should have been thrown by the processor."); } catch (JsException e) { assertEquals(HttpServletResponse.SC_BAD_REQUEST, e.getStatusCode()); assertEquals(JsLoadProcessor.JSLOAD_ONLOAD_ERROR, e.getMessage()); } control.verify(); }