We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IClientProfile profile = DefaultProfile.getProfile(xxx, xxx, xxx); DefaultAcsClient client = new DefaultAcsClient(profile) DecryptRequest request = new DecryptRequest(); DecryptResponse response = client.getAcsResponse(request);
How can I write UT and no need to access Aliyun service?
The text was updated successfully, but these errors were encountered:
import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) public class MyKMSClassTest { @Mock DefaultAcsClient mockClient; @Mock DecryptResponse mockResponse; @InjectMocks MyKMSClass myKMSInstance; @Test public void testDecryptValue() throws Exception { when(mockClient.getAcsResponse(any(DecryptRequest.class))).thenReturn(mockResponse); when(mockResponse.getDecryptedValue()).thenReturn("DecryptedValue"); String decryptedValue = myKMSInstance.decryptValue(); assertEquals("DecryptedValue", decryptedValue); verify(mockClient, times(1)).getAcsResponse(any(DecryptRequest.class)); verify(mockResponse, times(1)).getDecryptedValue(); } }
Sorry, something went wrong.
No branches or pull requests
KMS APS like below:
How can I write UT and no need to access Aliyun service?
The text was updated successfully, but these errors were encountered: