コード例 #1
0
 @Test
 @Transactional
 @Rollback(true)
 public void testCreateCanvas() throws Exception {
   uIService.saveWidget(widget);
   canvas = new Canvas("testCanvas");
   canvas.setCanvasType(CanvasType.PRIVATE);
   canvas.setCanvasLayout(uIService.getCanvasLayoutById(1L));
   canvas.setShortName("testCanvas");
   canvas.setCreatedByUserName("createdByUserName");
   canvas.setCreatedDateTime(new Date());
   canvas.setWidgetInstanceList(widgetInstanceList);
   uIService.saveCanvas(canvas);
   Canvas retrivedCanvas = uIService.getCanvasByName(canvas.getName());
   Assert.notNull(retrivedCanvas);
 }
コード例 #2
0
 @Test
 @Transactional
 @Rollback(true)
 public void testSaveWidget()
     throws JsonParseException, JsonMappingException, JsonProcessingException, IOException {
   LucasObjectMapper om = new LucasObjectMapper();
   String stringActionConfig = om.writeValueAsString(mappedActionConfig);
   MappedActionConfigurable<String, Map<Permission, Boolean>> mac =
       om.readValue(
           stringActionConfig,
           new TypeReference<MappedActionConfigurable<String, Map<Permission, Boolean>>>() {});
   uIService.deleteWidget(widget.getName());
   uIService.saveWidget(widget);
   AbstractLicensableWidget retrivedWidget = uIService.getWidgetByName(widget.getName());
   Assert.notNull(retrivedWidget);
 }