Skip to content

Commit

Permalink
Merge pull request #19 from Unlimity/lenient-mocks
Browse files Browse the repository at this point in the history
Make test mockings lenient
  • Loading branch information
Unlimity authored Sep 20, 2019
2 parents 8feca4a + ae6b3ea commit a9a315d
Show file tree
Hide file tree
Showing 52 changed files with 92 additions and 89 deletions.
2 changes: 1 addition & 1 deletion docs/boots/alltypes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Name | Summary |
|---|---|
| [com.agoda.boots.BootException](../com.agoda.boots/-boot-exception/index.md) | Exception that aggregates the reasons of failure in case a [report](../com.agoda.boots/-report/index.md) has a [failed](../com.agoda.boots/-status/-failed/index.md) state and is not with [single](../com.agoda.boots/-key/-single/index.md) key. |
| [com.agoda.boots.Bootable](../com.agoda.boots/-bootable/index.md) | Main boot component. It is a piece of code that executes any logic required to boot the system properly. |
| [com.agoda.boots.BootException](../com.agoda.boots/-boot-exception/index.md) | Exception that aggregates the reasons of failure in case a [report](../com.agoda.boots/-report/index.md) has a [failed](../com.agoda.boots/-status/-failed/index.md) state and is not with [single](../com.agoda.boots/-key/-single/index.md) key. |
| [com.agoda.boots.Boots](../com.agoda.boots/-boots/index.md) | Main controller object. Used to interact with the library. |
| [com.agoda.boots.Configuration](../com.agoda.boots/-configuration/index.md) | Configuration is used to provide a custom component to the [Boots](../com.agoda.boots/-boots/index.md). By default, all fields are null. When you provide a configuration with some actual values to [configure()](../com.agoda.boots/-boots/configure.md), only non-null will be used to replace current ones. |
| [com.agoda.boots.impl.DefaultExecutor](../com.agoda.boots.impl/-default-executor/index.md) | Default implementation of [Executor](../com.agoda.boots/-executor/index.md) for JVM. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Default implementation of [Executor](../../com.agoda.boots/-executor/index.md) for JVM.

Implementation uses cached [ThreadPoolExecutor](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html) under the hood and is not able
Implementation uses cached [ThreadPoolExecutor](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html) under the hood and is not able
to forward non-concurrent bootables to the main thread, executing them on the thread
that has invoked it.

Expand Down
4 changes: 2 additions & 2 deletions docs/boots/com.agoda.boots.impl/-default-executor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Default implementation of [Executor](../../com.agoda.boots/-executor/index.md) for JVM.

Implementation uses cached [ThreadPoolExecutor](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html) under the hood and is not able
Implementation uses cached [ThreadPoolExecutor](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html) under the hood and is not able
to forward non-concurrent bootables to the main thread, executing them on the thread
that has invoked it.

Expand All @@ -29,7 +29,7 @@ execution of concurrent ones.
|---|---|
| [capacity](capacity.md) | `open val capacity: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>maximum concurrent threads capacity |
| [isMainThreadSupported](is-main-thread-supported.md) | `open val isMainThreadSupported: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>true if executor can execute given function on main thread (switch context) |
| [pool](pool.md) | `val pool: `[`ExecutorService`](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html) |
| [pool](pool.md) | `val pool: `[`ExecutorService`](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html) |

### Functions

Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots.impl/-default-executor/pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# pool

