1
2
3
4
5 package com.jcabi.github;
6
7 import org.hamcrest.MatcherAssert;
8 import org.hamcrest.Matchers;
9 import org.junit.jupiter.api.Assertions;
10 import org.junit.jupiter.api.Test;
11
12
13
14
15
16 final class FromPropertiesTest {
17
18 @Test
19 void formatsUserAgent() {
20 MatcherAssert.assertThat(
21 "String does not start with expected value",
22 new FromProperties("jcabigithub.properties").format(),
23 Matchers.startsWith("jcabi-github ")
24 );
25 }
26
27 @Test
28 void throwsExceptionOnMissingFile() {
29 Assertions.assertThrows(
30 NullPointerException.class,
31 () -> new FromProperties("missing.properties").format(),
32 "Should throw when properties file is missing"
33 );
34 }
35
36 }