forked from baloise/rocket-chat-notifier
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(error-handling): Improved error handling for special characters i…
…n fields (see #JENKINS-47858) fixes https://issues.jenkins-ci.org/browse/JENKINS-47858
- Loading branch information
Showing
4 changed files
with
33 additions
and
7 deletions.
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
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
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
18 changes: 18 additions & 0 deletions
18
src/test/java/jenkins/plugins/rocketchatnotifier/rocket/RocketChatClientCallBuilderTest.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,18 @@ | ||
package jenkins.plugins.rocketchatnotifier.rocket; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.IOException; | ||
|
||
public class RocketChatClientCallBuilderTest { | ||
|
||
@Test(expected = IOException.class) | ||
public void shouldEscapeSpecialCharacters() throws Exception { | ||
// given | ||
RocketChatClientCallBuilder rocketCallBuilder = new RocketChatClientCallBuilder("https://open.rocket.chat/", "]\",", "]\","); | ||
// when | ||
rocketCallBuilder.buildCall(RocketChatRestApiV1.ChannelsList); | ||
// then error | ||
} | ||
|
||
} |