Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
Fix tests from URL Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrandja committed Mar 21, 2019
1 parent 6509dbd commit ccbf68e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public void testGetSignatureBaseString() throws Exception {
String baseString = support.getSignatureBaseString(oauthParams, new URL("https://photos.example.net/photos"),
"geT");
assertEquals(
"GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal",
"GET&https%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal",
baseString);
}

Expand All @@ -463,7 +463,7 @@ public void testGetSignatureBaseStringSimple() throws Exception {

String baseString = support.getSignatureBaseString(oauthParams, new URL("https://photos.example.net/photos"),
"get");
assertEquals("GET&http%3A%2F%2Fphotos.example.net%2Fphotos&bar%3D120%26bar%3D24%26foo%3Dbar", baseString);
assertEquals("GET&https%3A%2F%2Fphotos.example.net%2Fphotos&bar%3D120%26bar%3D24%26foo%3Dbar", baseString);
}

// See SECOAUTH-383
Expand All @@ -477,7 +477,7 @@ public void testGetSignatureBaseStringMultivaluedLast() throws Exception {

String baseString = support.getSignatureBaseString(oauthParams, new URL("https://photos.example.net/photos"),
"get");
assertEquals("GET&http%3A%2F%2Fphotos.example.net%2Fphotos&foo%3Dbar%26pin%3D1%26pin%3D2", baseString);
assertEquals("GET&https%3A%2F%2Fphotos.example.net%2Fphotos&foo%3Dbar%26pin%3D1%26pin%3D2", baseString);
}

static class StreamHandlerForTestingPurposes extends Handler {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void testGetSignatureBaseString() throws Exception {

String baseString = support.getSignatureBaseString(request);
assertEquals(
"GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal",
"GET&https%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal",
baseString);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testAuthenticationSuccess() throws Exception {
handler.setRedirectStrategy(redirectStrategy);

when(request.getAttribute(UserAuthorizationProcessingFilter.CALLBACK_ATTRIBUTE)).thenReturn(
"http://my.host.com/my/context");
"https://my.host.com/my/context");
when(request.getAttribute(UserAuthorizationProcessingFilter.VERIFIER_ATTRIBUTE)).thenReturn("myver");
when(request.getParameter("requestToken")).thenReturn("mytok");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void loadContext(String attributes) {
context = new GenericXmlApplicationContext(new ByteArrayResource(config .getBytes()));
}

private static String HEADER = "<?xml version='1.0' encoding='UTF-8'?><beans xmlns='http://www.springframework.org/schema/beans' xmlns:oauth='http://www.springframework.org/schema/security/oauth2' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.springframework.org/schema/security/oauth2 https://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.0.xsd'>";
private static String HEADER = "<?xml version='1.0' encoding='UTF-8'?><beans xmlns='http://www.springframework.org/schema/beans' xmlns:oauth='http://www.springframework.org/schema/security/oauth2' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.springframework.org/schema/security/oauth2 https://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.0.xsd'>";
private static String FOOTER = "</beans>";
private static String TEMPLATE = "<oauth:resource id='resource' client-id='client' %s/>";
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void testRedirectNotMatchingWithHexEncodedTraversal() throws Exception {
public void testRedirectNotMatchingSubdomain() throws Exception {
Set<String> redirectUris = new HashSet<String>(Arrays.asList("https://anywhere.com/foo"));
client.setRegisteredRedirectUri(redirectUris);
resolver.resolveRedirect("/OZSLZ/foo", client);
resolver.resolveRedirect("https://2anywhere.com/foo", client);
}

// gh-747
Expand Down

0 comments on commit ccbf68e

Please sign in to comment.