@@ -53,15 +53,15 @@ describe("utils", function(){
53
53
var appSpy = sinon . spy ( app , "get" ) ;
54
54
55
55
// when
56
- utils . addHealthCheck ( app ) ;
56
+ utils . registerHealthCheckEndpoint ( app ) ;
57
57
58
58
// then
59
59
assert ( appSpy . withArgs ( "/health" , sinon . match . func ) . calledOnce ) ;
60
60
} ) ;
61
61
62
- it ( "should set up health check body and call custom callback " , function ( ) {
62
+ it ( "should set up health check body and call custom action " , function ( ) {
63
63
// given
64
- var customCallbackSpy = sinon . spy ( ) ;
64
+ var customActionSpy = sinon . spy ( ) ;
65
65
var res = { send : function ( ) { } } ;
66
66
var resSpy = sinon . spy ( res , "send" ) ;
67
67
var app = {
@@ -71,23 +71,23 @@ describe("utils", function(){
71
71
} ;
72
72
73
73
// when
74
- utils . addHealthCheck ( app , customCallbackSpy ) ;
74
+ utils . registerHealthCheckEndpoint ( app , customActionSpy ) ;
75
75
76
76
// then
77
- assert ( customCallbackSpy . calledOnce ) ;
77
+ assert ( customActionSpy . calledOnce ) ;
78
78
assert ( resSpy . withArgs ( "UP" ) . calledOnce ) ;
79
79
} ) ;
80
80
81
- it ( "should set up health check body and don't call custom callback if undefined" , function ( ) {
81
+ it ( "should set up health check body and don't call custom action if undefined" , function ( ) {
82
82
// given
83
83
var app = {
84
- get : function ( path , healthCheckBody ) {
85
- healthCheckBody ( { } , { send : function ( ) { } } ) ;
84
+ get : function ( path , healthCheckAction ) {
85
+ healthCheckAction ( { } , { send : function ( ) { } } ) ;
86
86
}
87
87
} ;
88
88
89
89
// when
90
- utils . addHealthCheck ( app , undefined ) ;
90
+ utils . registerHealthCheckEndpoint ( app , undefined ) ;
91
91
92
92
// then
93
93
// nothing to check, will fail if undefined would be executed
@@ -103,41 +103,41 @@ describe("utils", function(){
103
103
var appSpy = sinon . spy ( app , "post" ) ;
104
104
105
105
// when
106
- utils . addNotifyEndpoint ( app ) ;
106
+ utils . registerNotificationEndpoint ( app ) ;
107
107
108
108
// then
109
109
assert ( appSpy . withArgs ( "/notify" , sinon . match . func ) . calledOnce ) ;
110
110
} ) ;
111
111
112
- it ( "should set up notify body and call custom callback " , function ( ) {
112
+ it ( "should set up notify body and call custom action " , function ( ) {
113
113
// given
114
- var customCallbackSpy = sinon . spy ( ) ;
114
+ var customActionSpy = sinon . spy ( ) ;
115
115
var res = { send : function ( ) { } } ;
116
116
var resSpy = sinon . spy ( res , "send" ) ;
117
117
var app = {
118
- post : function ( path , notifyBody ) {
119
- notifyBody ( { } , res ) ;
118
+ post : function ( path , notifyAction ) {
119
+ notifyAction ( { } , res ) ;
120
120
}
121
121
} ;
122
122
123
123
// when
124
- utils . addNotifyEndpoint ( app , customCallbackSpy ) ;
124
+ utils . registerNotificationEndpoint ( app , customActionSpy ) ;
125
125
126
126
// then
127
- assert ( customCallbackSpy . calledOnce ) ;
127
+ assert ( customActionSpy . calledOnce ) ;
128
128
assert ( resSpy . withArgs ( "OK" ) . calledOnce ) ;
129
129
} ) ;
130
130
131
- it ( "should set up notify body and don't call custom callback if undefined" , function ( ) {
131
+ it ( "should set up notify body and don't call custom action if undefined" , function ( ) {
132
132
// given
133
133
var app = {
134
- post : function ( path , notifyBody ) {
135
- notifyBody ( { } , { send : function ( ) { } } ) ;
134
+ post : function ( path , notificationAction ) {
135
+ notificationAction ( { } , { send : function ( ) { } } ) ;
136
136
}
137
137
} ;
138
138
139
139
// when
140
- utils . addNotifyEndpoint ( app , undefined ) ;
140
+ utils . registerNotificationEndpoint ( app , undefined ) ;
141
141
142
142
// then
143
143
// nothing to check, will fail if undefined would be executed
0 commit comments