Пример #1
0
 @Test
 public void test1Save() {
   try {
     Roles roles = new Roles();
     roles.setRoleDescription("HZB6NpwntavuY85ulLxNClo2h2wdOwXbYXvlH0tHK5yfufUgrt");
     roles.setRoleHelp("5hWm5pieoyvOMtpiA91wNVYQ7AB53GIHeFDOADrJdhNb5rUFqn");
     roles.setRoleIcon("xfRi413ELOp9f8o0ebrTTUbQCmZFFOi0xPoA13WAUvsmd56snS");
     roles.setRoleName("T9rfQwEGrSCjeLT1NQsI8ZIv13uZug2lg9NgR35HtytJJxmlbd");
     java.util.List<RoleMenuBridge> listOfRoleMenuBridge =
         new java.util.ArrayList<RoleMenuBridge>();
     RoleMenuBridge rolemenubridge = new RoleMenuBridge();
     rolemenubridge.setIsExecute(true);
     rolemenubridge.setIsRead(true);
     rolemenubridge.setIsWrite(true);
     AppMenus appmenus = new AppMenus();
     appmenus.setAppId("Ec5qpVOXEEilvnMnn4CfQINjIkHhqJvIgwFELqgedsBAA1yls3");
     appmenus.setAppType(1);
     appmenus.setMenuAccessRights(8);
     appmenus.setMenuAction("652EKpZyhKQ4IsMc6R3qAcWHlW5bFN7RfmtjiESHoghR03lY6k");
     appmenus.setMenuCommands("r4BMAVJsZ84IixDKVWvk8o2aBcu4ThpgMsiA5hNf03gqvpjfe4");
     appmenus.setMenuDisplay(true);
     appmenus.setMenuHead(true);
     appmenus.setMenuIcon("Wi1LtlHEcFexdKj56JXw1zfFUlKlHjMqFQNizpvU3inu81Wy4Q");
     appmenus.setMenuLabel("AIrvbRhLercHDQlyr8wr1RNcIj2noNnuhvLAibiKaCS6ofklqf");
     appmenus.setMenuTreeId("OPpQtJuwoF4MM6vTJksJczuMnWg0KweGrjFbBqWNssG9C8SIho");
     appmenus.setRefObjectId("CAwswVw9L30lTryo56zmRsZFyGo5kPawVv11lOTwnj6NJQyR2g");
     appmenus.setUiType("SDw");
     AppMenus AppMenusTest = appmenusRepository.save(appmenus);
     map.put("AppMenusPrimaryKey", appmenus._getPrimarykey());
     rolemenubridge.setIsExecute(true);
     rolemenubridge.setIsRead(true);
     rolemenubridge.setIsWrite(true);
     rolemenubridge.setMenuId((java.lang.String) AppMenusTest._getPrimarykey());
     rolemenubridge.setRoles(roles);
     listOfRoleMenuBridge.add(rolemenubridge);
     roles.addAllRoleMenuBridge(listOfRoleMenuBridge);
     roles.setEntityAudit(1, "xyz", RECORD_TYPE.ADD);
     roles.setEntityValidator(entityValidator);
     roles.isValid();
     rolesRepository.save(roles);
     map.put("RolesPrimaryKey", roles._getPrimarykey());
   } catch (com.athena.framework.server.exception.biz.SpartanConstraintViolationException e) {
     org.junit.Assert.fail(e.getMessage());
   } catch (java.lang.Exception e) {
     org.junit.Assert.fail(e.getMessage());
   }
 }
Пример #2
0
 @Test
 public void test2Update() {
   try {
     org.junit.Assert.assertNotNull(map.get("RolesPrimaryKey"));
     Roles roles = rolesRepository.findById((java.lang.String) map.get("RolesPrimaryKey"));
     roles.setRoleDescription("SXRNDqbKmWD6tDaX1Hh68aWllLwxSJvkwtBVQxQxd4jNzx0wIA");
     roles.setRoleHelp("XQxFMWG6DV3BvX9vRNJH8t7aEq3jns6R9HRWdoeOKESp79hagE");
     roles.setRoleIcon("4vDQmIvOkSSZLYt6raSmQzO6teJC1PboRbYEbbGIsQMTvPQ2oy");
     roles.setRoleName("pOKgyUv5LAQ4TWySF6eXNo8Ad47cb3gYgalxqOhCZzyrrubEkb");
     roles.setVersionId(1);
     roles.setEntityAudit(1, "xyz", RECORD_TYPE.UPDATE);
     rolesRepository.update(roles);
   } catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) {
     org.junit.Assert.fail(e.getMessage());
   } catch (java.lang.Exception e) {
     org.junit.Assert.fail(e.getMessage());
   }
 }