Package org.rest.common.web

Source Code of org.rest.common.web.URIParsingUnitTest

package org.rest.common.web;

import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;

public class URIParsingUnitTest {

    @Test
    public final void whenURIIsParsed_thenResultIsCorrect() {
        final String uri = "http://localhost:8080/rest-sec/api/privilege?q=name%3DjDiedXRD";

        // When
        final UriComponents uriComponents = UriComponentsBuilder.fromUriString(uri).build();

        // Then
        assertTrue(uriComponents.getQueryParams().size() == 1);
    }

}
TOP

Related Classes of org.rest.common.web.URIParsingUnitTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.