From 81c583168c6c4ceedd2846f76289d0771809d596 Mon Sep 17 00:00:00 2001 From: "Jason Cooke (MSFT)" Date: Wed, 9 Jan 2013 17:02:22 -0800 Subject: [PATCH 1/2] Remove unneeded casts to string from action See #577 --- .../services/media/ProtectionKeyIntegrationTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/ProtectionKeyIntegrationTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/ProtectionKeyIntegrationTest.java index 972c11f6f20d4..7749249e66a88 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/ProtectionKeyIntegrationTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/ProtectionKeyIntegrationTest.java @@ -30,8 +30,7 @@ public void canGetProtectionKeyId() throws ServiceException { // Arrange // Act - String protectionKeyId = (String) service.action(ProtectionKey - .getProtectionKeyId(ContentKeyType.CommonEncryption)); + String protectionKeyId = service.action(ProtectionKey.getProtectionKeyId(ContentKeyType.CommonEncryption)); // Assert assertNotNull(protectionKeyId); @@ -40,11 +39,10 @@ public void canGetProtectionKeyId() throws ServiceException { @Test public void canGetProtectionKey() throws ServiceException { // Arrange - String protectionKeyId = (String) service.action(ProtectionKey - .getProtectionKeyId(ContentKeyType.CommonEncryption)); + String protectionKeyId = service.action(ProtectionKey.getProtectionKeyId(ContentKeyType.CommonEncryption)); // Act - String protectionKey = (String) service.action(ProtectionKey.getProtectionKey(protectionKeyId)); + String protectionKey = service.action(ProtectionKey.getProtectionKey(protectionKeyId)); // Assert assertNotNull(protectionKey); From 11e5830f126b75fa2108dbcac182b05e9afd1a43 Mon Sep 17 00:00:00 2001 From: "Jason Cooke (MSFT)" Date: Wed, 9 Jan 2013 17:03:08 -0800 Subject: [PATCH 2/2] Fix test warnings Related to the fix for #561 --- .../services/media/implementation/LinkRetrievalTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/LinkRetrievalTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/LinkRetrievalTest.java index 6921efde0edee..6e8c9e0483277 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/LinkRetrievalTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/LinkRetrievalTest.java @@ -84,7 +84,7 @@ public void getFalseWhenLinkIsntThere() { @Test public void canRetrieveEntireLinkByRel() { - LinkInfo link = info.getLink(link2.getRel()); + LinkInfo link = info.getLink(link2.getRel()); assertLinksEqual(link2, link); } @@ -94,7 +94,7 @@ public void getNullWhenLinkIsntThere() { assertNull(info.getLink("noSuchLink")); } - private static void assertLinksEqual(LinkType expected, LinkInfo actual) { + private static void assertLinksEqual(LinkType expected, LinkInfo actual) { assertEquals(expected.getHref(), actual.getHref()); } }