Skip to content

Commit 6135a0b

Browse files
author
antony
committed
Fix assertions on oauth response as map ordering has changed due to JDK8 but ordering isn't important.
1 parent a7235c8 commit 6135a0b

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ Hit Scribe as hard and with many threads as you like.
4343

4444
* Vimeo
4545

46-
* Yammer
47-
4846
* Windows Live
4947

5048
* and many more! check the [examples folder](http://github.com/fernandezpablo85/scribe-java/tree/master/src/test/java/org/scribe/examples)

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
</distributionManagement>
5151

5252
<dependencies>
53+
<dependency>
54+
<groupId>org.hamcrest</groupId>
55+
<artifactId>hamcrest-junit</artifactId>
56+
<version>2.0.0.0</version>
57+
<scope>test</scope>
58+
</dependency>
5359
<dependency>
5460
<groupId>junit</groupId>
5561
<artifactId>junit</artifactId>

src/test/java/org/scribe/extractors/HeaderExtractorTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import org.scribe.exceptions.*;
77
import org.scribe.model.*;
88
import org.scribe.test.helpers.*;
9+
import static org.hamcrest.core.StringContains.containsString;
10+
import static org.hamcrest.MatcherAssert.assertThat;
911

1012
public class HeaderExtractorTest
1113
{
@@ -23,10 +25,12 @@ public void setup()
2325
@Test
2426
public void shouldExtractStandardHeader()
2527
{
26-
String expected = "OAuth oauth_callback=\"http%3A%2F%2Fexample%2Fcallback\", " + "oauth_signature=\"OAuth-Signature\", "
27-
+ "oauth_consumer_key=\"AS%23%24%5E%2A%40%26\", " + "oauth_timestamp=\"123456\"";
2828
String header = extractor.extract(request);
29-
assertEquals(expected, header);
29+
30+
assertThat(header, containsString("oauth_callback=\"http%3A%2F%2Fexample%2Fcallback\""));
31+
assertThat(header, containsString("oauth_signature=\"OAuth-Signature\""));
32+
assertThat(header, containsString("oauth_consumer_key=\"AS%23%24%5E%2A%40%26\""));
33+
assertThat(header, containsString("oauth_timestamp=\"123456\""));
3034
}
3135

3236
@Test(expected = IllegalArgumentException.class)

0 commit comments

Comments
 (0)