@Test public void testHasPermission_假如用户authentication正确且有对请求url只有POST权限_当用户请求该url的GET_那么返回成功无权限() { when(authProvider.auth(BEARER + VALID_TOKEN, "/users", "GET")).thenReturn(Result.success(false)); Assert.assertFalse(authService.hasPermission(BEARER + VALID_TOKEN, "/users", "GET")); }
@Override public boolean hasPermission(Result authResult) { return authResult.isSuccess() && (boolean) authResult.getData(); }
AuthService implements IAuthService { @Override public boolean hasPermission(Result authResult) { return authResult.isSuccess() && (boolean) authResult.getData(); } }
AuthService implements IAuthService { @Override public boolean hasPermission(Result authResult) { return authResult.isSuccess() && (boolean) authResult.getData(); }  }
AuthService implements IAuthService { @Override public boolean hasPermission(Result authResult) { return authResult.isSuccess() && (boolean) authResult.getData(); }  @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); }
AuthService implements IAuthService { @Override public boolean hasPermission(Result authResult) { return authResult.isSuccess() && (boolean) authResult.getData(); }  @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);  }