source: josm/trunk/test/unit/org/openstreetmap/josm/data/oauth/OAuthTokenTest.java@ 17442

Last change on this file since 17442 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.oauth;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertNotNull;
6
7import org.junit.jupiter.api.Test;
8import org.openstreetmap.josm.TestUtils;
9
10import nl.jqno.equalsverifier.EqualsVerifier;
11import oauth.signpost.OAuthConsumer;
12
13/**
14 * Unit tests for class {@link OAuthToken}.
15 */
16class OAuthTokenTest {
17
18 /**
19 * Unit test of method {@link OAuthToken#createToken}.
20 */
21 @Test
22 void testCreateToken() {
23 OAuthConsumer defCon = OAuthParameters.createDefault().buildConsumer();
24 assertNotNull(defCon);
25 OAuthToken defTok = OAuthToken.createToken(defCon);
26 assertNotNull(defTok);
27 assertEquals(defCon.getToken(), defTok.getKey());
28 assertEquals(defCon.getTokenSecret(), defTok.getSecret());
29 assertEquals(defTok, new OAuthToken(defTok));
30 }
31
32 /**
33 * Unit test of methods {@link OAuthToken#equals} and {@link OAuthToken#hashCode}.
34 */
35 @Test
36 void testEqualsContract() {
37 TestUtils.assumeWorkingEqualsVerifier();
38 EqualsVerifier.forClass(OAuthToken.class).usingGetClass().verify();
39 }
40}
Note: See TracBrowser for help on using the repository browser.