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
30 lines (24 loc) · 1022 Bytes
/
Copy pathUriPrefixerTest.java
File metadata and controls
30 lines (24 loc) · 1022 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
29
30
/**
* Copyright (C) 2004-2016, GoodData(R) Corporation. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
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"));
}
}