test_class.file: dubbo-plugin/dubbo-auth/src/test/java/org/apache/dubbo/auth/AccessKeyAuthenticatorTest.java
test_class.identifier: AccessKeyAuthenticatorTest
test_case.body: @Test
      void testGetSignatureWithParameter() {
          URL url = mock(URL.class);
          when(url.getParameter(Constants.PARAMETER_SIGNATURE_ENABLE_KEY, false)).thenReturn(true);
          Invocation invocation = mock(Invocation.class);
          String secretKey = "123456";
          Object[] params = {"dubbo", new ArrayList()};
          when(invocation.getArguments()).thenReturn(params);
          AccessKeyAuthenticator helper = new AccessKeyAuthenticator();
          String signature = helper.getSignature(url, invocation, secretKey, String.valueOf(System.currentTimeMillis()));
          assertNotNull(signature);
  
          Object[] fakeParams = {"dubbo1", new ArrayList<>()};
          when(invocation.getArguments()).thenReturn(fakeParams);
          String signature1 = helper.getSignature(url, invocation, secretKey, String.valueOf(System.currentTimeMillis()));
          assertNotEquals(signature, signature1);
  
      }
test_case.class_method_signature: AccessKeyAuthenticatorTest.testGetSignatureWithParameter()
test_case.full_signature: @Test void testGetSignatureWithParameter()
test_case.identifier: testGetSignatureWithParameter
test_case.invocations: mock thenReturn when getParameter mock thenReturn when getArguments getSignature valueOf currentTimeMillis assertNotNull thenReturn when getArguments getSignature valueOf currentTimeMillis assertNotEquals
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetSignatureWithParameter()
focal_class.file: dubbo-plugin/dubbo-auth/src/main/java/org/apache/dubbo/auth/AccessKeyAuthenticator.java
focal_class.identifier: AccessKeyAuthenticator
focal_class.interfaces: implements Authenticator
focal_class.class_method_signature: AccessKeyAuthenticator.sign(Invocation invocation, URL url)
focal_class.full_signature: @Override public void sign(Invocation invocation, URL url)
focal_class.identifier: sign
focal_class.modifiers: @Override public
focal_class.parameters: (Invocation invocation, URL url)
focal_class.return: void
focal_class.signature: void sign(Invocation invocation, URL url)
focal_class.class_method_signature: AccessKeyAuthenticator.authenticate(Invocation invocation, URL url)
focal_class.full_signature: @Override public void authenticate(Invocation invocation, URL url)
focal_class.identifier: authenticate
focal_class.modifiers: @Override public
focal_class.parameters: (Invocation invocation, URL url)
focal_class.return: void
focal_class.signature: void authenticate(Invocation invocation, URL url)
focal_class.class_method_signature: AccessKeyAuthenticator.getAccessKeyPair(Invocation invocation, URL url)
focal_class.full_signature:  AccessKeyPair getAccessKeyPair(Invocation invocation, URL url)
focal_class.identifier: getAccessKeyPair
focal_class.parameters: (Invocation invocation, URL url)
focal_class.return: AccessKeyPair
focal_class.signature: AccessKeyPair getAccessKeyPair(Invocation invocation, URL url)
focal_class.class_method_signature: AccessKeyAuthenticator.getSignature(URL url, Invocation invocation, String secretKey, String time)
focal_class.full_signature:  String getSignature(URL url, Invocation invocation, String secretKey, String time)
focal_class.identifier: getSignature
focal_class.parameters: (URL url, Invocation invocation, String secretKey, String time)
focal_class.return: String
focal_class.signature: String getSignature(URL url, Invocation invocation, String secretKey, String time)
focal_method.body: String getSignature(URL url, Invocation invocation, String secretKey, String time) {
          boolean parameterEncrypt = url.getParameter(Constants.PARAMETER_SIGNATURE_ENABLE_KEY, false);
          String signature;
          String requestString = String.format(Constants.SIGNATURE_STRING_FORMAT,
                  url.getColonSeparatedKey(), invocation.getMethodName(), secretKey, time);
          if (parameterEncrypt) {
              signature = SignatureUtils.sign(invocation.getArguments(), requestString, secretKey);
          } else {
              signature = SignatureUtils.sign(requestString, secretKey);
          }
          return signature;
      }
focal_method.class_method_signature: AccessKeyAuthenticator.getSignature(URL url, Invocation invocation, String secretKey, String time)
focal_method.full_signature:  String getSignature(URL url, Invocation invocation, String secretKey, String time)
focal_method.identifier: getSignature
focal_method.invocations: getParameter format getColonSeparatedKey getMethodName sign getArguments sign
focal_method.parameters: (URL url, Invocation invocation, String secretKey, String time)
focal_method.return: String
focal_method.signature: String getSignature(URL url, Invocation invocation, String secretKey, String time)