`protected val pool: `[`ExecutorService`](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html)
`protected val pool: `[`ExecutorService`](https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html)
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots.impl/-default-notifier/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ All calls are synchronous.
| Name | Summary |
|---|---|
| [add](add.md) | `open fun add(key: `[`Key`](../../com.agoda.boots/-key/index.md)`, listener: `[`Listener`](../../com.agoda.boots/-listener/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Enables given listener to receive event callbacks for given key. |
| [notify](notify.md) | `open fun notify(key: `[`Single`](../../com.agoda.boots/-key/-single/index.md)`, report: `[`Report`](../../com.agoda.boots/-report/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Informs the notifier about bootable state change in the boot system so that it can check if there is any listener that it need to call back and invoke any found ones. |
| [notify](notify.md) | `open fun notify(key: `[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, report: `[`Report`](../../com.agoda.boots/-report/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Informs the notifier about bootable state change in the boot system so that it can check if there is any listener that it need to call back and invoke any found ones. |
| [remove](remove.md) | `open fun remove(key: `[`Key`](../../com.agoda.boots/-key/index.md)`, listener: `[`Listener`](../../com.agoda.boots/-listener/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Disables given listener to receive event callbacks for given key.`open fun remove(listener: `[`Listener`](../../com.agoda.boots/-listener/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Disables given listener to receive event callbacks for all events. |
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# notify

`open fun notify(key: `[`Single`](../../com.agoda.boots/-key/-single/index.md)`, report: `[`Report`](../../com.agoda.boots/-report/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
`open fun notify(key: `[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, report: `[`Report`](../../com.agoda.boots/-report/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)

Overrides [Notifier.notify](../../com.agoda.boots/-notifier/notify.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/boots/com.agoda.boots.impl/-default-reporter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ otherwise it generates new combined report on every request.
| [boots](boots.md) | `open val boots: `[`MutableMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[`Key`](../../com.agoda.boots/-key/index.md)`, `[`Bootable`](../../com.agoda.boots/-bootable/index.md)`>`<br>map of bootables added to the system |
| [executor](executor.md) | `open lateinit var executor: `[`Executor`](../../com.agoda.boots/-executor/index.md)<br>instance of [Executor](../../com.agoda.boots/-executor/index.md) used by the system |
| [logger](logger.md) | `open var logger: `[`Logger`](../../com.agoda.boots/-logger/index.md)`?`<br>instance of [Logger](../../com.agoda.boots/-logger/index.md) used by the system |
| [reports](reports.md) | `val reports: `[`MutableMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[`Single`](../../com.agoda.boots/-key/-single/index.md)`, `[`Report`](../../com.agoda.boots/-report/index.md)`>`<br>container of [single](../../com.agoda.boots/-key/-single/index.md) reports. |
| [reports](reports.md) | `val reports: `[`MutableMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, `[`Report`](../../com.agoda.boots/-report/index.md)`>`<br>container of [single](../../com.agoda.boots/-key/-single/index.md) reports. |

### Functions

| Name | Summary |
|---|---|
| [get](get.md) | `open fun get(key: `[`Key`](../../com.agoda.boots/-key/index.md)`): `[`Report`](../../com.agoda.boots/-report/index.md)<br>Retrieves the [report](../../com.agoda.boots/-report/index.md) for a given key. In case where [key](../../com.agoda.boots/-reporter/get.md#com.agoda.boots.Reporter$get(com.agoda.boots.Key)/key) is not [single](../../com.agoda.boots/-key/-single/index.md), reporter generates combined report based on the type of the [key](../../com.agoda.boots/-reporter/get.md#com.agoda.boots.Reporter$get(com.agoda.boots.Key)/key). |
| [set](set.md) | `open fun set(key: `[`Single`](../../com.agoda.boots/-key/-single/index.md)`, status: `[`Status`](../../com.agoda.boots/-status/index.md)`, start: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, time: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`): `[`Report`](../../com.agoda.boots/-report/index.md)<br>Saves the report data from a controller [object](../../com.agoda.boots/-boots/index.md). |
| [set](set.md) | `open fun set(key: `[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, status: `[`Status`](../../com.agoda.boots/-status/index.md)`, start: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, time: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`): `[`Report`](../../com.agoda.boots/-report/index.md)<br>Saves the report data from a controller [object](../../com.agoda.boots/-boots/index.md). |
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# reports

`protected val reports: `[`MutableMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[`Single`](../../com.agoda.boots/-key/-single/index.md)`, `[`Report`](../../com.agoda.boots/-report/index.md)`>`
`protected val reports: `[`MutableMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)`<`[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, `[`Report`](../../com.agoda.boots/-report/index.md)`>`

container of [single](../../com.agoda.boots/-key/-single/index.md) reports.

Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots.impl/-default-reporter/set.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# set

`open fun set(key: `[`Single`](../../com.agoda.boots/-key/-single/index.md)`, status: `[`Status`](../../com.agoda.boots/-status/index.md)`, start: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, time: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`): `[`Report`](../../com.agoda.boots/-report/index.md)
`open fun set(key: `[`Key.Single`](../../com.agoda.boots/-key/-single/index.md)`, status: `[`Status`](../../com.agoda.boots/-status/index.md)`, start: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, time: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`): `[`Report`](../../com.agoda.boots/-report/index.md)

Overrides [Reporter.set](../../com.agoda.boots/-reporter/set.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots/-bootable/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# dependencies

`open val dependencies: `[`Multiple`](../-key/-multiple/index.md)
`open val dependencies: `[`Key.Multiple`](../-key/-multiple/index.md)

dependencies of the bootable. System will not proceed with
invoking the bootable until all bootables with given keys
Expand Down
4 changes: 2 additions & 2 deletions docs/boots/com.agoda.boots/-bootable/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ any logic required to boot the system properly.

| Name | Summary |
|---|---|
| [dependencies](dependencies.md) | `open val dependencies: `[`Multiple`](../-key/-multiple/index.md)<br>dependencies of the bootable. System will not proceed with invoking the bootable until all bootables with given keys have successfully executed. |
| [dependencies](dependencies.md) | `open val dependencies: `[`Key.Multiple`](../-key/-multiple/index.md)<br>dependencies of the bootable. System will not proceed with invoking the bootable until all bootables with given keys have successfully executed. |
| [isConcurrent](is-concurrent.md) | `open val isConcurrent: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>flag that indicates that this bootable can be executed on a separate thread. |
| [isCritical](is-critical.md) | `open val isCritical: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Flag that indicated that this bootable is critical to the boot process and should be started ASAP at all times. That means that even if you request some other bootable to be executed, the system will boot all critical bootables before actually start any non-critical bootable. Also, if critical bootable fails to boot, all boot tasks will stop immediately and all listeners will be called back with failure. |
| [key](key.md) | `abstract val key: `[`Single`](../-key/-single/index.md)<br>unique identifier of the bootable |
| [key](key.md) | `abstract val key: `[`Key.Single`](../-key/-single/index.md)<br>unique identifier of the bootable |

### Functions

Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots/-bootable/key.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# key

`abstract val key: `[`Single`](../-key/-single/index.md)
`abstract val key: `[`Key.Single`](../-key/-single/index.md)

unique identifier of the bootable

Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots/-boots/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# add

`fun add(key: `[`Single`](../-key/-single/index.md)`, dependencies: `[`Multiple`](../-key/-multiple/index.md)` = multiple(), isConcurrent: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true, isCritical: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, boot: () -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
`fun add(key: `[`Key.Single`](../-key/-single/index.md)`, dependencies: `[`Key.Multiple`](../-key/-multiple/index.md)` = multiple(), isConcurrent: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = true, isCritical: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = false, boot: () -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)

Creates instance of bootable and adds it to the system's pool as well
as to components ([Reporter](../-reporter/index.md), [Notifier](../-notifier/index.md), [Sequencer](../-sequencer/index.md)).
Expand Down
2 changes: 1 addition & 1 deletion docs/boots/com.agoda.boots/-boots/boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ handling threading, measuring the performance.
**Return**
created listener instance

`@JvmStatic fun boot(key: `[`Key`](../-key/index.md)`, listener: `[`Builder`](../-listener/-builder/index.md)`): `[`Listener`](../-listener/index.md)
`@JvmStatic fun boot(key: `[`Key`](../-key/index.md)`, listener: `[`Listener.Builder`](../-listener/-builder/index.md)`): `[`Listener`](../-listener/index.md)

Requests library to boot given bootable/bootables satisfying
it's dependencies and critical bootables before.
Expand Down
Loading

0 comments on commit a9a315d

Please sign in to comment.