@@ -139,22 +139,28 @@ func TestProductServiceName(t *testing.T) {
139139 {
140140 description : "standard BaseUrl" ,
141141 obj : Product {
142- BaseUrl : "https://abc.googleapis.com/beta/" ,
142+ Version : & product.Version {
143+ BaseUrl : "https://abc.googleapis.com/beta/" ,
144+ },
143145 },
144146 expected : "abc.googleapis.com" ,
145147 },
146148 {
147149 description : "BaseUrl with locational subdomain" ,
148150 obj : Product {
149- BaseUrl : "https://{{location}}-abc.googleapis.com/ga/" ,
151+ Version : & product.Version {
152+ BaseUrl : "https://{{location}}-abc.googleapis.com/ga/" ,
153+ },
150154 },
151155 expected : "abc.googleapis.com" ,
152156 },
153157 {
154158 description : "BaseUrl and CaiBaseUrl" ,
155159 obj : Product {
156- BaseUrl : "https://abc.googleapis.com/ga/" ,
157- CaiBaseUrl : "https://def.googleapis.com/ga/" ,
160+ Version : & product.Version {
161+ BaseUrl : "https://abc.googleapis.com/ga/" ,
162+ CaiBaseUrl : "https://def.googleapis.com/ga/" ,
163+ },
158164 },
159165 expected : "def.googleapis.com" ,
160166 },
@@ -184,43 +190,55 @@ func TestProductServiceVersion(t *testing.T) {
184190 {
185191 description : "standard BaseUrl" ,
186192 obj : Product {
187- BaseUrl : "https://abc.googleapis.com/v1/" ,
193+ Version : & product.Version {
194+ BaseUrl : "https://abc.googleapis.com/v1/" ,
195+ },
188196 },
189197 expected : "v1" ,
190198 },
191199 {
192200 description : "BaseUrl without trailing /" ,
193201 obj : Product {
194- BaseUrl : "https://abc.googleapis.com/v1" ,
202+ Version : & product.Version {
203+ BaseUrl : "https://abc.googleapis.com/v1" ,
204+ },
195205 },
196206 expected : "v1" ,
197207 },
198208 {
199209 description : "BaseUrl with version of beta" ,
200210 obj : Product {
201- BaseUrl : "https://abc.googleapis.com/beta/" ,
211+ Version : & product.Version {
212+ BaseUrl : "https://abc.googleapis.com/beta/" ,
213+ },
202214 },
203215 expected : "beta" ,
204216 },
205217 {
206218 description : "BaseUrl without valid version" ,
207219 obj : Product {
208- BaseUrl : "https://abc.googleapis.com/other/" ,
220+ Version : & product.Version {
221+ BaseUrl : "https://abc.googleapis.com/other/" ,
222+ },
209223 },
210224 expected : "" ,
211225 },
212226 {
213227 description : "BaseUrl with additional value in path" ,
214228 obj : Product {
215- BaseUrl : "https://abc.googleapis.com/compute/v1/" ,
229+ Version : & product.Version {
230+ BaseUrl : "https://abc.googleapis.com/compute/v1/" ,
231+ },
216232 },
217233 expected : "v1" ,
218234 },
219235 {
220236 description : "standard BaseUrl" ,
221237 obj : Product {
222- BaseUrl : "https://{{location}}-abc.googleapis.com/" ,
223- CaiBaseUrl : "https://abc.googleapis.com/v1/" ,
238+ Version : & product.Version {
239+ BaseUrl : "https://{{location}}-abc.googleapis.com/" ,
240+ CaiBaseUrl : "https://abc.googleapis.com/v1/" ,
241+ },
224242 },
225243 expected : "v1" ,
226244 },
0 commit comments