public static Optional<Object> doLogin(final String username, final String password, final String url) throws IOException {
        Map<String, Object> loginMap = new HashMap<>(2);
        loginMap.put(Constants.LOGIN_NAME, username);
        loginMap.put(Constants.PASS_WORD, password);
        String result = OkHttpTools.getInstance().get(url, loginMap);
        Map<String, Object> resultMap = GsonUtils.getInstance().convertToMap(result);
        if (!String.valueOf(CommonErrorCode.SUCCESSFUL).equals(String.valueOf(resultMap.get(Constants.ADMIN_RESULT_CODE)))) {
            return Optional.empty();
        }
        String tokenJson = GsonUtils.getInstance().toJson(resultMap.get(Constants.ADMIN_RESULT_DATA));
        LOGGER.info("login success: {} ", tokenJson);
        Map<String, Object> tokenMap = GsonUtils.getInstance().convertToMap(tokenJson);
        return Optional.ofNullable(tokenMap.get(Constants.ADMIN_RESULT_TOKEN));
    }
@Test
    public void testDoLoginError() throws IOException {
        final String userName = "userName";
        final String password = "password";
        Map<String, Object> loginMap = new HashMap<>(2);
        loginMap.put(Constants.LOGIN_NAME, userName);
        loginMap.put(Constants.PASS_WORD, password);
        when(okHttpTools.get(url, loginMap)).thenReturn("{\"code\":300}");
        try (MockedStatic<OkHttpTools> okHttpToolsMockedStatic = mockStatic(OkHttpTools.class)) {
            okHttpToolsMockedStatic.when(OkHttpTools::getInstance).thenReturn(okHttpTools);
            Optional<Object> objectOptional = RegisterUtils.doLogin(userName, password, url);
            Assertions.assertFalse(objectOptional.isPresent());
        }
    }