Skip to content

Commit

Permalink
Refactor HttpService tests (#53033)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Dec 19, 2019
1 parent 2b7307b commit 4980387
Show file tree
Hide file tree
Showing 79 changed files with 1,293 additions and 1,254 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [addLoadingCount](./kibana-plugin-public.httpservicebase.addloadingcount.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [addLoadingCountSource](./kibana-plugin-public.httpsetup.addloadingcountsource.md)

## HttpServiceBase.addLoadingCount() method
## HttpSetup.addLoadingCountSource() method

Adds a new source of loading counts. Used to show the global loading indicator when sum of all observed counts are more than 0.

<b>Signature:</b>

```typescript
addLoadingCount(countSource$: Observable<number>): void;
addLoadingCountSource(countSource$: Observable<number>): void;
```

## Parameters
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [anonymousPaths](./kibana-plugin-public.httpservicebase.anonymouspaths.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [anonymousPaths](./kibana-plugin-public.httpsetup.anonymouspaths.md)

## HttpServiceBase.anonymousPaths property
## HttpSetup.anonymousPaths property

APIs for denoting certain paths for not requiring authentication

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [basePath](./kibana-plugin-public.httpservicebase.basepath.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [basePath](./kibana-plugin-public.httpsetup.basepath.md)

## HttpServiceBase.basePath property
## HttpSetup.basePath property

APIs for manipulating the basePath on URL segments.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [delete](./kibana-plugin-public.httpservicebase.delete.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [delete](./kibana-plugin-public.httpsetup.delete.md)

## HttpServiceBase.delete property
## HttpSetup.delete property

Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [fetch](./kibana-plugin-public.httpservicebase.fetch.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [fetch](./kibana-plugin-public.httpsetup.fetch.md)

## HttpServiceBase.fetch property
## HttpSetup.fetch property

Makes an HTTP request. Defaults to a GET request unless overriden. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [get](./kibana-plugin-public.httpservicebase.get.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [get](./kibana-plugin-public.httpsetup.get.md)

## HttpServiceBase.get property
## HttpSetup.get property

Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [getLoadingCount$](./kibana-plugin-public.httpservicebase.getloadingcount_.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [getLoadingCount$](./kibana-plugin-public.httpsetup.getloadingcount_.md)

## HttpServiceBase.getLoadingCount$() method
## HttpSetup.getLoadingCount$() method

Get the sum of all loading count sources as a single Observable.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [head](./kibana-plugin-public.httpservicebase.head.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [head](./kibana-plugin-public.httpsetup.head.md)

## HttpServiceBase.head property
## HttpSetup.head property

Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [intercept](./kibana-plugin-public.httpservicebase.intercept.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [intercept](./kibana-plugin-public.httpsetup.intercept.md)

## HttpServiceBase.intercept() method
## HttpSetup.intercept() method

Adds a new [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) to the global HTTP client.

Expand Down
29 changes: 26 additions & 3 deletions docs/development/core/public/kibana-plugin-public.httpsetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,35 @@

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md)

## HttpSetup type
## HttpSetup interface

See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md)

<b>Signature:</b>

```typescript
export declare type HttpSetup = HttpServiceBase;
export interface HttpSetup
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [anonymousPaths](./kibana-plugin-public.httpsetup.anonymouspaths.md) | <code>IAnonymousPaths</code> | APIs for denoting certain paths for not requiring authentication |
| [basePath](./kibana-plugin-public.httpsetup.basepath.md) | <code>IBasePath</code> | APIs for manipulating the basePath on URL segments. |
| [delete](./kibana-plugin-public.httpsetup.delete.md) | <code>HttpHandler</code> | Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [fetch](./kibana-plugin-public.httpsetup.fetch.md) | <code>HttpHandler</code> | Makes an HTTP request. Defaults to a GET request unless overriden. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [get](./kibana-plugin-public.httpsetup.get.md) | <code>HttpHandler</code> | Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [head](./kibana-plugin-public.httpsetup.head.md) | <code>HttpHandler</code> | Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [options](./kibana-plugin-public.httpsetup.options.md) | <code>HttpHandler</code> | Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [patch](./kibana-plugin-public.httpsetup.patch.md) | <code>HttpHandler</code> | Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [post](./kibana-plugin-public.httpsetup.post.md) | <code>HttpHandler</code> | Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |
| [put](./kibana-plugin-public.httpsetup.put.md) | <code>HttpHandler</code> | Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. |

## Methods

| Method | Description |
| --- | --- |
| [addLoadingCountSource(countSource$)](./kibana-plugin-public.httpsetup.addloadingcountsource.md) | Adds a new source of loading counts. Used to show the global loading indicator when sum of all observed counts are more than 0. |
| [getLoadingCount$()](./kibana-plugin-public.httpsetup.getloadingcount_.md) | Get the sum of all loading count sources as a single Observable. |
| [intercept(interceptor)](./kibana-plugin-public.httpsetup.intercept.md) | Adds a new [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) to the global HTTP client. |

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [options](./kibana-plugin-public.httpservicebase.options.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [options](./kibana-plugin-public.httpsetup.options.md)

## HttpServiceBase.options property
## HttpSetup.options property

Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [patch](./kibana-plugin-public.httpservicebase.patch.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [patch](./kibana-plugin-public.httpsetup.patch.md)

## HttpServiceBase.patch property
## HttpSetup.patch property

Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [post](./kibana-plugin-public.httpservicebase.post.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [post](./kibana-plugin-public.httpsetup.post.md)

## HttpServiceBase.post property
## HttpSetup.post property

Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) &gt; [put](./kibana-plugin-public.httpservicebase.put.md)
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md) &gt; [put](./kibana-plugin-public.httpsetup.put.md)

## HttpServiceBase.put property
## HttpSetup.put property

Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## HttpStart type

See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md)
See [HttpSetup](./kibana-plugin-public.httpsetup.md)

<b>Signature:</b>

```typescript
export declare type HttpStart = HttpServiceBase;
export declare type HttpStart = HttpSetup;
```
5 changes: 2 additions & 3 deletions docs/development/core/public/kibana-plugin-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) | |
| [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) | An object that may define global interceptor functions for different parts of the request and response lifecycle. See [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md)<!-- -->. |
| [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) | Fetch API options available to [HttpHandler](./kibana-plugin-public.httphandler.md)<!-- -->s. |
| [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) | |
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | |
| [I18nStart](./kibana-plugin-public.i18nstart.md) | I18nStart.Context is required by any localizable React component from @<!-- -->kbn/i18n and @<!-- -->elastic/eui packages and is supposed to be used as the topmost component for any i18n-compatible React tree. |
| [IAnonymousPaths](./kibana-plugin-public.ianonymouspaths.md) | APIs for denoting paths as not requiring authentication |
| [IBasePath](./kibana-plugin-public.ibasepath.md) | APIs for manipulating the basePath on URL segments. |
Expand Down Expand Up @@ -118,8 +118,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [HandlerContextType](./kibana-plugin-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md) to represent the type of the context. |
| [HandlerFunction](./kibana-plugin-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-public.icontextcontainer.md) |
| [HandlerParameters](./kibana-plugin-public.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md)<!-- -->, excluding the [HandlerContextType](./kibana-plugin-public.handlercontexttype.md)<!-- -->. |
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) |
| [HttpStart](./kibana-plugin-public.httpstart.md) | See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) |
| [HttpStart](./kibana-plugin-public.httpstart.md) | See [HttpSetup](./kibana-plugin-public.httpsetup.md) |
| [IContextProvider](./kibana-plugin-public.icontextprovider.md) | A function that returns a context value for a specific key of given context type. |
| [IToasts](./kibana-plugin-public.itoasts.md) | Methods for adding and removing global toast messages. See [ToastsApi](./kibana-plugin-public.toastsapi.md)<!-- -->. |
| [MountPoint](./kibana-plugin-public.mountpoint.md) | A function that should mount DOM content inside the provided container element and return a handler to unmount it. |
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/core_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class CoreSystem {
const injectedMetadata = await this.injectedMetadata.start();
const uiSettings = await this.uiSettings.start();
const docLinks = await this.docLinks.start({ injectedMetadata });
const http = await this.http.start({ injectedMetadata, fatalErrors: this.fatalErrorsSetup });
const http = await this.http.start({ injectedMetadata, fatalErrors: this.fatalErrorsSetup! });
const savedObjects = await this.savedObjects.start({ http });
const i18n = await this.i18n.start();
const application = await this.application.start({ http, injectedMetadata });
Expand Down
Loading

0 comments on commit 4980387

Please sign in to comment.