Debian Codegraph @

storage/2019-12-12/queue/queues/lifecycle_test.go

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 package queuesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/
2
3 import (
4 "contextscip-go gomod github.com/golang/go/src go1.13 context/"
5 "fmtscip-go gomod github.com/golang/go/src go1.13 fmt/"
6 "logscip-go gomod github.com/golang/go/src go1.13 log/"
7 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
8
9 "github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/"
10 "github.com/tombuildsstuff/giovanni/testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/"
11 )
12
13 var _ StorageQueuescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageQueue# = Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#{}
14
15 func TestQueuesLifecyclescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/TestQueuesLifecycle().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
16 client, err := testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.Buildscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Build().(t)
17 if err != nil {
18 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
19 }
20 ctx := contextscip-go gomod github.com/golang/go/src go1.13 context/.TODOscip-go gomod github.com/golang/go/src go1.13 context/TODO().()
21 resourceGroup := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestrg-%d", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().())
22 accountName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("acctestsa%s", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomStringscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomString().())
23 queueName := fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("queue-%d", testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/.RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().())
24
•25 _, err = client.BuildTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#BuildTestResources().(ctx, resourceGroup, accountName, storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/.Storagescip-go gomod github.com/Azure/azure-sdk-for-go v68.0.0 `github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage`/Storage.)
26 if err != nil {
27 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
28 }
29 defer client.DestroyTestResourcesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#DestroyTestResources().(ctx, resourceGroup, accountName)
30
31 queuesClient := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/NewWithEnvironment().(client.Environmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#Environment.)
32 queuesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#Client. = client.PrepareWithStorageResourceManagerAuthscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/Client#PrepareWithStorageResourceManagerAuth().(queuesClient.Clientscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#Client.)
33
34 // first let's test an empty container
35 _, err = queuesClient.Createscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#Create().(ctx, accountName, queueName, map[string]string{})
36 if err != nil {
37 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error creating: %s", err))
38 }
39
40 // then let's retrieve it to ensure there's no metadata..
41 resp, err := queuesClient.GetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#GetMetaData().(ctx, accountName, queueName)
42 if err != nil {
43 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving MetaData: %s", err)
44 }
45 if len(resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.) != 0 {
46 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected no MetaData but got: %s", err)
47 }
48
49 // then let's add some..
50 updatedMetaData := map[string]string{
51 "band": "panic",
52 "boots": "the-overpass",
53 }
54 _, err = queuesClient.SetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#SetMetaData().(ctx, accountName, queueName, updatedMetaData)
55 if err != nil {
56 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error setting MetaData: %s", err)
57 }
58
59 resp, err = queuesClient.GetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#GetMetaData().(ctx, accountName, queueName)
60 if err != nil {
61 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error re-retrieving MetaData: %s", err)
62 }
63
64 if len(resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.) != 2 {
65 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected metadata to have 2 items but got: %s", resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.)
66 }
67 if resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.["band"] != "panic" {
68 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected `band` to be `panic` but got: %s", resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.["band"])
69 }
70 if resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.["boots"] != "the-overpass" {
71 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected `boots` to be `the-overpass` but got: %s", resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.["boots"])
72 }
73
74 // and woo let's remove it again
75 _, err = queuesClient.SetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#SetMetaData().(ctx, accountName, queueName, map[string]string{})
76 if err != nil {
77 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error setting MetaData: %s", err)
78 }
79
80 resp, err = queuesClient.GetMetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#GetMetaData().(ctx, accountName, queueName)
81 if err != nil {
82 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Error retrieving MetaData: %s", err)
83 }
84 if len(resp.MetaDatascip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/GetMetaDataResult#MetaData.) != 0 {
85 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected no MetaData but got: %s", err)
86 }
87
88 // set some properties
89 props := StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#{
90 Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Logging.: &LoggingConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#{
91 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Version.: "1.0",
92 Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Delete.: true,
93 Readscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Read.: true,
94 Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Write.: true,
95 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
96 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
97 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
98 },
99 },
100 Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors.: &Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#{
101 CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.: []CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#{
102 CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#{
103 AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods.: "GET,PUT",
104 AllowedOriginsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedOrigins.: "http://www.example.com",
105 ExposedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#ExposedHeaders.: "x-tempo-*",
106 AllowedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedHeaders.: "x-tempo-*",
107 MaxAgeInSecondsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#MaxAgeInSeconds.: 500,
108 },
109 CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#{
110 AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods.: "POST",
111 AllowedOriginsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedOrigins.: "http://www.test.com",
112 ExposedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#ExposedHeaders.: "*",
113 AllowedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedHeaders.: "x-method-*",
114 MaxAgeInSecondsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#MaxAgeInSeconds.: 200,
115 },
116 },
117 },
118 HourMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#HourMetrics.: &MetricsConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#{
119 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Version.: "1.0",
120 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled.: false,
121 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
122 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
123 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
124 },
125 },
126 MinuteMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#MinuteMetrics.: &MetricsConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#{
127 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Version.: "1.0",
128 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled.: false,
129 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
130 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
131 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
132 },
133 },
134 }
135 _, err = queuesClient.SetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#SetServiceProperties().(ctx, accountName, props)
136 if err != nil {
137 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetServiceProperties failed: %s", err)
138 }
139
140 properties, err := queuesClient.GetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#GetServiceProperties().(ctx, accountName)
141 if err != nil {
142 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("GetServiceProperties failed: %s", err)
143 }
144
145 if len(properties.Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors..CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.) > 1 {
146 if properties.Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors..CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.[0].AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods. != "GET,PUT" {
147 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("CORS Methods weren't set!")
148 }
149 if properties.Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors..CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.[1].AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods. != "POST" {
150 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("CORS Methods weren't set!")
151 }
152 } else {
153 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("CORS Methods weren't set!")
154 }
155
156 if properties.HourMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#HourMetrics..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled. {
157 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("HourMetrics were enabled when they shouldn't be!")
158 }
159
160 if properties.MinuteMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#MinuteMetrics..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled. {
161 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("MinuteMetrics were enabled when they shouldn't be!")
162 }
163
164 if !properties.Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Logging..Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Write. {
165 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Logging Write's was not enabled when they should be!")
166 }
167
168 includeAPIS := true
169 // set some properties
170 props2 := StorageServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#{
171 Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Logging.: &LoggingConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#{
172 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Version.: "1.0",
173 Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Delete.: true,
174 Readscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Read.: true,
175 Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Write.: true,
176 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
177 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
178 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
179 },
180 },
181 Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors.: &Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#{
182 CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.: []CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#{
183 CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#{
184 AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods.: "PUT",
185 AllowedOriginsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedOrigins.: "http://www.example.com",
186 ExposedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#ExposedHeaders.: "x-tempo-*",
187 AllowedHeadersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedHeaders.: "x-tempo-*",
188 MaxAgeInSecondsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#MaxAgeInSeconds.: 500,
189 },
190 },
191 },
192 HourMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#HourMetrics.: &MetricsConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#{
193 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Version.: "1.0",
194 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled.: true,
195 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
196 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
197 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
198 },
199 IncludeAPIsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#IncludeAPIs.: &includeAPIS,
200 },
201 MinuteMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#MinuteMetrics.: &MetricsConfigscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#{
202 Versionscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Version.: "1.0",
203 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled.: false,
204 RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#RetentionPolicy.: RetentionPolicyscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#{
205 Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Enabled.: true,
206 Daysscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/RetentionPolicy#Days.: 7,
207 },
208 },
209 }
210
211 _, err = queuesClient.SetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#SetServiceProperties().(ctx, accountName, props2)
212 if err != nil {
213 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("SetServiceProperties failed: %s", err)
214 }
215
216 properties, err = queuesClient.GetServicePropertiesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#GetServiceProperties().(ctx, accountName)
217 if err != nil {
218 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("GetServiceProperties failed: %s", err)
219 }
220
221 if len(properties.Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors..CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.) == 1 {
222 if properties.Corsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Cors..CorsRulescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Cors#CorsRule.[0].AllowedMethodsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/CorsRule#AllowedMethods. != "PUT" {
223 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("CORS Methods weren't set!")
224 }
225 } else {
226 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("CORS Methods weren't set!")
227 }
228
229 if !properties.HourMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#HourMetrics..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled. {
230 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("HourMetrics were enabled when they shouldn't be!")
231 }
232
233 if properties.MinuteMetricsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#MinuteMetrics..Enabledscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/MetricsConfig#Enabled. {
234 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("MinuteMetrics were enabled when they shouldn't be!")
235 }
236
237 if !properties.Loggingscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/StorageServiceProperties#Logging..Writescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/LoggingConfig#Write. {
238 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Logging Write's was not enabled when they should be!")
239 }
240
241 logscip-go gomod github.com/golang/go/src go1.13 log/.Printfscip-go gomod github.com/golang/go/src go1.13 log/Printf().("[DEBUG] Deleting..")
242 _, err = queuesClient.Deletescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues`/Client#Delete().(ctx, accountName, queueName)
243 if err != nil {
244 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.13 fmt/Errorf().("Error deleting: %s", err))
245 }
246 }