@Test public void testBinary() throws Exception { MockApplication<?> app = application("plugin.controller.resource.binary").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockResourceBridge resource = (MockResourceBridge)client.invoke(render.assertStringResponse()); assertEquals("hello", new String(resource.assertBinaryResponse(), "UTF-8")); assertEquals("application/octet-stream", resource.getMimeType()); } }
@Test public void testNotFound() throws Exception { MockApplication<?> app = application("plugin.controller.resource.notfound").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockResourceBridge resource = (MockResourceBridge)client.invoke(render.assertStringResponse()); resource.assertNotFound(); }
request = new MockViewBridge(application.getLifeCycle(), this, handler.getHandle(), parameters); } else if (handler.getPhase() == Phase.RESOURCE) { request = new MockResourceBridge(application.getLifeCycle(), this, handler.getHandle(), parameters); } else { throw new AssertionError();
@Test public void testNotFound() throws Exception { MockApplication<?> app = application("plugin.controller.resource.notfound").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockResourceBridge resource = (MockResourceBridge)client.invoke(render.assertStringResponse()); resource.assertNotFound(); }
request = new MockViewBridge(application.getLifeCycle(), this, handler.getHandle(), parameters); } else if (handler.getPhase() == Phase.RESOURCE) { request = new MockResourceBridge(application.getLifeCycle(), this, handler.getHandle(), parameters); } else { throw new AssertionError();
@Test public void testBinary() throws Exception { MockApplication<?> app = application("plugin.controller.resource.binary").init(); // MockClient client = app.client(); MockViewBridge render = client.render(); MockResourceBridge resource = (MockResourceBridge)client.invoke(render.assertStringResponse()); assertEquals("hello", new String(resource.assertBinaryResponse(), "UTF-8")); assertEquals("application/octet-stream", resource.getMimeType()); } }