@Test public void test3FindById() { try { org.junit.Assert.assertNotNull(map.get("AddressTypePrimaryKey")); addresstypeRepository.findById((java.lang.String) map.get("AddressTypePrimaryKey")); } catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) { org.junit.Assert.fail(e.getMessage()); } catch (Exception e) { org.junit.Assert.fail(e.getMessage()); } }
@Test public void test2Update() { try { org.junit.Assert.assertNotNull(map.get("AddressTypePrimaryKey")); AddressType addresstype = addresstypeRepository.findById((java.lang.String) map.get("AddressTypePrimaryKey")); addresstype.setAddressType("z5ft8OXUBGrY8zsOyexv3q7bT0zc4tRycSAxYAn4mgkxTQLtAa"); addresstype.setAddressTypeDesc("AEukh8ClRChVbnezxiPtcq028dn9KUFbzI4pov5fcXHQxcT8IG"); addresstype.setAddressTypeIcon("fFw4pra2cmu4PfDyzrUZwaIe51Xp7r5O0SRnkXvR915EWPX9Lc"); addresstype.setVersionId(1); addresstype.setEntityAudit(1, "xyz", RECORD_TYPE.UPDATE); addresstypeRepository.update(addresstype); } 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()); } }
@RequestMapping(value = "/findById", method = RequestMethod.POST) @Override public HttpEntity<ResponseBean> findById(@RequestBody FindByBean findByBean) throws SpartanPersistenceException, Exception { com.athena.framework.server.bean.ResponseBean responseBean = new ResponseBean(); org.springframework.http.HttpStatus httpStatus = org.springframework.http.HttpStatus.OK; try { shop.app.shared.location.AddressType lstaddresstype = addressTyperepo.findById((String) findByBean.getFindKey()); responseBean.add("success", true); responseBean.add("message", "Successfully retrived "); responseBean.add("data", lstaddresstype); } catch (org.springframework.transaction.TransactionException e) { throw new com.athena.framework.server.exception.repository.SpartanTransactionException( "can not find ID", e.getRootCause()); } return new org.springframework.http.ResponseEntity<ResponseBean>(responseBean, httpStatus); }