Constructor
new module:caplin/alerts/testing/NotificationServiceStub()
- Implements:
- caplin/alerts/NotificationService
Methods
-
createNotification(source, timeCreated, additionalFields) → {module:caplin/alerts/Notification}
-
A stub method used for creating notifications.
Parameters:
Name Type Description source
String The source of the notification. This can be anything, but would generally be the name of the server side component that created the notification. timeCreated
Number Seconds since epoch that the notification was generated. additionalFields
Map A map of additional fields (names to values) for the notification. Returns:
The created notification. -
dismiss(notification, erroropt, successopt)
-
Fires a DISMISS_REQUESTED event (see
module:caplin/alerts/testing/NotificationServiceStubEvents
) if the service status is AVAILABLE, or fires the error callback otherwise.Parameters:
Name Type Attributes Description notification
module:caplin/alerts/Notification The notification to dismiss. error
function <optional>
A callback that will be invoked when the request fails. success
function <optional>
A callback that will be invoked when the request succeeds. -
dispose()
-
Disposes of any listeners and resources that were used by the service.
-
removeNotification(removedNotification)
-
A stub method used for removing notifications without having to respond to a request for a dismiss.
Parameters:
Name Type Description removedNotification
module:caplin/alerts/Notification The notification that has been removed. -
setStatus(status)
-
A stub method used to set the status of the service, representing the availability of its data.
Parameters:
Name Type Description status
module:caplin/services/ServiceStatus The new status of the service