@Test
public void shouldCanonicalizeOrigin() throws U2fBadInputException {

    assertEquals("http://example.com", canonicalizeOrigin("http://example.com"));
    assertEquals("http://example.com", canonicalizeOrigin("http://example.com/"));
    assertEquals("http://example.com", canonicalizeOrigin("http://example.com/foo"));
    assertEquals("http://example.com", canonicalizeOrigin("http://example.com/foo?bar=b"));
    assertEquals("http://example.com", canonicalizeOrigin("http://example.com/foo#fragment"));
    assertEquals("https://example.com", canonicalizeOrigin("https://example.com"));
    assertEquals("https://example.com", canonicalizeOrigin("https://example.com/foo"));
    assertEquals("android:apk-key-hash:2jmj7l5rSw0yVb/vlWAYkK/YBwk",
            canonicalizeOrigin("android:apk-key-hash:2jmj7l5rSw0yVb/vlWAYkK/YBwk"));
}