const request = require('supertest')
const podsUtils = {
- getFriendsList: getFriendsList,
- makeFriends: makeFriends,
- quitFriends: quitFriends
+ getFriendsList,
+ makeFriends,
+ quitFriends
}
// ---------------------- Export functions --------------------
expectedStatus = 204
}
+ // Which pod makes friends with which pod
+ const friendsMatrix = {
+ 'http://localhost:9001': [
+ 'http://localhost:9002'
+ ],
+ 'http://localhost:9002': [
+ 'http://localhost:9003'
+ ],
+ 'http://localhost:9003': [
+ 'http://localhost:9001'
+ ],
+ 'http://localhost:9004': [
+ 'http://localhost:9002'
+ ],
+ 'http://localhost:9005': [
+ 'http://localhost:9001',
+ 'http://localhost:9004'
+ ],
+ 'http://localhost:9006': [
+ 'http://localhost:9001',
+ 'http://localhost:9002',
+ 'http://localhost:9003'
+ ]
+ }
const path = '/api/v1/pods/makefriends'
// The first pod make friend with the third
request(url)
- .get(path)
+ .post(path)
.set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + accessToken)
+ .send({ 'urls': friendsMatrix[url] })
.expect(expectedStatus)
.end(function (err, res) {
if (err) throw err