@Order(1) @Test public void testCompile() throws Throwable { ExtractableResponse<Response> postResponse = given(documentationSpec) .urlEncodingEnabled(true) .formParam("code", "a := 1; b := 2; c := a + b;") .port(port) .filter(document("compile", requestParameters( parameterWithName("code").description("The VTL code snippet to compile") ), responseFields( fieldWithPath("uuid").description("The UUID of the session being created").type(UUID.class) ), responseHeaders( headerWithName("JSESSIONID").description("The Java Servlet server session cookie.").optional() ) )) .when() .post("/compile") .then().assertThat() .statusCode(OK.value()) .and() .body("uuid", matchesPattern("(?i)\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}")) .and() .cookie("JSESSIONID") .extract(); jSessionID = postResponse.cookie("JSESSIONID"); uuid = postResponse.as(UUIDBean.class).getUuid(); }
@PostMapping(path = "/compile", params = "code") public @NonNull UUIDBean compile(@RequestParam @NonNull String code) { UUID uuid = manager.createSession(); VTLSession session = manager.getSession(uuid); session.addStatements(code); session.compile(); return new UUIDBean(uuid); }
VTLRESTfulServices extends SpringBootServletInitializer { @PostMapping(path = "/compile", params = "code") public @NonNull UUIDBean compile(@RequestParam @NonNull String code) { UUID uuid = manager.createSession(); VTLSession session = manager.getSession(uuid); session.addStatements(code); session.compile(); return new UUIDBean(uuid); } }
VTLRESTfulServices extends SpringBootServletInitializer { @PostMapping(path = "/compile", params = "code") public @NonNull UUIDBean compile(@RequestParam @NonNull String code) { UUID uuid = manager.createSession(); VTLSession session = manager.getSession(uuid); session.addStatements(code); session.compile(); return new UUIDBean(uuid); }  }
VTLRESTfulServices extends SpringBootServletInitializer { @PostMapping(path = "/compile", params = "code") public @NonNull UUIDBean compile(@RequestParam @NonNull String code) { UUID uuid = manager.createSession(); VTLSession session = manager.getSession(uuid); session.addStatements(code); session.compile(); return new UUIDBean(uuid); }  @PostMapping(path = "/compile", params = "code") @NonNull UUIDBean compile(@RequestParam @NonNull String code); @GetMapping("/resolve") @NonNull ResultBean resolve(@RequestParam @NonNull UUID uuid, @RequestParam @NonNull String alias); @GetMapping("/metadata") @NonNull List<DomainBean> getMetadata(@RequestParam @NonNull UUID uuid, @RequestParam @NonNull String alias); }
VTLRESTfulServices extends SpringBootServletInitializer { @PostMapping(path = "/compile", params = "code") public @NonNull UUIDBean compile(@RequestParam @NonNull String code) { UUID uuid = manager.createSession(); VTLSession session = manager.getSession(uuid); session.addStatements(code); session.compile(); return new UUIDBean(uuid); }  @PostMapping(path = "/compile", params = "code") @NonNull UUIDBean compile(@RequestParam @NonNull String code); @GetMapping("/resolve") @NonNull ResultBean resolve(@RequestParam @NonNull UUID uuid, @RequestParam @NonNull String alias); @GetMapping("/metadata") @NonNull List<DomainBean> getMetadata(@RequestParam @NonNull UUID uuid, @RequestParam @NonNull String alias);  }