예제 #1
0
  @Test
  public void testWebModelInfoJson() {
    RequestContextMock rc;
    Map result;

    rc = requestContextFactory.createRequestContext(RequestMethod.GET, "/info.json");
    rc.setParamMap(MapUtil.mapIt("id", "123"));
    webController.service(rc);
    result = rc.getResponseAsJson();

    Assert.assertEquals((Integer) 123, (Integer) result.get("id"));
    Assert.assertEquals("hello", (String) result.get("sampleStringValue"));
    Assert.assertEquals("testValue1", (String) result.get("testVal"));
    Assert.assertTrue((Boolean) result.get("webModelHandler-info"));
    Assert.assertEquals("aaabbb", result.get("webRequestHook-start"));
  }
예제 #2
0
 @BeforeClass
 public static void initTestClass() throws Exception {
   Map map = MapUtil.mapIt("testVal", "testValue1");
   SnowTestSupport.initWebApplication("src/test/resources/simpleApp", map, new CustomModule());
 }