@@ -32,7 +32,8 @@ func (c *objectStorageClientMocked) EnableServiceExecute(_ context.Context, proj
3232
3333func TestMapFields (t * testing.T ) {
3434 now := time .Now ()
35-
35+ const testRegion = "eu01"
36+ id := fmt .Sprintf ("%s,%s,%s" , "pid" , testRegion , "cgid,cid" )
3637 tests := []struct {
3738 description string
3839 input * objectstorage.CreateAccessKeyResponse
@@ -43,7 +44,7 @@ func TestMapFields(t *testing.T) {
4344 "default_values" ,
4445 & objectstorage.CreateAccessKeyResponse {},
4546 Model {
46- Id : types .StringValue ("pid,cgid,cid" ),
47+ Id : types .StringValue (id ),
4748 ProjectId : types .StringValue ("pid" ),
4849 CredentialsGroupId : types .StringValue ("cgid" ),
4950 CredentialId : types .StringValue ("cid" ),
@@ -64,7 +65,7 @@ func TestMapFields(t *testing.T) {
6465 SecretAccessKey : utils .Ptr ("secret-key" ),
6566 },
6667 Model {
67- Id : types .StringValue ("pid,cgid,cid" ),
68+ Id : types .StringValue (id ),
6869 ProjectId : types .StringValue ("pid" ),
6970 CredentialsGroupId : types .StringValue ("cgid" ),
7071 CredentialId : types .StringValue ("cid" ),
@@ -84,7 +85,7 @@ func TestMapFields(t *testing.T) {
8485 SecretAccessKey : utils .Ptr ("" ),
8586 },
8687 Model {
87- Id : types .StringValue ("pid,cgid,cid" ),
88+ Id : types .StringValue (id ),
8889 ProjectId : types .StringValue ("pid" ),
8990 CredentialsGroupId : types .StringValue ("cgid" ),
9091 CredentialId : types .StringValue ("cid" ),
@@ -102,7 +103,7 @@ func TestMapFields(t *testing.T) {
102103 Expires : utils .Ptr (now .Format (time .RFC3339Nano )),
103104 },
104105 Model {
105- Id : types .StringValue ("pid,cgid,cid" ),
106+ Id : types .StringValue (id ),
106107 ProjectId : types .StringValue ("pid" ),
107108 CredentialsGroupId : types .StringValue ("cgid" ),
108109 CredentialId : types .StringValue ("cid" ),
@@ -153,6 +154,8 @@ func TestMapFields(t *testing.T) {
153154}
154155
155156func TestEnableProject (t * testing.T ) {
157+ const testRegion = "eu01"
158+ id := fmt .Sprintf ("%s,%s,%s" , "pid" , testRegion , "cgid,cid" )
156159 tests := []struct {
157160 description string
158161 expected Model
@@ -162,7 +165,7 @@ func TestEnableProject(t *testing.T) {
162165 {
163166 "default_values" ,
164167 Model {
165- Id : types .StringValue ("pid,cgid,cid" ),
168+ Id : types .StringValue (id ),
166169 ProjectId : types .StringValue ("pid" ),
167170 CredentialsGroupId : types .StringValue ("cgid" ),
168171 CredentialId : types .StringValue ("cid" ),
@@ -177,7 +180,7 @@ func TestEnableProject(t *testing.T) {
177180 {
178181 "error_response" ,
179182 Model {
180- Id : types .StringValue ("pid,cgid,cid" ),
183+ Id : types .StringValue (id ),
181184 ProjectId : types .StringValue ("pid" ),
182185 CredentialsGroupId : types .StringValue ("cgid" ),
183186 CredentialId : types .StringValue ("cid" ),
@@ -213,7 +216,8 @@ func TestEnableProject(t *testing.T) {
213216
214217func TestReadCredentials (t * testing.T ) {
215218 now := time .Now ()
216-
219+ const testRegion = "eu01"
220+ id := fmt .Sprintf ("%s,%s,%s" , "pid" , testRegion , "cgid,cid" )
217221 tests := []struct {
218222 description string
219223 mockedResp * objectstorage.ListAccessKeysResponse
@@ -238,7 +242,7 @@ func TestReadCredentials(t *testing.T) {
238242 },
239243 },
240244 Model {
241- Id : types .StringValue ("pid,cgid,cid" ),
245+ Id : types .StringValue (id ),
242246 ProjectId : types .StringValue ("pid" ),
243247 CredentialsGroupId : types .StringValue ("cgid" ),
244248 CredentialId : types .StringValue ("cid" ),
@@ -274,7 +278,7 @@ func TestReadCredentials(t *testing.T) {
274278 },
275279 },
276280 Model {
277- Id : types .StringValue ("pid,cgid,cid" ),
281+ Id : types .StringValue (id ),
278282 ProjectId : types .StringValue ("pid" ),
279283 CredentialsGroupId : types .StringValue ("cgid" ),
280284 CredentialId : types .StringValue ("cid" ),
@@ -310,7 +314,7 @@ func TestReadCredentials(t *testing.T) {
310314 },
311315 },
312316 Model {
313- Id : types .StringValue ("pid,cgid,cid" ),
317+ Id : types .StringValue (id ),
314318 ProjectId : types .StringValue ("pid" ),
315319 CredentialsGroupId : types .StringValue ("cgid" ),
316320 CredentialId : types .StringValue ("cid" ),
0 commit comments