Debian Codegraph @

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