-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
core/src/test/java/net/cactusthorn/config/core/loader/UriTemplateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.cactusthorn.config.core.loader; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import java.net.URI; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class UriTemplateTest { | ||
|
||
@Test public void nocacheStr() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate("nocache:system:properties", true); | ||
assertFalse(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
|
||
@Test public void nocacheURI() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate(URI.create("nocache:system:properties"), true); | ||
assertFalse(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
|
||
@Test public void cacheStr() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate("system:properties", true); | ||
assertTrue(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
|
||
@Test public void cacheURI() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate(URI.create("system:properties"), true); | ||
assertTrue(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
|
||
@Test public void nocacheParamStr() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate("system:properties", false); | ||
assertFalse(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
|
||
@Test public void nocacheParamURI() { | ||
Loaders.UriTemplate template = new Loaders.UriTemplate(URI.create("system:properties"), false); | ||
assertFalse(template.cachable()); | ||
assertEquals(URI.create("system:properties"), template.uri()); | ||
} | ||
} |