Skip to content

Commit ffd55b4

Browse files
committed
#36 Test that constructor does not allow null config
Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
1 parent e10e973 commit ffd55b4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package io.securecodebox.persistence.defectdojo.service;
2+
3+
import io.securecodebox.persistence.defectdojo.config.DefectDojoConfig;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.*;
8+
import static org.hamcrest.MatcherAssert.assertThat;
9+
import static org.hamcrest.Matchers.*;
10+
11+
/**
12+
* Tests for {@link ImportScanService}
13+
*/
14+
class ImportScanServiceTest {
15+
private final DefectDojoConfig config = new DefectDojoConfig(
16+
"url",
17+
"apiKey",
18+
"username",
19+
23,
20+
42L
21+
);
22+
private final ImportScanService sut = new ImportScanService(config);
23+
24+
@Test
25+
void constructorShouldThrowExceptionOnNullConfig() {
26+
assertThrows(NullPointerException.class, () -> {
27+
new ImportScanService(null);
28+
});
29+
}
30+
}

0 commit comments

Comments
 (0)