Ignore:
Timestamp:
2015-10-11T17:28:19+02:00 (6 years ago)
Author:
Don-vip
Message:

improve/cleanup unit tests

Location:
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandlerTest.java

    r8624 r8857  
    77import org.junit.Test;
    88
     9/**
     10 * Unit tests of {@link ImportHandler} class.
     11 */
    912public class ImportHandlerTest {
    1013
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandlerTest.java

    r8624 r8857  
    22package org.openstreetmap.josm.io.remotecontrol.handler;
    33
    4 import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.assertThat;
     4import static org.junit.Assert.assertEquals;
    65
    76import java.util.Collections;
     
    1211import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault;
    1312
     13/**
     14 * Unit tests of {@link RequestHandler} class.
     15 */
    1416public class RequestHandlerTest {
    1517
     
    4850        expected.put("query", "a");
    4951        expected.put("b", "=c");
    50         assertThat(getRequestParameter("http://example.com/?query=a&b==c"),
    51                 is(expected));
     52        assertEquals(expected, getRequestParameter("http://example.com/?query=a&b==c"));
    5253    }
    5354
    5455    @Test
    5556    public void testRequestParameter12() {
    56         assertThat(getRequestParameter("http://example.com/?query=a%26b==c"),
    57                 is(Collections.singletonMap("query", "a&b==c")));
     57        assertEquals(Collections.singletonMap("query", "a&b==c"),
     58                getRequestParameter("http://example.com/?query=a%26b==c"));
    5859    }
    5960
    6061    @Test
    6162    public void testRequestParameter3() {
    62         assertThat(getRequestParameter("http://example.com/blue+light%20blue?blue%2Blight+blue").keySet(),
    63                 is((Collections.singleton("blue+light blue"))));
     63        assertEquals(Collections.singleton("blue+light blue"),
     64                getRequestParameter("http://example.com/blue+light%20blue?blue%2Blight+blue").keySet());
    6465    }
    6566
     
    7071    @Test
    7172    public void testRequestParameter4() {
    72         assertThat(getRequestParameter(
     73        assertEquals(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;=="), getRequestParameter(
    7374                // CHECKSTYLE.OFF: LineLength
    74                 "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="),
     75                "http://example.com/:@-._~!$&'()*+,=;:@-._~!$&'()*+,=:@-._~!$&'()*+,==?/?:@-._~!$'()*+,;=/?:@-._~!$'()*+,;==#/?:@-._~!$&'()*+,;="));
    7576                // CHECKSTYLE.ON: LineLength
    76                 is(Collections.singletonMap("/?:@-._~!$'()* ,;", "/?:@-._~!$'()* ,;==")));
    7777    }
    7878
     
    8282        expected.put("space", " ");
    8383        expected.put("tab", "\t");
    84         assertThat(getRequestParameter("http://example.com/?space=%20&tab=%09"),
    85                 is(expected));
     84        assertEquals(expected, getRequestParameter("http://example.com/?space=%20&tab=%09"));
    8685    }
    8786}
Note: See TracChangeset for help on using the changeset viewer.