-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
1 parent
71de823
commit 3c83773
Showing
2 changed files
with
27 additions
and
1 deletion.
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
26 changes: 26 additions & 0 deletions
26
...r-component/src/test/java/com/structurizr/component/url/PrefixSourceUrlStrategyTests.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,26 @@ | ||
package com.structurizr.component.url; | ||
|
||
import com.structurizr.component.Type; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class PrefixSourceUrlStrategyTests { | ||
|
||
@Test | ||
void test_urlOf_WhenTheSourceUsesForwardSlashFileSeparators() { | ||
Type type = new Type("com.example.ClassName"); | ||
type.setSource("com/example/ClassName.java"); | ||
|
||
assertEquals("https://example.com/src/main/java/com/example/ClassName.java", new PrefixSourceUrlStrategy("https://example.com/src/main/java").urlOf(type)); | ||
} | ||
|
||
@Test | ||
void test_urlOf_WhenTheSourceUsesBackslashFileSeparators() { | ||
Type type = new Type("com.example.ClassName"); | ||
type.setSource("com\\example\\ClassName.java"); | ||
|
||
assertEquals("https://example.com/src/main/java/com/example/ClassName.java", new PrefixSourceUrlStrategy("https://example.com/src/main/java").urlOf(type)); | ||
} | ||
|
||
} |