@@ -12,7 +12,7 @@ import (
1212 fleetdbapi "github.com/metal-toolbox/fleetdb/pkg/api/v1"
1313)
1414
15- func TestServerServiceCreate (t * testing.T ) {
15+ func TestFleetdbCreate (t * testing.T ) {
1616 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
1717 srv := fleetdbapi.Server {UUID : uuid .New (), FacilityCode : "Test1" }
1818 jsonResponse := json .RawMessage ([]byte (`{"message": "resource created", "slug":"00000000-0000-0000-0000-000000001234"}` ))
@@ -27,7 +27,7 @@ func TestServerServiceCreate(t *testing.T) {
2727 })
2828}
2929
30- func TestServerServiceDelete (t * testing.T ) {
30+ func TestFleetdbDelete (t * testing.T ) {
3131 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
3232 jsonResponse := json .RawMessage ([]byte (`{"message": "resource deleted"}` ))
3333 c := mockClient (string (jsonResponse ), respCode )
@@ -36,7 +36,7 @@ func TestServerServiceDelete(t *testing.T) {
3636 return err
3737 })
3838}
39- func TestServerServiceGet (t * testing.T ) {
39+ func TestFleetdbGet (t * testing.T ) {
4040 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
4141 srv := fleetdbapi.Server {UUID : uuid .New (), FacilityCode : "Test1" }
4242 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Record : srv })
@@ -53,7 +53,7 @@ func TestServerServiceGet(t *testing.T) {
5353 })
5454}
5555
56- func TestServerServiceList (t * testing.T ) {
56+ func TestFleetdbList (t * testing.T ) {
5757 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
5858 srv := []fleetdbapi.Server {{UUID : uuid .New (), FacilityCode : "Test1" }}
5959 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : srv })
@@ -69,7 +69,7 @@ func TestServerServiceList(t *testing.T) {
6969 })
7070}
7171
72- func TestServerServiceUpdate (t * testing.T ) {
72+ func TestFleetdbUpdate (t * testing.T ) {
7373 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
7474 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource updated" })
7575 require .Nil (t , err )
@@ -81,7 +81,7 @@ func TestServerServiceUpdate(t *testing.T) {
8181 })
8282}
8383
84- func TestServerServiceCreateAttributes (t * testing.T ) {
84+ func TestFleetdbCreateAttributes (t * testing.T ) {
8585 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
8686 attr := fleetdbapi.Attributes {Namespace : "unit-test" , Data : json .RawMessage ([]byte (`{"test":"unit"}` ))}
8787 jsonResponse := json .RawMessage ([]byte (`{"message": "resource created"}` ))
@@ -92,7 +92,7 @@ func TestServerServiceCreateAttributes(t *testing.T) {
9292 return err
9393 })
9494}
95- func TestServerServiceGetAttributes (t * testing.T ) {
95+ func TestFleetdbGetAttributes (t * testing.T ) {
9696 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
9797 attr := & fleetdbapi.Attributes {Namespace : "unit-test" , Data : json .RawMessage ([]byte (`{"test":"unit"}` ))}
9898 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Record : attr })
@@ -108,7 +108,7 @@ func TestServerServiceGetAttributes(t *testing.T) {
108108 })
109109}
110110
111- func TestServerServiceDeleteAttributes (t * testing.T ) {
111+ func TestFleetdbDeleteAttributes (t * testing.T ) {
112112 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
113113 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource deleted" })
114114 require .Nil (t , err )
@@ -120,7 +120,7 @@ func TestServerServiceDeleteAttributes(t *testing.T) {
120120 })
121121}
122122
123- func TestServerServiceListAttributes (t * testing.T ) {
123+ func TestFleetdbListAttributes (t * testing.T ) {
124124 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
125125 attrs := []fleetdbapi.Attributes {{Namespace : "unit-test" , Data : json .RawMessage ([]byte (`{"test":"unit"}` ))}}
126126 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : attrs })
@@ -136,7 +136,7 @@ func TestServerServiceListAttributes(t *testing.T) {
136136 })
137137}
138138
139- func TestServerServiceUpdateAttributes (t * testing.T ) {
139+ func TestFleetdbUpdateAttributes (t * testing.T ) {
140140 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
141141 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource updated" })
142142 require .Nil (t , err )
@@ -148,7 +148,7 @@ func TestServerServiceUpdateAttributes(t *testing.T) {
148148 })
149149}
150150
151- func TestServerServiceComponentsGet (t * testing.T ) {
151+ func TestFleetdbComponentsGet (t * testing.T ) {
152152 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
153153 sc := []fleetdbapi.ServerComponent {{Name : "unit-test" , Serial : "1234" }}
154154 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : sc })
@@ -164,7 +164,7 @@ func TestServerServiceComponentsGet(t *testing.T) {
164164 })
165165}
166166
167- func TestServerServiceComponentsList (t * testing.T ) {
167+ func TestFleetdbComponentsList (t * testing.T ) {
168168 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
169169 sc := []fleetdbapi.ServerComponent {{Name : "unit-test" , Serial : "1234" }}
170170 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : sc })
@@ -180,7 +180,7 @@ func TestServerServiceComponentsList(t *testing.T) {
180180 })
181181}
182182
183- func TestServerServiceComponentsCreate (t * testing.T ) {
183+ func TestFleetdbComponentsCreate (t * testing.T ) {
184184 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
185185 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource created" })
186186 require .Nil (t , err )
@@ -195,7 +195,7 @@ func TestServerServiceComponentsCreate(t *testing.T) {
195195 })
196196}
197197
198- func TestServerServiceComponentsUpdate (t * testing.T ) {
198+ func TestFleetdbComponentsUpdate (t * testing.T ) {
199199 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
200200 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource updated" })
201201 require .Nil (t , err )
@@ -210,7 +210,7 @@ func TestServerServiceComponentsUpdate(t *testing.T) {
210210 })
211211}
212212
213- func TestServerServiceVersionedAttributeCreate (t * testing.T ) {
213+ func TestFleetdbVersionedAttributeCreate (t * testing.T ) {
214214 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
215215 va := fleetdbapi.VersionedAttributes {Namespace : "unit-test" , Data : json .RawMessage ([]byte (`{"test":"unit"}` ))}
216216 jsonResponse := json .RawMessage ([]byte (`{"message": "resource created", "slug":"the-namespace"}` ))
@@ -225,7 +225,7 @@ func TestServerServiceVersionedAttributeCreate(t *testing.T) {
225225 })
226226}
227227
228- func TestServerServiceGetVersionedAttributess (t * testing.T ) {
228+ func TestFleetdbGetVersionedAttributess (t * testing.T ) {
229229 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
230230 va := []fleetdbapi.VersionedAttributes {{Namespace : "test" , Data : json .RawMessage ([]byte (`{}` ))}}
231231 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : va })
@@ -241,7 +241,7 @@ func TestServerServiceGetVersionedAttributess(t *testing.T) {
241241 })
242242}
243243
244- func TestServerServiceListVersionedAttributess (t * testing.T ) {
244+ func TestFleetdbListVersionedAttributess (t * testing.T ) {
245245 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
246246 va := []fleetdbapi.VersionedAttributes {{Namespace : "test" , Data : json .RawMessage ([]byte (`{}` ))}}
247247 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Records : va })
@@ -257,7 +257,7 @@ func TestServerServiceListVersionedAttributess(t *testing.T) {
257257 })
258258}
259259
260- func TestServerServiceCreateServerComponentFirmware (t * testing.T ) {
260+ func TestFleetdbCreateServerComponentFirmware (t * testing.T ) {
261261 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
262262 firmware := fleetdbapi.ComponentFirmwareVersion {
263263 UUID : uuid .New (),
@@ -277,7 +277,7 @@ func TestServerServiceCreateServerComponentFirmware(t *testing.T) {
277277 })
278278}
279279
280- func TestServerServiceServerComponentFirmwareDelete (t * testing.T ) {
280+ func TestFleetdbServerComponentFirmwareDelete (t * testing.T ) {
281281 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
282282 jsonResponse := json .RawMessage ([]byte (`{"message": "resource deleted"}` ))
283283 c := mockClient (string (jsonResponse ), respCode )
@@ -286,7 +286,7 @@ func TestServerServiceServerComponentFirmwareDelete(t *testing.T) {
286286 return err
287287 })
288288}
289- func TestServerServiceServerComponentFirmwareGet (t * testing.T ) {
289+ func TestFleetdbServerComponentFirmwareGet (t * testing.T ) {
290290 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
291291 firmware := fleetdbapi.ComponentFirmwareVersion {
292292 UUID : uuid .New (),
@@ -310,7 +310,7 @@ func TestServerServiceServerComponentFirmwareGet(t *testing.T) {
310310 })
311311}
312312
313- func TestServerServiceServerComponentFirmwareList (t * testing.T ) {
313+ func TestFleetdbServerComponentFirmwareList (t * testing.T ) {
314314 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
315315 firmware := []fleetdbapi.ComponentFirmwareVersion {{
316316 UUID : uuid .New (),
@@ -331,7 +331,7 @@ func TestServerServiceServerComponentFirmwareList(t *testing.T) {
331331 })
332332}
333333
334- func TestServerServiceServerComponentFirmwareUpdate (t * testing.T ) {
334+ func TestFleetdbServerComponentFirmwareUpdate (t * testing.T ) {
335335 mockClientTests (t , func (ctx context.Context , respCode int , expectError bool ) error {
336336 jsonResponse , err := json .Marshal (fleetdbapi.ServerResponse {Message : "resource updated" })
337337 require .Nil (t , err )
0 commit comments