11package com .venafi .vcert .sdk .connectors .cloud ;
22
3- import static org .junit .Assert .assertEquals ;
4-
53import com .venafi .vcert .sdk .Config ;
64import com .venafi .vcert .sdk .connectors .cloud .domain .User ;
75import com .venafi .vcert .sdk .connectors .cloud .domain .UserResponse ;
@@ -38,13 +36,18 @@ public void createAndGetPolicy() throws VCertException {
3836
3937 PolicySpecification policySpecificationReturned = connector .getPolicy (policyName );
4038
41- //The returned policySpecification will have the policy's name so it will copied to the source policySpecification
42- //due it doesn't contain it
39+ //The returned policySpecification will contain the policy's name, which is not part of the source policy spec
40+ //Adding the name to the source policy spec in order to assert both objects.
4341 policySpecification .name (policySpecificationReturned .name ());
44- //The returned policySpecification will contains the default cloud CA, then it will needed
45- //to set it to the policySpecification source
42+
43+ // The returned policySpecification will contain the default cloud CA, which is omitted in the source policy spec
44+ // Adding the default CA to the source policy spec in order to assert both objects.
4645 policySpecification .policy ().certificateAuthority (VCertConstants .CLOUD_DEFAULT_CA );
47-
46+
47+ //The returned policy specification will contain a single user, which is the one who created the policy
48+ //on the first place. Adding this user to the source policy spec in order to assert both objects.
49+ policySpecification .users (new String []{"jenkins@opensource.qa.venafi.io" });
50+
4851 Assertions .assertEquals (policySpecification , policySpecificationReturned );
4952 }
5053
@@ -62,11 +65,15 @@ public void createAndGetPolicyForDigicert() throws VCertException {
6265 connector .setPolicy (policyName , policySpecification );
6366
6467 PolicySpecification policySpecificationReturned = connector .getPolicy (policyName );
65-
66- //The returned policySpecification will have the policy's name so it will copied to the source policySpecification
67- //due it doesn't contain it
68+
69+ //The returned policySpecification will contain the policy's name, which is not part of the source policy spec
70+ //Adding the name to the source policy spec in order to assert both objects.
6871 policySpecification .name (policySpecificationReturned .name ());
69-
72+
73+ //The returned policy specification will contain a single user, which is the one who created the policy
74+ //on the first place. Adding this user to the source policy spec in order to assert both objects.
75+ policySpecification .users (new String []{"jenkins@opensource.qa.venafi.io" });
76+
7077 Assertions .assertEquals (policySpecification , policySpecificationReturned );
7178 }
7279
@@ -84,17 +91,21 @@ public void createAndGetPolicyForEntrust() throws VCertException {
8491 connector .setPolicy (policyName , policySpecification );
8592
8693 PolicySpecification policySpecificationReturned = connector .getPolicy (policyName );
87-
88- //The returned policySpecification will have the policy's name so it will copied to the source policySpecification
89- //due it doesn't contain it
94+
95+ //The returned policySpecification will contain the policy's name, which is not part of the source policy spec
96+ //Adding the name to the source policy spec in order to assert both objects.
9097 policySpecification .name (policySpecificationReturned .name ());
91-
92- assertEquals (policySpecification , policySpecificationReturned );
98+
99+ //The returned policy specification will contain a single user, which is the one who created the policy
100+ //on the first place. Adding this user to the source policy spec in order to assert both objects.
101+ policySpecification .users (new String []{"jenkins@opensource.qa.venafi.io" });
102+
103+ Assertions .assertEquals (policySpecification , policySpecificationReturned );
93104 }
94105
95106 @ Test
96107 @ DisplayName ("Cloud - Testing the userByName endpoint" )
97- public void getUserByName () throws VCertException {
108+ public void getUserByName () {
98109 Config config = null ;
99110 Cloud cloud = Cloud .connect (config );
100111
0 commit comments