🎉 Init

This commit is contained in:
2026-03-15 09:46:19 +01:00
commit b9048325d6
26 changed files with 1503 additions and 0 deletions
@@ -0,0 +1,44 @@
package dev.dinauer.oidcproxy;
import dev.dinauer.oidcproxy.startup.SegmentMatcher;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Optional;
public class SegmentMatcherTests
{
@Test
void testExactMatch_successful()
{
List<String> prefix = List.of("api", "products");
List<String> candidate = List.of("api", "products");
Optional<Integer> result = SegmentMatcher.match(prefix, candidate);
Assertions.assertTrue(result.isPresent());
Assertions.assertEquals(2, result.get());
}
@Test
void testExactMatch_failure_01()
{
List<String> prefix = List.of("api", "products");
List<String> candidate = List.of("api", "products", "387483");
Optional<Integer> result = SegmentMatcher.match(prefix, candidate);
Assertions.assertTrue(result.isPresent());
Assertions.assertEquals(2, result.get());
}
@Test
void testExactMatch_failure_02()
{
List<String> prefix = List.of("api", "products", "482028");
List<String> candidate = List.of("api", "products", "387483");
Optional<Integer> result = SegmentMatcher.match(prefix, candidate);
Assertions.assertTrue(result.isEmpty());
}
}