ParamService { public boolean update(Param param) throws Exception { LOG.info("Param update {}", param); try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) { ParamMapper mapper = sqlSession.getMapper(ParamMapper.class); mapper.update(param); sqlSession.commit(); } catch (Exception e) { LOG.error(e.getMessage(), e); throw new Exception(e); } return true; }  List<Param> selectAll(); boolean deleteById(String id); boolean insert(Param param); Param selectById(String id); boolean update(Param param); List<Param> selectByPrimaryKeySelective(Param param);  }
@Test public void testUpdate() throws Exception { Param param = new Param(); param.setId("test_application_1234"); param.setKey("test_score"); param.setValue("100"); param.setWorkerIndex("test_worker-2"); boolean result = paramService.insert(param); assertTrue(result); param.setKey("scoreNew"); param.setValue("100"); param.setWorkerIndex("worker-New"); boolean editResult = paramService.update(param); assertTrue(editResult); Param paramDb2 = paramService.selectByPrimaryKeySelective(param).get(0); compareParams(param, paramDb2); }