-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1460355: Fix getHostFromServerUrl (#1779)
- Loading branch information
1 parent
a79f58d
commit e66fae5
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/java/net/snowflake/client/core/SFLoginInputTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.snowflake.client.core; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
public class SFLoginInputTest { | ||
|
||
@Test | ||
public void testGetHostFromServerUrlWithoutProtocolShouldNotThrow() throws SFException { | ||
SFLoginInput sfLoginInput = new SFLoginInput(); | ||
sfLoginInput.setServerUrl("host.com:443"); | ||
assertEquals("host.com", sfLoginInput.getHostFromServerUrl()); | ||
} | ||
|
||
@Test | ||
public void testGetHostFromServerUrlWithProtocolShouldNotThrow() throws SFException { | ||
SFLoginInput sfLoginInput = new SFLoginInput(); | ||
sfLoginInput.setServerUrl("https://host.com"); | ||
assertEquals("host.com", sfLoginInput.getHostFromServerUrl()); | ||
} | ||
} |