Skip to content

Commit

Permalink
more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Oct 9, 2023
1 parent 8b3072d commit 4ce19c7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;

class SourcedFileTest {
public static final String EFFECTIVELY_EMPTY_FILE_CONTENTS = "\n \n";
Expand Down Expand Up @@ -42,7 +43,13 @@ void loadEnv() {
assertNotNull( SourcedFile.locateAndLoadLocalFile("uaa-ratelimit.yml", SourcedFileTest.class.getClassLoader().getResource("uaa-ratelimit.yml").getPath().replace("uaa-ratelimit.yml", "")));
assertNull( SourcedFile.locateAndLoadLocalFile("", SourcedFileTest.class.getClassLoader().getResource("uaa-ratelimit.yml").getPath().replace("uaa-ratelimit.yml", "")));
assertNull( SourcedFile.locateAndLoadLocalFile("random", "/dev"));
assertNull( SourcedFile.locateAndLoadLocalFile("0", "/proc/1/fdinfo"));
assertNull( SourcedFile.locateAndLoadLocalFile("?", "/proc/1/fdinfo"));
}

@Test
void loadStreamException() {
InputStream in = mock(InputStream.class);
assertThrows(IllegalStateException.class, () -> SourcedFile.loadFile( in, "" ) );
}

private void check( String fileContents, String source ) {
Expand Down

0 comments on commit 4ce19c7

Please sign in to comment.