@@ -88,7 +88,7 @@ describe('test endpoint route', () => {
8888 [ routeConfig , routeHandler ] = routerMock . post . mock . calls . find ( ( [ { path } ] ) =>
8989 path . startsWith ( '/api/endpoint/metadata' )
9090 ) ! ;
91- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'error' ) ;
91+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'error' ) ;
9292 await routeHandler (
9393 createRouteHandlerContext ( mockScopedClient , mockSavedObjectClient ) ,
9494 mockRequest ,
@@ -119,7 +119,7 @@ describe('test endpoint route', () => {
119119 } ,
120120 } ) ;
121121
122- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'error' ) ;
122+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'error' ) ;
123123 mockScopedClient . callAsCurrentUser . mockImplementationOnce ( ( ) =>
124124 Promise . resolve ( ( data as unknown ) as SearchResponse < HostMetadata > )
125125 ) ;
@@ -162,7 +162,7 @@ describe('test endpoint route', () => {
162162 } ,
163163 } ) ;
164164
165- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'error' ) ;
165+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'error' ) ;
166166 mockScopedClient . callAsCurrentUser . mockImplementationOnce ( ( ) =>
167167 Promise . resolve ( ( data as unknown ) as SearchResponse < HostMetadata > )
168168 ) ;
@@ -225,7 +225,7 @@ describe('test endpoint route', () => {
225225 } ,
226226 } )
227227 ) ;
228- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'error' ) ;
228+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'error' ) ;
229229 [ routeConfig , routeHandler ] = routerMock . get . mock . calls . find ( ( [ { path } ] ) =>
230230 path . startsWith ( '/api/endpoint/metadata' )
231231 ) ! ;
@@ -249,7 +249,7 @@ describe('test endpoint route', () => {
249249 const response : SearchResponse < HostMetadata > = ( data as unknown ) as SearchResponse <
250250 HostMetadata
251251 > ;
252- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'online' ) ;
252+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'online' ) ;
253253 mockScopedClient . callAsCurrentUser . mockImplementationOnce ( ( ) => Promise . resolve ( response ) ) ;
254254 [ routeConfig , routeHandler ] = routerMock . get . mock . calls . find ( ( [ { path } ] ) =>
255255 path . startsWith ( '/api/endpoint/metadata' )
@@ -276,7 +276,7 @@ describe('test endpoint route', () => {
276276 const response : SearchResponse < HostMetadata > = ( data as unknown ) as SearchResponse <
277277 HostMetadata
278278 > ;
279- mockAgentService . getAgentStatus = jest . fn ( ) . mockImplementation ( ( ) => {
279+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockImplementation ( ( ) => {
280280 throw Boom . notFound ( 'Agent not found' ) ;
281281 } ) ;
282282 mockScopedClient . callAsCurrentUser . mockImplementationOnce ( ( ) => Promise . resolve ( response ) ) ;
@@ -304,7 +304,7 @@ describe('test endpoint route', () => {
304304 const response : SearchResponse < HostMetadata > = ( data as unknown ) as SearchResponse <
305305 HostMetadata
306306 > ;
307- mockAgentService . getAgentStatus = jest . fn ( ) . mockReturnValue ( 'warning' ) ;
307+ mockAgentService . getAgentStatusById = jest . fn ( ) . mockReturnValue ( 'warning' ) ;
308308 mockScopedClient . callAsCurrentUser . mockImplementationOnce ( ( ) => Promise . resolve ( response ) ) ;
309309 [ routeConfig , routeHandler ] = routerMock . get . mock . calls . find ( ( [ { path } ] ) =>
310310 path . startsWith ( '/api/endpoint/metadata' )
0 commit comments