11package backstage
22
33import (
4- "github.com/redhat-ai-dev/rhdh-ai-catalog-cli/test/stub"
4+ "github.com/redhat-ai-dev/rhdh-ai-catalog-cli/test/stub/backstage"
5+ "github.com/redhat-ai-dev/rhdh-ai-catalog-cli/test/stub/common"
56 "testing"
67)
78
89func TestListLocations (t * testing.T ) {
9- ts := stub .CreateServer (t )
10+ ts := backstage .CreateServer (t )
1011 defer ts .Close ()
1112
1213 str , err := SetupBackstageTestRESTClient (ts ).ListLocations ()
13- stub .AssertError (t , err )
14- stub .AssertEqual (t , stub .TestJSONStringIndented , str )
14+ common .AssertError (t , err )
15+ common .AssertEqual (t , common .TestJSONStringIndented , str )
1516}
1617
1718func TestGetLocations (t * testing.T ) {
18- ts := stub .CreateServer (t )
19+ ts := backstage .CreateServer (t )
1920 defer ts .Close ()
2021
2122 key := "key1"
2223 str , err := SetupBackstageTestRESTClient (ts ).GetLocation (key )
23- stub .AssertError (t , err )
24- stub .AssertContains (t , str , []string {key })
24+ common .AssertError (t , err )
25+ common .AssertContains (t , str , []string {key })
2526}
2627
2728func TestGetLocationsError (t * testing.T ) {
28- ts := stub .CreateServer (t )
29+ ts := backstage .CreateServer (t )
2930 defer ts .Close ()
3031
3132 nsName := "404:404"
@@ -36,19 +37,19 @@ func TestGetLocationsError(t *testing.T) {
3637}
3738
3839func TestImportLocation (t * testing.T ) {
39- ts := stub .CreateServer (t )
40+ ts := backstage .CreateServer (t )
4041 defer ts .Close ()
4142
4243 arg := "https://my-repo/my.yaml"
4344 retJSON , err := SetupBackstageTestRESTClient (ts ).ImportLocation (arg )
44- stub .AssertError (t , err )
45+ common .AssertError (t , err )
4546 str , err := SetupBackstageTestRESTClient (ts ).PrintImportLocation (retJSON )
46- stub .AssertError (t , err )
47- stub .AssertContains (t , str , []string {arg })
47+ common .AssertError (t , err )
48+ common .AssertContains (t , str , []string {arg })
4849}
4950
5051func TestImportLocationError (t * testing.T ) {
51- ts := stub .CreateServer (t )
52+ ts := backstage .CreateServer (t )
5253 defer ts .Close ()
5354
5455 arg := ":"
@@ -59,17 +60,17 @@ func TestImportLocationError(t *testing.T) {
5960}
6061
6162func TestDeleteLocation (t * testing.T ) {
62- ts := stub .CreateServer (t )
63+ ts := backstage .CreateServer (t )
6364 defer ts .Close ()
6465
6566 arg := "my-location-id"
6667 str , err := SetupBackstageTestRESTClient (ts ).DeleteLocation (arg )
67- stub .AssertError (t , err )
68- stub .AssertContains (t , str , []string {arg })
68+ common .AssertError (t , err )
69+ common .AssertContains (t , str , []string {arg })
6970}
7071
7172func TestDeleteLocationsError (t * testing.T ) {
72- ts := stub .CreateServer (t )
73+ ts := backstage .CreateServer (t )
7374 defer ts .Close ()
7475
7576 nsName := "404:404"
0 commit comments