Examples of DrugInfo


Examples of org.raxa.module.raxacore.DrugInfo

  @Test
  public void testDeleteDrugInfoShouldUsePrivileges() {
    Context.getUserContext().getAuthenticatedUser().removeRole(Context.getUserService().getRole("System Developer"));
    Drug drug = new Drug();
    drug.setId(3);
    DrugInfo drugInfo = new DrugInfo();
    drugInfo.setDrug(drug);
    drugInfo.setId(2);
    drugInfo.setName("TestDrugInfo2");
    drugInfo.setDescription("Second Test DrugInfo");
    drugInfo.setCreator(Context.getUserContext().getAuthenticatedUser());
    drugInfo.setDateCreated(new java.util.Date());
    drugInfo.setUuid("68547121-1b70-465e-99ee-c9dfd95e7d30");
    drugInfo.setRetired(Boolean.FALSE);
    try {
      s.deleteDrugInfo(drugInfo);
      //if we don't throw exception fail - no privileges required!
      fail("No privileges required for deleteDrugInfo");
    }
View Full Code Here

Examples of org.raxa.module.raxacore.DrugInfo

   */
  @Test
  public void testDeleteDrugInfoShouldDeleteDrugInfo() {
    Drug drug = new Drug();
    drug.setId(3);
    DrugInfo drugInfo = new DrugInfo();
    drugInfo.setDrug(drug);
    drugInfo.setId(2);
    drugInfo.setName("TestDrugInfo2");
    drugInfo.setDescription("Second Test DrugInfo");
    drugInfo.setCreator(Context.getUserContext().getAuthenticatedUser());
    drugInfo.setDateCreated(new java.util.Date());
    drugInfo.setUuid("68547121-1b70-465e-99ee-c9dfd95e7d30");
    drugInfo.setRetired(Boolean.FALSE);
    s.deleteDrugInfo(drugInfo);
    DrugInfo result = s.getDrugInfo(2);
    assertEquals(null, result);
  }
View Full Code Here

Examples of org.raxa.module.raxacore.DrugInfo

    SimpleObject post = new ObjectMapper().readValue(json, SimpleObject.class);
    Object drug = controller.createNewDrug(post, request, response);
    List<DrugInfo> drugInfos = Context.getService(DrugInfoService.class).getAllDrugInfo(true);
    Boolean foundNewDrugInfo = false;
    for (int i = 0; i < drugInfos.size(); i++) {
      DrugInfo di = drugInfos.get(i);
      if (di.getName().equals("Inner DrugInfo")) {
        foundNewDrugInfo = true;
      }
    }
    Assert.assertEquals(true, foundNewDrugInfo);
  }
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.