Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
fix: add url to Push Notifications service (#379)
Browse files Browse the repository at this point in the history
* fix: Add url to Push Notifications service
* test: increase timeout on all cap test (#380)
* deps: generator-ibm-service-enablement@0.6.0
* feat(swift-deps): CloudEnvironment@6, Configuration@3
  • Loading branch information
EnriqueL8 authored and tunniclm committed Dec 5, 2017
1 parent f2ba505 commit 9660ec7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
6 changes: 3 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,9 @@ module.exports = Generator.extend({
}
}
switch (answers.pushNotificationsRegion) {
case 'United Kingdom': this.bluemix.server.domain = 'eu-gb.bluemix.net'; break
case 'Sydney': this.bluemix.server.domain = 'au-syd.bluemix.net'; break
case 'US South': this.bluemix.server.domain = 'ng.bluemix.net'; break
case 'US South': this.services.push.url = 'http://imfpush.ng.bluemix.net'; break
case 'United Kingdom': this.services.push.url = 'http://imfpush.eu-gb.bluemix.net'; break
case 'Sydney': this.services.push.url = 'http://imfpush.au-syd.bluemix.net'; break
default:
this.env.error(chalk.red(`Internal error: unknown region ${answers.pushNotificationsRegion}`))
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chalk": "^2.1.0",
"debug": "^3.0.0",
"generator-ibm-cloud-enablement": "0.0.114",
"generator-ibm-service-enablement": "0.1.0",
"generator-ibm-service-enablement": "0.6.0",
"handlebars": "^4.0.5",
"ibm-openapi-support": "^0.0.9",
"js-yaml": "^3.9.1",
Expand Down
4 changes: 2 additions & 2 deletions refresh/templates/common/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.0.0")),
.package(url: "https://github.com/IBM-Swift/HeliumLogger.git", .upToNextMinor(from: "1.7.1")),
.package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", .upToNextMinor(from: "4.0.5")),
.package(url: "https://github.com/IBM-Swift/Configuration.git", .upToNextMinor(from: "1.0.0")),
.package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", from: "6.0.0"),
.package(url: "https://github.com/IBM-Swift/Configuration.git", from: "3.0.0"),
<% dependencies.forEach(function(dependency) { -%>
<%- dependency %>
<% }) -%>
Expand Down
8 changes: 2 additions & 6 deletions test/integration/app/prompted_nobuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -1201,12 +1201,8 @@ describe('Integration tests (prompt no build) for swiftserver:app', function ()
commonTest.pushnotifications.itCreatedServiceFilesWithExpectedContent('myPushNotificationsService', {
app_guid: 'myAppGuid',
app_secret: 'myAppSecret',
client_secret: ''
})

it(`push notifications boilerplate contains correct region`, function () {
var serviceFile = `${commonTest.servicesSourceDir}/ServicePush.swift`
assert.fileContent(serviceFile, 'bluemixRegion: PushNotifications.Region.UK')
client_secret: '',
url: 'http://imfpush.eu-gb.bluemix.net'
})
})
})
Expand Down
4 changes: 2 additions & 2 deletions test/lib/common_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,9 @@ exports.alertnotification = {
var serviceFile = `${exports.servicesSourceDir}/${sourceFile}`
assert.fileContent([
[serviceFile, 'import AlertNotifications'],
[serviceFile, 'let serviceCredentials = ServiceCredentials('],
[serviceFile, 'let alertNotificationCredentials = cloudEnv.getAlertNotificationCredentials('],
[serviceFile, 'func initializeServiceAlertNotification(cloudEnv: CloudEnv) throws'],
[serviceFile, 'return serviceCredentials']
[serviceFile, 'return alertNotificationCredentials']
])
})
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1603,14 +1603,14 @@ describe('Unit tests for swiftserver:app', function () {
appType: 'scaffold',
appName: applicationName,
capabilities: [],
bluemix: { server: { domain: 'ng.bluemix.net' } },
services: {
push: {
serviceInfo: {
name: 'myPushNotificationsService'
},
appGuid: 'myAppGuid',
appSecret: 'myAppSecret'
appSecret: 'myAppSecret',
url: 'http://imfpush.ng.bluemix.net'
}
}
}))
Expand Down

0 comments on commit 9660ec7

Please sign in to comment.