Add test that KeyConfigBuilder returns null if no keys provided
package com.quorum.tessera.config.builder;
import com.quorum.tessera.config.ConfigException;
+import com.quorum.tessera.config.KeyConfiguration;
import com.quorum.tessera.config.KeyData;
import com.quorum.tessera.config.migration.test.FixtureUtil;
import java.io.IOException;
@@ -10,6 +11,7 @@ import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.*;
@@ -113,4 +115,11 @@ public class KeyDataBuilderTest {
}
}
+
+ @Test
+ public void noKeysReturnsNull() {
+ Optional<KeyConfiguration> keyConfiguration = Optional.ofNullable(KeyDataBuilder.create()
+ .build(null));
+ assertThat(keyConfiguration).isNotPresent();
+ }
}
