Search in sources :

Example 1 with URIConverter

use of org.wso2.ballerinalang.compiler.packaging.converters.URIConverter in project ballerina by ballerina-lang.

the class URIConverterTest method testURIConverter.

@Test
public void testURIConverter() {
    URI baseURI = URI.create("http://staging.central.ballerina.io:9090/");
    Patten patten = new Patten(path("natasha", "foo.bar", "1.0.5"));
    URIConverter subject = new URIConverter(baseURI);
    List<URI> urls = patten.convert(subject).collect(Collectors.toList());
    URI expected = URI.create("http://staging.central.ballerina.io:9090/natasha/foo.bar/1.0.5/");
    Assert.assertEquals(urls, Collections.singletonList(expected));
}
Also used : Patten(org.wso2.ballerinalang.compiler.packaging.Patten) URIConverter(org.wso2.ballerinalang.compiler.packaging.converters.URIConverter) URI(java.net.URI) Test(org.testng.annotations.Test)

Aggregations

URI (java.net.URI)1 Test (org.testng.annotations.Test)1 Patten (org.wso2.ballerinalang.compiler.packaging.Patten)1 URIConverter (org.wso2.ballerinalang.compiler.packaging.converters.URIConverter)1