forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUriPrefixerTest.java
More file actions
28 lines (22 loc) · 885 Bytes
/
Copy pathUriPrefixerTest.java
File metadata and controls
28 lines (22 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata;
import org.testng.annotations.Test;
import java.net.URI;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
public class UriPrefixerTest {
@Test
public void testMergeUrisWithSlash() throws Exception {
final UriPrefixer prefixer = new UriPrefixer("http://localhost:1/uploads");
final URI result = prefixer.mergeUris("/test");
assertThat(result.toString(), is("http://localhost:1/uploads/test"));
}
@Test
public void testMergeUrisWithoutSlash() throws Exception {
final UriPrefixer prefixer = new UriPrefixer("http://localhost:1/uploads");
final URI result = prefixer.mergeUris("test");
assertThat(result.toString(), is("http://localhost:1/uploads/test"));
}
}