Examples of RaxaAlert


Examples of org.raxa.module.raxacore.RaxaAlert

  @WSDoc("Save New RaxaAlert")
  @ResponseBody
  public Object createNewRaxaAlert(@RequestBody SimpleObject post, HttpServletRequest request, HttpServletResponse response)
          throws ResponseException {
    initRaxaAlertController();
    RaxaAlert raxaAlert = setPostFields(new RaxaAlert(), post);
    raxaAlert.setSeen(Boolean.FALSE);
    RaxaAlert created = service.saveRaxaAlert(raxaAlert);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", created.getUuid());
    obj.add("name", created.getName());
    obj.add("description", created.getDescription());
    return RestUtil.created(response, obj);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  @WSDoc("Updates an existing raxa alert")
  @ResponseBody
  public Object updateRaxaAlert(@PathVariable("uuid") String uuid, @RequestBody SimpleObject post,
          HttpServletRequest request, HttpServletResponse response) throws ResponseException {
    initRaxaAlertController();
    RaxaAlert rAlert = service.getRaxaAlertByUuid(uuid);
    rAlert = setPostFields(rAlert, post);
    RaxaAlert created = service.updateRaxaAlert(rAlert);
    SimpleObject obj = new SimpleObject();
    obj.add("uuid", created.getUuid());
    obj.add("name", created.getName());
    obj.add("description", created.getDescription());
    return RestUtil.noContent(response);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  @RequestMapping(value = "/{uuid}", method = RequestMethod.GET)
  @WSDoc("Gets Raxa Alert for the given uuid")
  @ResponseBody()
  public String getRaxaAlertByUuid(@PathVariable("uuid") String uuid, HttpServletRequest request) throws ResponseException {
    initRaxaAlertController();
    RaxaAlert rAlert = service.getRaxaAlertByUuid(uuid);
    return gson.toJson(getFieldsFromRaxaAlert(rAlert));
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  /**
   * Test of saveRaxaAlert method, of class HibernateRaxaAlertDAO.
   */
  @Test
  public void testSaveRaxaAlert() {
    RaxaAlert rAlert = new RaxaAlert();
    //NOTE: never set Id, will be generated automatically (when saving)
    rAlert.setName("TestList3");
    rAlert.setDescription("Third Test List");
    rAlert.setCreator(Context.getUserContext().getAuthenticatedUser());
    rAlert.setDateCreated(new java.util.Date());
    rAlert.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
    rAlert.setVoided(Boolean.FALSE);
    rAlert.setProviderSentId(1);
    rAlert.setProviderRecipientId(2);
    dao.saveRaxaAlert(rAlert);
    RaxaAlert result = dao.getRaxaAlertByName("TestList3", true).get(0);
    String name = result.getName();
    assertEquals(name, "TestList3");
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  /**
   * Test of deleteRaxaAlert method, of class HibernateRaxaAlertDAO.
   */
  @Test
  public void testDeleteRaxaAlert() {
    RaxaAlert rAlert = new RaxaAlert();
    rAlert.setName("TestList2");
    rAlert.setId(2);
    rAlert.setDescription("Second Test List");
    rAlert.setCreator(Context.getUserContext().getAuthenticatedUser());
    rAlert.setDateCreated(new java.util.Date());
    rAlert.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30");
    rAlert.setVoided(Boolean.FALSE);
    rAlert.setProviderSentId(1);
    rAlert.setProviderRecipientId(2);
    dao.deleteRaxaAlert(rAlert);
    RaxaAlert result = dao.getRaxaAlert(2);
    assertEquals(null, result);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

   * Test of getRaxaAlert method, of class HibernateRaxaAlertDAO.
   */
  @Test
  public void testGetRaxaAlert() {
    Integer raxaAlertId = 1;
    RaxaAlert result = dao.getRaxaAlert(raxaAlertId);
    String name = result.getName();
    assertEquals("TestList1", name);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  /**
   * Test of updateRaxaAlert method, of class HibernateRaxaAlertDAO.
   */
  @Test
  public void testUpdateRaxaAlert() {
    RaxaAlert raxaAlert = dao.getRaxaAlert(1);
    raxaAlert.setName("NewNameList");
    dao.updateRaxaAlert(raxaAlert);
    String name = dao.getRaxaAlert(1).getName();
    assertEquals(name, "NewNameList");
  }
View Full Code Here

Examples of org.raxa.module.raxacore.RaxaAlert

  /**
   * Test of markRaxaAlertAsSeen method, of class HibernateRaxaAlertDAO.
   */
  @Test
  public void testMarkRaxaAlertAsSeen() {
    RaxaAlert raxaAlert = dao.getRaxaAlert(1);
    dao.markRaxaAlertAsSeen(raxaAlert);
    Boolean seen = dao.getRaxaAlert(1).getSeen();
    assertEquals(seen, true);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.