lightWaveCert{Value: certOut.String()},
					}
					server.SetResponseJsonForPath(certDownloadPath, 200, body)
				})

				It("retrieves certificates", func() {
					certList, err := client.GetRootCerts()
					Expect(err).To(BeNil())
					Expect(certList).ToNot(BeNil())
					Expect(len(certList)).To(BeNumerically(">", 0))
				})
			})

			Context("when server responds with unsupported format", func() {
				BeforeEach(func() {
					server.SetResponseForPath(certDownloadPath, 200, "text")
				})

				It("returns an error", func() {
					certList, err := client.GetRootCerts()
					Expect(certList).To(BeNil())
					Expect(err).ToNot(BeNil())
					Expect(err).To(MatchError("invalid character 'e' in literal true (expecting 'r')"))
				})
			})

			Context("when server responds with unparasble cert data", func() {
				BeforeEach(func() {
					body := []lightWaveCert{
						lightWaveCert{Value: "text"},
					}