DefaultAccessKeyStorage implements AccessKeyStorage { @Override public AccessKeyPair getAccessKey(URL url, Invocation invocation) { AccessKeyPair accessKeyPair = new AccessKeyPair(); String accessKeyId = url.getParameter(Constants.ACCESS_KEY_ID_KEY); String secretAccessKey = url.getParameter(Constants.SECRET_ACCESS_KEY_KEY); accessKeyPair.setAccessKey(accessKeyId); accessKeyPair.setSecretKey(secretAccessKey); return accessKeyPair; }  @Override AccessKeyPair getAccessKey(URL url, Invocation invocation);  }
@Test void testGetAccessKey() { URL url = URL.valueOf("dubbo: .addParameter(Constants.ACCESS_KEY_ID_KEY, "ak") .addParameter(Constants.SECRET_ACCESS_KEY_KEY, "sk"); DefaultAccessKeyStorage defaultAccessKeyStorage = new DefaultAccessKeyStorage(); AccessKeyPair accessKey = defaultAccessKeyStorage.getAccessKey(url, mock(Invocation.class)); assertNotNull(accessKey); assertEquals(accessKey.getAccessKey(), "ak"); assertEquals(accessKey.getSecretKey(), "sk"); }