Skip to content
New issue

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

Add module for jca integration test. #20810

Merged
merged 48 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
16a2ce5
Disable jca integration test.
Apr 12, 2021
293714b
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 14, 2021
735d5dc
Add integration test for jca.
Apr 14, 2021
d071811
Add note.
Apr 14, 2021
09a71cb
fix pipeline error.
Apr 15, 2021
48b2e34
Modify alias name.
Apr 15, 2021
a855bf4
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 15, 2021
bcfdf0c
move integration test to a new model.
Apr 16, 2021
aa24e31
Add resources.json
Apr 20, 2021
9b41ba9
enable integration.
Apr 20, 2021
d205404
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 20, 2021
d41c0e0
fix conflict.
Apr 20, 2021
a7f7ee4
Delete unnecessary changes.
Apr 20, 2021
8620e0c
fix pipeline error.
Apr 20, 2021
a76502d
fix pipeline error.
Apr 20, 2021
246e0dd
fix pipeline error.
Apr 20, 2021
a933415
fix pipeline.
Apr 21, 2021
756ed53
Remove resource.json file in azure-security-test-keyvault-jca module …
Apr 23, 2021
7e3bef8
fix versions error.
Apr 23, 2021
ab12862
try to skip integration test.
Apr 25, 2021
fe6d1e0
Try to skip integration test.
Apr 25, 2021
3af93d0
Enable integration test by environment variable.
Apr 26, 2021
7a33d1e
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 27, 2021
23ea0cf
Put environment property to system property.
Apr 27, 2021
709d0b6
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 27, 2021
788a2c9
Change environment variables to uppercase.
Apr 27, 2021
c5dc064
Try to create certificate.
Apr 28, 2021
0989569
Try to get certificate.
Apr 28, 2021
9c2b3d3
add identity name for resource.json.
Apr 28, 2021
9819f36
Try to get all certificate name.
Apr 28, 2021
d3593b8
Try to get certificate.
Apr 28, 2021
737a980
Try to get env of certificate name.
Apr 29, 2021
17a5810
Try to get certificate name.
Apr 29, 2021
9c2e9eb
Format code.
Apr 29, 2021
d83f493
Format code.
Apr 29, 2021
9fd2035
add log for test.
Apr 30, 2021
d42da3b
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
Apr 30, 2021
c1024c4
merge conflicts.
Apr 30, 2021
859f725
add certificate name.
Apr 30, 2021
d0426a8
remove log codes.
May 6, 2021
8e65e98
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
May 6, 2021
fe2682a
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
May 7, 2021
72e484a
change putSystemProperty method.
May 7, 2021
37155fb
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
May 10, 2021
3c40ed8
Resolve conversation.
May 10, 2021
d4b216b
Merge branch 'master' of git://github.com/Azure/azure-sdk-for-java in…
May 12, 2021
6269898
Replace @BeforeEach with @BeforeAll of junit5 annotation.
May 12, 2021
d0dceb8
fix pipeline error.
May 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ com.azure:azure-security-attestation;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-security-keyvault-administration;4.0.0-beta.6;4.0.0-beta.7
com.azure:azure-security-keyvault-certificates;4.1.7;4.2.0-beta.6
com.azure:azure-security-keyvault-jca;1.0.0-beta.6;1.0.0-beta.7
com.azure:azure-security-test-keyvault-jca;1.0.0;1.0.0
com.azure:azure-security-keyvault-keys;4.2.7;4.3.0-beta.8
com.azure:azure-security-keyvault-secrets;4.2.7;4.3.0-beta.6
com.azure:azure-sdk-template;1.2.1-beta.2;1.2.1-beta.16
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions sdk/keyvault/azure-security-test-keyvault-jca/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Release History
8 changes: 8 additions & 0 deletions sdk/keyvault/azure-security-test-keyvault-jca/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Azure Key Vault JCA client library for Java Test

