### Question:
AuthService implements IAuthService { @Override public Result authenticate(String authentication, String url, String method) { return authProvider.auth(authentication, url, method); }  @Override Result authenticate(String authentication, String url, String method); @Override boolean ignoreAuthentication(String url); @Override boolean hasPermission(Result authResult); @Override boolean hasPermission(String authentication, String url, String method); @Override boolean invalidJwtAccessToken(String authentication); @Override Jwt getJwt(String authentication);  }### Answer:
@Test public void testAuthenticate_假如用户authentication正确且有对请求url有权限_当用户请求该url_那么返回成功有权限() { when(authProvider.auth(BEARER + VALID_TOKEN, "/users", "POST")).thenReturn(Result.success(true)); Assert.assertTrue((Boolean) authService.authenticate(BEARER + VALID_TOKEN, "/users", "POST").getData()); }
@Test public void testAuthenticate_假如用户authentication正确且有对请求url只有POST权限_当用户请求该url的GET_那么返回成功无权限() { when(authProvider.auth(BEARER + VALID_TOKEN, "/users", "GET")).thenReturn(Result.success(false)); Assert.assertFalse((Boolean) authService.authenticate(BEARER + VALID_TOKEN, "/users", "GET").getData()); }