Skip to content

Commit

Permalink
Removed .toString() tests in SenderConfigurationTest, fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yamnihcg committed Jun 25, 2021
1 parent f7280d2 commit 2f265b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public SenderConfigurationBuilder useLicenseKey(boolean useLicenseKey) {
* @return this builder
*/
public SenderConfigurationBuilder setRegion(String region) throws IllegalArgumentException {
// Add IllegalArgumentException if region isn't US or EU

region = region.toUpperCase();
if (!region.equals("US") && !region.equals("EU")) {
throw new IllegalArgumentException("The only supported regions are the US and EU regions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,4 @@ void userProvidedEndpointTest() throws Exception {
SenderConfiguration.builder(testURL, testPath).endpoint(testEndpointURL).build();
assertEquals(testEndpointURL, testConfig.getEndpointUrl());
}

@Test
void defaultEndpointAsStringTest() throws Exception {
String endpointURLAsString = testURL + testPath;
SenderConfiguration testConfig = SenderConfiguration.builder(testURL, testPath).build();
assertEquals(endpointURLAsString, testConfig.getEndpointUrl().toString());
}

@Test
void userEndpointAsStringTest() throws Exception {
URL testEndpointURL = new URL("https://google.com");
String endpointURLAsString = "https://google.com";
SenderConfiguration testConfig =
SenderConfiguration.builder(testURL, testPath).endpoint(testEndpointURL).build();
assertEquals(endpointURLAsString, testConfig.getEndpointUrl().toString());
}
}

0 comments on commit 2f265b9

Please sign in to comment.