## Key concepts
## Getting started
## Examples
## Troubleshooting
## Next steps
## Contributing
79 changes: 79 additions & 0 deletions sdk/keyvault/azure-security-test-keyvault-jca/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>azure-client-sdk-parent</artifactId>
<groupId>com.azure</groupId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>

<groupId>com.azure</groupId>
<artifactId>azure-security-test-keyvault-jca</artifactId>
<version>1.0.0</version> <!-- {x-version-update;com.azure:azure-security-test-keyvault-jca;current} -->
<name>JCA Provider for Azure Key Vault Test</name>
<description>The Java Crypto Architecture (JCA) Provider for Azure Key Vault Test</description>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-jca</artifactId>
<version>1.0.0-beta.7</version> <!-- {x-version-update;com.azure:azure-security-keyvault-jca;current} -->
</dependency>

<!-- Apache HttpClient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version> <!-- {x-version-update;org.apache.httpcomponents:httpclient;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.conscrypt</groupId>
<artifactId>conscrypt-openjdk-uber</artifactId>
<version>2.2.1</version> <!-- {x-version-update;org.conscrypt:conscrypt-openjdk-uber;external_dependency} -->
<scope>test</scope>
</dependency>
<!-- Jackson Databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.2</version> <!-- {x-version-update;com.fasterxml.jackson.core:jackson-databind;external_dependency} -->
<scope>test</scope>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.7.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.30</version> <!-- {x-version-update;org.slf4j:slf4j-nop;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.6</version> <!-- {x-version-update;org.springframework:spring-core;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

package com.azure.security.keyvault.jca;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

import java.net.URLEncoder;

Expand All @@ -13,19 +13,19 @@
/**
* The JUnit test for the AuthClient.
*/
@Disabled
@EnabledIfEnvironmentVariable(named = "AZURE_KEYVAULT_CERTIFICATE_NAME", matches = "myalias")
public class AuthClientTest {

/**
* Test getAuthorizationToken method.
*
*
* @throws Exception when a serious error occurs.
*/
@Test
public void testGetAuthorizationToken() throws Exception {
String tenantId = System.getProperty("azure.keyvault.tenant-id");
String clientId = System.getProperty("azure.keyvault.client-id");
String clientSecret = System.getProperty("azure.keyvault.client-secret");
String tenantId = System.getenv("AZURE_KEYVAULT_TENANT_ID");
String clientId = System.getenv("AZURE_KEYVAULT_CLIENT_ID");
String clientSecret = System.getenv("AZURE_KEYVAULT_CLIENT_SECRET");
AuthClient authClient = new AuthClient();
String result = authClient.getAccessToken(
yiliuTo marked this conversation as resolved.
Show resolved Hide resolved
"https://management.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.security.keyvault.jca;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

import static org.junit.jupiter.api.Assertions.assertNotNull;

@EnabledIfEnvironmentVariable(named = "AZURE_KEYVAULT_CERTIFICATE_NAME", matches = "myalias")
public class KeyVaultClientTest {
private static KeyVaultClient keyVaultClient;
private static String certificateName;

@BeforeAll
public static void setEnvironmentProperty() {
keyVaultClient = new KeyVaultClient(
yiliuTo marked this conversation as resolved.
Show resolved Hide resolved
System.getenv("AZURE_KEYVAULT_URI"),
System.getenv("AZURE_KEYVAULT_TENANT_ID"),
System.getenv("AZURE_KEYVAULT_CLIENT_ID"),
System.getenv("AZURE_KEYVAULT_CLIENT_SECRET"));
certificateName = System.getenv("AZURE_KEYVAULT_CERTIFICATE_NAME");
}

@Test
public void testGetAliases() {
assertNotNull(keyVaultClient.getAliases());
yiliuTo marked this conversation as resolved.
Show resolved Hide resolved
}

@Test
public void testGetCertificate() {
assertNotNull(keyVaultClient.getCertificate(certificateName));
}

@Test
public void testGetKey() {
assertNotNull(keyVaultClient.getKey(certificateName, null));
}
}
Loading