Index: /trunk/src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java	(revision 9200)
+++ /trunk/src/org/openstreetmap/josm/data/oauth/OsmPrivileges.java	(revision 9201)
@@ -2,4 +2,8 @@
 package org.openstreetmap.josm.data.oauth;
 
+/**
+ * List of permissions granted to the current OSM connection.
+ * @since 2747
+ */
 public class OsmPrivileges {
     private boolean allowWriteApi;
@@ -10,48 +14,96 @@
     private boolean allowModifyNotes;
 
+    /**
+     * Determines if the client is allowed to modify the map.
+     * @return {@code true} if the client is allowed to modify the map, {@code false} otherwise
+     */
     public boolean isAllowWriteApi() {
         return allowWriteApi;
     }
 
+    /**
+     * Sets whether the client is allowed to modify the map.
+     * @param allowWriteApi {@code true} if the client is allowed to modify the map, {@code false} otherwise
+     */
     public void setAllowWriteApi(boolean allowWriteApi) {
         this.allowWriteApi = allowWriteApi;
     }
 
+    /**
+     * Determines if the client is allowed to upload GPS traces.
+     * @return {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise
+     */
     public boolean isAllowWriteGpx() {
         return allowWriteGpx;
     }
 
+    /**
+     * Sets whether the client is allowed to upload GPS traces.
+     * @param allowWriteGpx {@code true} if the client is allowed to upload GPS traces, {@code false} otherwise
+     */
     public void setAllowWriteGpx(boolean allowWriteGpx) {
         this.allowWriteGpx = allowWriteGpx;
     }
 
+    /**
+     * Determines if the client is allowed to read private GPS traces.
+     * @return {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise
+     */
     public boolean isAllowReadGpx() {
         return allowReadGpx;
     }
 
+    /**
+     * Sets whether the client is allowed to read private GPS traces.
+     * @param allowReadGpx {@code true} if the client is allowed to read private GPS traces, {@code false} otherwise
+     */
     public void setAllowReadGpx(boolean allowReadGpx) {
         this.allowReadGpx = allowReadGpx;
     }
 
+    /**
+     * Determines if the client is allowed to read user preferences.
+     * @return {@code true} if the client is allowed to read user preferences, {@code false} otherwise
+     */
     public boolean isAllowReadPrefs() {
         return allowReadPrefs;
     }
 
+    /**
+     * Sets whether the client is allowed to read user preferences.
+     * @param allowReadPrefs {@code true} if the client is allowed to read user preferences, {@code false} otherwise
+     */
     public void setAllowReadPrefs(boolean allowReadPrefs) {
         this.allowReadPrefs = allowReadPrefs;
     }
 
+    /**
+     * Determines if the client is allowed to modify user preferences.
+     * @return {@code true} if the client is allowed to modify user preferences, {@code false} otherwise
+     */
     public boolean isAllowWritePrefs() {
         return allowWritePrefs;
     }
 
+    /**
+     * Sets whether the client is allowed to modify user preferences.
+     * @param allowWritePrefs {@code true} if the client is allowed to modify user preferences, {@code false} otherwise
+     */
     public void setAllowWritePrefs(boolean allowWritePrefs) {
         this.allowWritePrefs = allowWritePrefs;
     }
 
+    /**
+     * Determines if the client is allowed to modify notes.
+     * @return {@code true} if the client is allowed to modify notes, {@code false} otherwise
+     */
     public boolean isAllowModifyNotes() {
         return allowModifyNotes;
     }
 
+    /**
+     * Sets whether the client is allowed to modify notes.
+     * @param allowModifyNotes {@code true} if the client is allowed to modify notes, {@code false} otherwise
+     */
     public void setAllowModifyNotes(boolean allowModifyNotes) {
         this.allowModifyNotes = allowModifyNotes;
Index: /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java	(revision 9201)
+++ /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthParametersTest.java	(revision 9201)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.oauth;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.openstreetmap.josm.io.OsmApi;
+
+/**
+ * Unit tests for class {@link OAuthParameters}.
+ */
+public class OAuthParametersTest {
+
+    /**
+     * Unit test of method {@link OAuthParameters#createDefault}.
+     */
+    @Test
+    public void testCreateDefault() {
+        OAuthParameters def = OAuthParameters.createDefault();
+        assertNotNull(def);
+        assertEquals(def, OAuthParameters.createDefault(OsmApi.DEFAULT_API_URL));
+        OAuthParameters dev = OAuthParameters.createDefault("http://api06.dev.openstreetmap.org/api");
+        assertNotNull(dev);
+        assertNotEquals(def, dev);
+        assertEquals(def, OAuthParameters.createDefault("wrong_url"));
+    }
+
+    /**
+     * Unit test of method {@link OAuthParameters#equals}.
+     */
+    @Test
+    public void testEquals() {
+        OAuthParameters dev = OAuthParameters.createDefault("http://master.apis.dev.openstreetmap.org/api");
+        OAuthParameters dev2 = new OAuthParameters(dev);
+        assertEquals(dev, dev2);
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java	(revision 9201)
+++ /trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java	(revision 9201)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.oauth;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import oauth.signpost.OAuthConsumer;
+
+import org.junit.Test;
+
+/**
+ * Unit tests for class {@link OAuthToken}.
+ */
+public class OAuthTokenTest {
+
+    /**
+     * Unit test of method {@link OAuthToken#createToken}.
+     */
+    @Test
+    public void testCreateToken() {
+        OAuthConsumer defCon = OAuthParameters.createDefault().buildConsumer();
+        assertNotNull(defCon);
+        OAuthToken defTok = OAuthToken.createToken(defCon);
+        assertNotNull(defTok);
+        assertEquals(defCon.getToken(), defTok.getKey());
+        assertEquals(defCon.getTokenSecret(), defTok.getSecret());
+    }
+
+    /**
+     * Unit test of method {@link OAuthToken#equals}.
+     */
+    @Test
+    public void testEquals() {
+        OAuthToken tok = new OAuthToken(
+                OAuthParameters.DEFAULT_JOSM_CONSUMER_KEY,
+                OAuthParameters.DEFAULT_JOSM_CONSUMER_SECRET);
+        OAuthToken tok2 = new OAuthToken(tok);
+        assertEquals(tok, tok2);
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java	(revision 9201)
+++ /trunk/test/unit/org/openstreetmap/josm/data/oauth/OsmPrivilegesTest.java	(revision 9201)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.oauth;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Unit tests for class {@link OsmPrivileges}.
+ */
+public class OsmPrivilegesTest {
+
+    /**
+     * Unit test of getters/setters.
+     */
+    @Test
+    public void testGettersSetters() {
+        OsmPrivileges p = new OsmPrivileges();
+        assertFalse(p.isAllowModifyNotes());
+        assertFalse(p.isAllowReadGpx());
+        assertFalse(p.isAllowReadPrefs());
+        assertFalse(p.isAllowWriteApi());
+        assertFalse(p.isAllowWriteGpx());
+        assertFalse(p.isAllowWritePrefs());
+        p.setAllowModifyNotes(true);
+        assertTrue(p.isAllowModifyNotes());
+        p.setAllowReadGpx(true);
+        assertTrue(p.isAllowReadGpx());
+        p.setAllowReadPrefs(true);
+        assertTrue(p.isAllowReadPrefs());
+        p.setAllowWriteApi(true);
+        assertTrue(p.isAllowWriteApi());
+        p.setAllowWriteGpx(true);
+        assertTrue(p.isAllowWriteGpx());
+        p.setAllowWritePrefs(true);
+        assertTrue(p.isAllowWritePrefs());
+    }
+}
