コード例 #1
0
 @Test
 public void test1Save() {
   try {
     Country country = new Country();
     country.setCapital("O67y8JA4cq21CIhG02CtENkMUApstMgX");
     country.setCapitalLatitude(9);
     country.setCapitalLongitude(7);
     country.setCountryCode1("NXY");
     country.setCountryCode2("c0C");
     country.setCountryFlag("n0wGMg5rtJrqPZcb13ZeNJZ35JxtovByhzKd1cOFsEq8FxzoSP");
     country.setCountryName("Mo5wLwjQwzVmQ12zAzvqHTRouSKc5UtKa0EMIuSRcz94DvQtfW");
     country.setCurrencyCode("vhA");
     country.setCurrencyName("JWQYJnymCE5TmwtMLAQojJiz9cZAmEm756abSVQ3wSMOKKCJWd");
     country.setCurrencySymbol("nUeZfjgk1Huj6SmVmmXnIBM0ksPfOpXs");
     country.setIsoNumeric(0);
     Country CountryTest = countryRepository.save(country);
     map.put("CountryPrimaryKey", country._getPrimarykey());
     State state = new State();
     state.setCountryId(
         (java.lang.String) CountryTest._getPrimarykey()); /* ******Adding refrenced table data */
     state.setStateCapital("4RXrfXSwQ4jeRNkPwZHTXf9pJUrOCS0TXg8Ru7dLYpqIVApAY5");
     state.setStateCapitalLatitude(10);
     state.setStateCapitalLongitude(0);
     state.setStateCode(0);
     state.setStateCodeChar2("PFyvmDjV5BkTdToVVeDmlTQRQSLMyuWt");
     state.setStateCodeChar3("jJQ0pGMxhlQyFIBT7r4Ah2yjHGlHNqcu");
     state.setStateDescription("9SCAwqila79ffAwInRqPWAilLtsjzPLT0Sn9WF90hB2wVSVCOq");
     state.setStateFlag("v9CyKDaGX7VbgItZkVfo1TOiHgAiTTGpWszOOCPp2TzEXaAmXg");
     state.setStateName("BRYJgDGDMiahbdn82ovgDfs7lCPCw2uwniarnWGALqRLUOX6Pb");
     State StateTest = stateRepository.save(state);
     map.put("StatePrimaryKey", state._getPrimarykey());
     City city = new City();
     city.setCityCode(3);
     city.setCityCodeChar2("0Ziz6i3ktBouhxSxo9FUAipy7FQw4CLo");
     city.setCityDescription("gx2biID8feMjUa9mVbZpSsZgPsTJdggtdbGFS1QJr7CQEynE25");
     city.setCityFlag("DOpisKgPFBJZ1UzYp3e6aujA43FB3c2sUpvSRAmlviC9OjnydQ");
     city.setCityLatitude(5);
     city.setCityLongitude(1);
     city.setCityName("K73xpCfdVoIdGTEoKrZn0IP6Ryg24eq3CfFeBTXXhbuXqHDAwz");
     city.setCountryId(
         (java.lang.String) CountryTest._getPrimarykey()); /* ******Adding refrenced table data */
     city.setStateId((java.lang.String) StateTest._getPrimarykey());
     city.setEntityAudit(1, "xyz", RECORD_TYPE.ADD);
     city.setEntityValidator(entityValidator);
     city.isValid();
     cityRepository.save(city);
     map.put("CityPrimaryKey", city._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("CityPrimaryKey"));
     City city = cityRepository.findById((java.lang.String) map.get("CityPrimaryKey"));
     city.setCityCode(1);
     city.setCityCodeChar2("FCpxL7pt4hawMCCo9jne6MsaGzgRFAER");
     city.setCityDescription("F7bHUXqShqmoXwSfbwPUde9jKcEvcYakfz1OyFb5qXwvFONOfJ");
     city.setCityFlag("6KnvtEd90IXEKn3xPFwhgZYVjOJJ0V14zTnhyrvRkvPghm7m96");
     city.setCityLatitude(9);
     city.setCityLongitude(3);
     city.setCityName("9D1WpQCtn2Go4XQs19mu7RB333gtq7lg4EXyxSRJOhe2qxFbcp");
     city.setVersionId(1);
     city.setEntityAudit(1, "xyz", RECORD_TYPE.UPDATE);
     cityRepository.update(city);
   } 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());
   }
 }