### Question:
UserClient { public String login(UserAuthenticateParam param) { JSONObject params = JSONObject.fromObject(param, defaultConfig); return (String) accessor.execute("user.login", params); } UserClient(ZabbixAccessor accessor, JsonConfig defaultConfig); @SuppressWarnings("unchecked") List<User> get(UserGetParam param); String login(UserAuthenticateParam param); @SuppressWarnings("unchecked") List<String> create(UserCreateParam param); @SuppressWarnings("unchecked") List<String> update(UserUpdateParam param); @SuppressWarnings("unchecked") List<String> delete(List<String> userids);  }### Answer:
@Test public void testLogin() throws Exception { Properties properties = new Properties(); properties.load(getClass().getResourceAsStream("/zabbix.properties")); String username = properties.getProperty("zabbix.username"); String password = properties.getProperty("zabbix.password"); UserAuthenticateParam param = new UserAuthenticateParam(); param.setUser(username); param.setPassword(password); String sessionId = client.user().login(param); log.trace(sessionId); }
@Test public void testLogin2() { UserAuthenticateParam param = new UserAuthenticateParam(); param.setUser("dummy"); param.setPassword("dummy"); try { client.user().login(param); fail(); } catch (Exception ignore) { log.trace(ignore.getMessage()); } }