Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hpehl committed Mar 5, 2024
1 parent 87eae63 commit d1b33bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
4 changes: 0 additions & 4 deletions router/src/main/java/org/jboss/elemento/router/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ String relative(String path) {
return path;
}

boolean isRelative(String path) {
return empty || (path != null && path.startsWith(slashBase));
}

String absolute(String path) {
if (!empty && path != null) {
String safePath = path.startsWith("/") ? path : "/" + path;
Expand Down
23 changes: 1 addition & 22 deletions router/src/test/java/org/jboss/elemento/router/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;

class BaseTest {

Expand Down Expand Up @@ -84,25 +84,4 @@ void absolute() {
assertEquals("/a/b/a/b", nested.absolute("/a/b"));
assertEquals("/a/b/a/b/c", nested.absolute("/a/b/c"));
}

@Test
void baseRelative() {
Base empty = new Base("/");
assertTrue(empty.isRelative("/a"));
assertTrue(empty.isRelative("/a/b"));
assertTrue(empty.isRelative("/a/b/c"));
assertTrue(empty.isRelative("/b"));

Base simple = new Base("/a");
assertTrue(simple.isRelative("/a"));
assertTrue(simple.isRelative("/a/b"));
assertTrue(simple.isRelative("/a/b/c"));
assertFalse(simple.isRelative("/b"));

Base nested = new Base("/a/b");
assertFalse(nested.isRelative("/a"));
assertTrue(nested.isRelative("/a/b"));
assertTrue(nested.isRelative("/a/b/c"));
assertFalse(nested.isRelative("/b"));
}
}

0 comments on commit d1b33bf

Please sign in to comment.