passthrough null as port number in builder (#56)
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-10-12 20:54:38 +02:00
parent fdda685f6f
commit 75561a0540
4 changed files with 11 additions and 3 deletions

View File

@ -89,6 +89,8 @@ class HTTPVaultConnectorBuilderTest {
assertThrows(IllegalArgumentException.class, () -> HTTPVaultConnector.builder().withPort(0), "Port number 0 should throw an exception");
builder = assertDoesNotThrow(() -> HTTPVaultConnector.builder().withPort(-1), "Port number -1 should not throw an exception");
assertNull(builder.getPort(), "Port number -1 should be omitted");
builder = assertDoesNotThrow(() -> HTTPVaultConnector.builder().withPort(null), "Port number NULL should not throw an exception");
assertNull(builder.getPort(), "Port number NULL should be passed through");
}
/**