Agents { public void update(Agent agent) { WritableAgent writableAgent = new WritableAgent(); writableAgent.setAgentId(agent.getAgentId()); writableAgent.setName(agent.getName()); writableAgent.setDescription(agent.getDescription()); writableAgent.setReportLocationFlag(agent.getReportLocationFlag()); writableAgent.setReportUserChange(agent.isReportUserChange()); writableAgent.setReportUserEnter(agent.isReportUserEnter()); writableAgent.setLogoMediaId(agent.getLogoMediaId()); writableAgent.setRedirectDomain(agent.getRedirectDomain()); String url = WxEndpoint.get("url.agent.set"); String json = JsonMapper.nonEmptyMapper().toJson(writableAgent); logger.info("update agent: {}", json); wxClient.post(url, json); }  static Agents defaultAgents(); static Agents with(CorpSetting corpSetting); void setWxClient(WxClient wxClient); List<Agent> list(); Agent get(int id); void update(Agent agent);  }
@Test public void testUpdate() { Agent agent = Agents.defaultAgents().get(45); agent.setName(agent.getName()); agent.setDescription(agent.getDescription()); Agents.defaultAgents().update(agent); agent = Agents.defaultAgents().get(45); Assert.assertNotNull(agent); }