/* * Copyright 2014 VMware, Inc. All rights reserved. Licensed under the Apache v2 License. */ package govcd import ( . "gopkg.in/check.v1" ) func (s *S) Test_GetVAppTemplate(c *C) { // Get the Org populated testServer.Response(200, nil, orgExample) org, err := s.vdc.GetVDCOrg() _ = testServer.WaitRequest() testServer.Flush() c.Assert(err, IsNil) // Populate Catalog testServer.Response(200, nil, catalogExample) cat, err := org.FindCatalog("Public Catalog") _ = testServer.WaitRequest() testServer.Flush() // Populate Catalog Item testServer.Response(200, nil, catalogitemExample) catitem, err := cat.FindCatalogItem("CentOS64-32bit") _ = testServer.WaitRequest() testServer.Flush() // Get VAppTemplate testServer.Response(200, nil, vapptemplateExample) vapptemplate, err := catitem.GetVAppTemplate() _ = testServer.WaitRequest() testServer.Flush() c.Assert(err, IsNil) c.Assert(vapptemplate.VAppTemplate.HREF, Equals, "http://localhost:4444/api/vAppTemplate/vappTemplate-40cb9721-5f1a-44f9-b5c3-98c5f518c4f5") c.Assert(vapptemplate.VAppTemplate.Name, Equals, "CentOS64-32bit") c.Assert(vapptemplate.VAppTemplate.Description, Equals, "id: cts-6.4-32bit") } var catalogitemExample = ` id: cts-6.4-32bit 2014-06-04T21:06:43.750Z 4 `