test_class.file: dubbo-plugin/dubbo-auth/src/test/java/org/apache/dubbo/auth/filter/ProviderAuthFilterTest.java
test_class.identifier: ProviderAuthFilterTest
test_case.body: @Test
      void testAuthFailed() {
          URL url = URL.valueOf("dubbo://10.10.10.10:2181")
                  .addParameter(Constants.ACCESS_KEY_ID_KEY, "ak")
                  .addParameter(Constants.SECRET_ACCESS_KEY_KEY, "sk")
                  .addParameter(CommonConstants.APPLICATION_KEY, "test")
                  .addParameter(Constants.SERVICE_AUTH, true);
          Invoker invoker = mock(Invoker.class);
          Invocation invocation = mock(Invocation.class);
          when(invocation.getAttachment(Constants.REQUEST_SIGNATURE_KEY)).thenReturn(null);
          when(invoker.getUrl()).thenReturn(url);
  
          ProviderAuthFilter providerAuthFilter = new ProviderAuthFilter();
          Result result = providerAuthFilter.invoke(invoker, invocation);
          assertTrue(result.hasException());
  
      }
test_case.class_method_signature: ProviderAuthFilterTest.testAuthFailed()
test_case.full_signature: @Test void testAuthFailed()
test_case.identifier: testAuthFailed
test_case.invocations: addParameter addParameter addParameter addParameter valueOf mock mock thenReturn when getAttachment thenReturn when getUrl invoke assertTrue hasException
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAuthFailed()
focal_class.file: dubbo-plugin/dubbo-auth/src/main/java/org/apache/dubbo/auth/filter/ProviderAuthFilter.java
focal_class.identifier: ProviderAuthFilter
focal_class.interfaces: implements Filter
focal_class.class_method_signature: ProviderAuthFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_class.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Invoker<?> invoker, Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.body: @Override
      public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
          URL url = invoker.getUrl();
          boolean shouldAuth = url.getParameter(Constants.SERVICE_AUTH, false);
          if (shouldAuth) {
              Authenticator authenticator = ExtensionLoader.getExtensionLoader(Authenticator.class)
                      .getExtension(url.getParameter(Constants.AUTHENTICATOR, Constants.DEFAULT_AUTHENTICATOR));
              try {
                  authenticator.authenticate(invocation, url);
              } catch (Exception e) {
                  return AsyncRpcResult.newDefaultAsyncResult(e, invocation);
              }
          }
          return invoker.invoke(invocation);
      }
focal_method.class_method_signature: ProviderAuthFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_method.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.identifier: invoke
focal_method.invocations: getUrl getParameter getExtension getExtensionLoader getParameter authenticate newDefaultAsyncResult invoke
focal_method.modifiers: @Override public
focal_method.parameters: (Invoker<?> invoker, Invocation invocation)
focal_method.return: Result
focal_method.signature: Result invoke(Invoker<?> invoker, Invocation invocation)