fakeClient.FakeHttpClient.DoRawHttpRequestInt = errorCode
					_, err := hardwareService.FindByIpAddress("169.50.71.69")
					Expect(err).To(HaveOccurred())
				}
			})
		})
	})

	Context("#GetAttachedNetworkStorages", func() {
		BeforeEach(func() {
			fakeClient.FakeHttpClient.DoRawHttpRequestResponse, err = testhelpers.ReadJsonTestFixtures("services", "SoftLayer_Hardware_Service_getAttachedNetworkStorages.json")
			Expect(err).ToNot(HaveOccurred())
		})

		It("sucessfully retrieves SoftLayer_Network_Storage attached to this device", func() {
			storage, err := hardwareService.GetAttachedNetworkStorages(1234567, "iscsi")
			Expect(err).ToNot(HaveOccurred())
			Expect(len(storage)).To(Equal(1))
		})

		Context("when HTTP client returns error codes 40x or 50x", func() {
			It("fails for error code 40x", func() {
				errorCodes := []int{400, 401, 499}
				for _, errorCode := range errorCodes {
					fakeClient.FakeHttpClient.DoRawHttpRequestInt = errorCode

					_, err := hardwareService.GetAttachedNetworkStorages(1234567, "iscsi")
					Expect(err).To(HaveOccurred())
				}
			})