Add another code branch
@@ -126,7 +126,7 @@ public class KeyDataAdapterTest {
}
@Test
- public void bothPathsMustBeSetIfUsingKeyPaths() {
+ public void bothPathsMustBeSetIfUsingKeyPathsPub() {
final KeyData badConfig = new KeyData(null, null, null, Paths.get("sample"), null);
@@ -138,4 +138,17 @@ public class KeyDataAdapterTest {
}
+ @Test
+ public void bothPathsMustBeSetIfUsingKeyPathsPriv() {
+
+ final KeyData badConfig = new KeyData(null, null, null, null, Paths.get("sample"));
+
+ final Throwable throwable = catchThrowable(() -> this.adapter.unmarshal(badConfig));
+
+ assertThat(throwable)
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage("When providing key paths, must give both public and private");
+
+ }
+
}
