Changeset 10201 in josm
- Timestamp:
- 2016-05-13T04:02:38+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/SignpostAdapters.java
r9970 r10201 20 20 } 21 21 22 /** 23 * OAuth provider. 24 */ 22 25 public static class OAuthProvider extends AbstractOAuthProvider { 23 26 27 /** 28 * Constructs a new {@code OAuthProvider}. 29 * @param requestTokenEndpointUrl request token endpoint URL 30 * @param accessTokenEndpointUrl access token endpoint URL 31 * @param authorizationWebsiteUrl authorization website URL 32 */ 24 33 public OAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl, String authorizationWebsiteUrl) { 25 34 super(requestTokenEndpointUrl, accessTokenEndpointUrl, authorizationWebsiteUrl); … … 46 55 } 47 56 57 /** 58 * OAuth consumer. 59 */ 48 60 public static class OAuthConsumer extends AbstractOAuthConsumer { 49 61 62 /** 63 * Constructs a new {@code OAuthConsumer}. 64 * @param consumerKey consumer key 65 * @param consumerSecret consumer secret 66 */ 50 67 public OAuthConsumer(String consumerKey, String consumerSecret) { 51 68 super(consumerKey, consumerSecret); … … 58 75 } 59 76 60 private staticclass HttpRequest implements oauth.signpost.http.HttpRequest {61 privatefinal HttpClient request;77 static final class HttpRequest implements oauth.signpost.http.HttpRequest { 78 final HttpClient request; 62 79 63 80 HttpRequest(HttpClient request) { … … 111 128 } 112 129 113 private staticclass HttpResponse implements oauth.signpost.http.HttpResponse {114 privatefinal HttpClient.Response response;130 static final class HttpResponse implements oauth.signpost.http.HttpResponse { 131 final HttpClient.Response response; 115 132 116 133 HttpResponse(HttpClient.Response response) { … … 138 155 } 139 156 } 140 141 157 } -
trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
r9666 r10201 5 5 import static org.junit.Assert.assertNotEquals; 6 6 import static org.junit.Assert.assertNotNull; 7 import nl.jqno.equalsverifier.EqualsVerifier;8 7 8 import org.junit.BeforeClass; 9 9 import org.junit.Test; 10 import org.openstreetmap.josm.JOSMFixture; 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.io.OsmApi; 13 14 import nl.jqno.equalsverifier.EqualsVerifier; 12 15 13 16 /** … … 15 18 */ 16 19 public class OAuthParametersTest { 20 21 /** 22 * Setup test. 23 */ 24 @BeforeClass 25 public static void setUpBeforeClass() { 26 JOSMFixture.createUnitTestFixture().init(); 27 } 17 28 18 29 /** … … 34 45 35 46 /** 47 * Unit test of method {@link OAuthParameters#createFromPreferences}. 48 */ 49 @Test 50 public void testCreateFromPreferences() { 51 assertNotNull(OAuthParameters.createFromPreferences(Main.pref)); 52 } 53 54 /** 36 55 * Unit test of methods {@link OAuthParameters#equals} and {@link OAuthParameters#hashCode}. 37 56 */ -
trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java
r9666 r10201 4 4 import static org.junit.Assert.assertEquals; 5 5 import static org.junit.Assert.assertNotNull; 6 7 import org.junit.Test; 8 6 9 import nl.jqno.equalsverifier.EqualsVerifier; 7 10 import oauth.signpost.OAuthConsumer; 8 9 import org.junit.Test;10 11 11 12 /** … … 25 26 assertEquals(defCon.getToken(), defTok.getKey()); 26 27 assertEquals(defCon.getTokenSecret(), defTok.getSecret()); 28 assertEquals(defTok, new OAuthToken(defTok)); 27 29 } 28 30
Note:
See TracChangeset
for help on using the changeset viewer.