@@ -73,6 +73,9 @@ fetchMock.mock('https://cloudmanager.adobe.io/api/program/4', {
7373 } ,
7474 'http://ns.adobe.com/adobecloud/rel/pipelines' : {
7575 href : '/api/program/4/pipelines'
76+ } ,
77+ 'http://ns.adobe.com/adobecloud/rel/environments' : {
78+ href : '/api/program/4/environments'
7679 }
7780 }
7881} )
@@ -81,6 +84,58 @@ fetchMock.mock('https://cloudmanager.adobe.io/api/program/4/pipelines', {
8184 pipelines : [ ]
8285 }
8386} )
87+ fetchMock . mock ( 'https://cloudmanager.adobe.io/api/program/4/environments' , {
88+ "_embedded" : {
89+ "environments" : [
90+ {
91+ "_links" : {
92+ "self" : {
93+ "href" : "/api/program/4/environment/1" ,
94+ "templated" : false
95+ } ,
96+ "http://ns.adobe.com/adobecloud/rel/logs" :{
97+ "href" :"/api/program/4/environment/1884/logs?service={service}&name={name}&days={days}" ,
98+ "templated" : true
99+ }
100+ } ,
101+ "id" : "1" ,
102+ "programId" : "4" ,
103+ "name" : "TestProgram_prod" ,
104+ "description" : "description for TestProgram_prod" ,
105+ "type" : "prod"
106+ } ,
107+ {
108+ "_links" : {
109+ "self" : {
110+ "href" : "/api/program/4/environment/2" ,
111+ "templated" : false
112+ }
113+ } ,
114+ "id" : "2" ,
115+ "programId" : "4" ,
116+ "name" : "TestProgram_stage" ,
117+ "description" : "description for TestProgram_stage" ,
118+ "type" : "stage"
119+ } ,
120+ {
121+ "_links" : {
122+ "self" : {
123+ "href" : "/api/program/4/environment/3" ,
124+ "templated" : false
125+ }
126+ } ,
127+ "id" : "3" ,
128+ "programId" : "4" ,
129+ "name" : "TestProgram_dev" ,
130+ "description" : "description for TestProgram_dev" ,
131+ "type" : "dev"
132+ }
133+ ]
134+ } ,
135+ "_totalNumberOfItems" : 3
136+
137+ } )
138+
84139fetchMock . mock ( 'https://cloudmanager.adobe.io/api/program/5' , {
85140 id : "5" ,
86141 name : "test1" ,
@@ -91,6 +146,9 @@ fetchMock.mock('https://cloudmanager.adobe.io/api/program/5', {
91146 } ,
92147 'http://ns.adobe.com/adobecloud/rel/pipelines' : {
93148 href : '/api/program/5/pipelines'
149+ } ,
150+ 'http://ns.adobe.com/adobecloud/rel/environments' : {
151+ href : '/api/program/5/environments'
94152 }
95153 }
96154} )
@@ -158,6 +216,11 @@ mockResponseWithMethod('https://cloudmanager.adobe.io/api/program/5/pipeline/5/e
158216 location : 'https://cloudmanager.adobe.io/api/program/4/pipeline/8555/execution/12742'
159217 }
160218} ) ;
219+ fetchMock . mock ( 'https://cloudmanager.adobe.io/api/program/5/environments' , {
220+ _embedded : {
221+ environments : [ ]
222+ }
223+ } )
161224
162225mockResponseWithMethod ( 'https://cloudmanager.adobe.io/api/program/5/pipeline/6/execution' , 'GET' , require ( './data/execution1000.json' ) )
163226mockResponseWithMethod ( 'https://cloudmanager.adobe.io/api/program/5/pipeline/6/execution' , 'PUT' , 412 )
@@ -172,10 +235,14 @@ fetchMock.mock('https://cloudmanager.adobe.io/api/program/6', {
172235 } ,
173236 'http://ns.adobe.com/adobecloud/rel/pipelines' : {
174237 href : '/api/program/6/pipelines'
238+ } ,
239+ 'http://ns.adobe.com/adobecloud/rel/environments' : {
240+ href : '/api/program/6/environments'
175241 }
176242 }
177243} )
178244fetchMock . mock ( 'https://cloudmanager.adobe.io/api/program/6/pipelines' , 404 )
245+ mockResponseWithMethod ( 'https://cloudmanager.adobe.io/api/program/6/environments' , 'GET' , 404 )
179246
180247mockResponseWithMethod ( 'https://cloudmanager.adobe.io/api/program/5/pipeline/7/execution/1001' , 'GET' , require ( './data/execution1001.json' ) )
181248mockResponseWithMethod ( 'https://cloudmanager.adobe.io/api/program/5/pipeline/5/execution/1002' , 'GET' , 404 )
0 commit comments