Skip to content

Commit 0200e24

Browse files
committed
Fixes unit tests
1 parent 3eca82d commit 0200e24

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

NotificationHubs/test/com/windowsazure/messaging/NotificationHubDescriptionWithAllCredentials

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
</WnsCredential>
5555
<GcmCredential>
5656
<Properties>
57+
<Property>
58+
<Name>GcmEndpoint</Name>
59+
<Value>https://fcm.googleapis.com/fcm/send</Value>
60+
</Property>
5761
<Property>
5862
<Name>GoogleApiKey</Name>
5963
<Value>GoogleApiKeyValue</Value>

NotificationHubs/test/com/windowsazure/messaging/NotificationHubDescriptionWithAllCredentialsLowercaseNames

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
</WnsCredential>
5555
<GcmCredential>
5656
<Properties>
57+
<Property>
58+
<Name>GcmEndpoint</Name>
59+
<Value>https://fcm.googleapis.com/fcm/send</Value>
60+
</Property>
5761
<Property>
5862
<Name>googleApiKey</Name>
5963
<Value>GoogleApiKeyValue</Value>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom"><content type="application/xml"><NotificationHubDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><ApnsCredential><Properties><Property><Name>Endpoint</Name><Value>ApnsEndpointValue</Value></Property><Property><Name>ApnsCertificate</Name><Value>ApnsCertificateValue</Value></Property><Property><Name>CertificateKey</Name><Value>ApnsCertificateKeyValue</Value></Property><Property><Name>Thumbprint</Name><Value>ApnsThumbprintValue</Value></Property><Property><Name>Token</Name><Value>ApnsTokenValue</Value></Property><Property><Name>KeyId</Name><Value>ApnsKeyIdValue</Value></Property><Property><Name>AppName</Name><Value>ApnsAppNameValue</Value></Property><Property><Name>AppId</Name><Value>ApnsAppIdValue</Value></Property></Properties></ApnsCredential><WnsCredential><Properties><Property><Name>PackageSid</Name><Value>WnsPackageSidValue</Value></Property><Property><Name>SecretKey</Name><Value>WnsSecretKeyValue</Value></Property></Properties></WnsCredential><GcmCredential><Properties><Property><Name>GoogleApiKey</Name><Value>GoogleApiKeyValue</Value></Property></Properties></GcmCredential><MpnsCredential><Properties><Property><Name>MpnsCertificate</Name><Value>MpnsCertificateValue</Value></Property><Property><Name>CertificateKey</Name><Value>MpnsCertificateKeyValue</Value></Property></Properties></MpnsCredential><AdmCredential><Properties><Property><Name>ClientId</Name><Value>AdmClientIdValue</Value></Property><Property><Name>ClientSecret</Name><Value>AdmClientSecretValue</Value></Property></Properties></AdmCredential><BaiduCredential><Properties><Property><Name>BaiduApiKey</Name><Value>BaiduApiKeyValue</Value></Property><Property><Name>BaiduSecretKey</Name><Value>BaiduSecretKeyValue</Value></Property></Properties></BaiduCredential></NotificationHubDescription></content></entry>
1+
<?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom"><content type="application/xml"><NotificationHubDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"><ApnsCredential><Properties><Property><Name>Endpoint</Name><Value>ApnsEndpointValue</Value></Property><Property><Name>ApnsCertificate</Name><Value>ApnsCertificateValue</Value></Property><Property><Name>CertificateKey</Name><Value>ApnsCertificateKeyValue</Value></Property><Property><Name>Thumbprint</Name><Value>ApnsThumbprintValue</Value></Property><Property><Name>Token</Name><Value>ApnsTokenValue</Value></Property><Property><Name>KeyId</Name><Value>ApnsKeyIdValue</Value></Property><Property><Name>AppName</Name><Value>ApnsAppNameValue</Value></Property><Property><Name>AppId</Name><Value>ApnsAppIdValue</Value></Property></Properties></ApnsCredential><WnsCredential><Properties><Property><Name>PackageSid</Name><Value>WnsPackageSidValue</Value></Property><Property><Name>SecretKey</Name><Value>WnsSecretKeyValue</Value></Property></Properties></WnsCredential><GcmCredential><Properties><Property><Name>GcmEndpoint</Name><Value>https://fcm.googleapis.com/fcm/send</Value></Property><Property><Name>GoogleApiKey</Name><Value>GoogleApiKeyValue</Value></Property></Properties></GcmCredential><MpnsCredential><Properties><Property><Name>MpnsCertificate</Name><Value>MpnsCertificateValue</Value></Property><Property><Name>CertificateKey</Name><Value>MpnsCertificateKeyValue</Value></Property></Properties></MpnsCredential><AdmCredential><Properties><Property><Name>ClientId</Name><Value>AdmClientIdValue</Value></Property><Property><Name>ClientSecret</Name><Value>AdmClientSecretValue</Value></Property></Properties></AdmCredential><BaiduCredential><Properties><Property><Name>BaiduApiKey</Name><Value>BaiduApiKeyValue</Value></Property><Property><Name>BaiduSecretKey</Name><Value>BaiduSecretKeyValue</Value></Property></Properties></BaiduCredential></NotificationHubDescription></content></entry>

NotificationHubs/test/com/windowsazure/messaging/NotificationHubParseTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public class NotificationHubParseTest {
2020

21-
@Test
21+
@Test
2222
public void testParseNotificationHubWithAllCredentials() throws IOException, SAXException {
2323
InputStream inputXml = this.getClass()
2424
.getResourceAsStream("NotificationHubDescriptionWithAllCredentials");
@@ -27,11 +27,12 @@ public void testParseNotificationHubWithAllCredentials() throws IOException, SAX
2727
assertEquals("test-hub", hub.getPath());
2828

2929
String expectedResultXml = IOUtils.toString(this.getClass()
30-
.getResourceAsStream("NotificationHubDescriptionWithAllCredentialsNoSpaces"), StandardCharsets.UTF_8);
30+
.getResourceAsStream("NotificationHubDescriptionWithAllCredentialsNoSpaces"), StandardCharsets.UTF_8)
31+
.trim();
3132
String actualResultXml = hub.getXml();
3233
assertEquals(expectedResultXml, actualResultXml);
3334
}
34-
35+
3536
@Test
3637
public void testParseNotificationHubWithAllCredentialsLowercaseNames() throws IOException, SAXException {
3738
InputStream inputXml = this.getClass()
@@ -41,7 +42,8 @@ public void testParseNotificationHubWithAllCredentialsLowercaseNames() throws IO
4142
assertEquals("test-hub", hub.getPath());
4243

4344
String expectedResultXml = IOUtils.toString(this.getClass()
44-
.getResourceAsStream("NotificationHubDescriptionWithAllCredentialsNoSpaces"), StandardCharsets.UTF_8);
45+
.getResourceAsStream("NotificationHubDescriptionWithAllCredentialsNoSpaces"), StandardCharsets.UTF_8)
46+
.trim();
4547
String actualResultXml = hub.getXml();
4648
assertEquals(expectedResultXml, actualResultXml);
4749
}

0 commit comments

Comments
 (0)