Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from jenkinsci/eventScopeDeserialization
JENKINS-40155: Fix event's scope deserialization
- Loading branch information
Showing
5 changed files
with
54 additions
and
0 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
21 changes: 21 additions & 0 deletions
21
tfs/src/test/java/hudson/plugins/tfs/model/servicehooks/EventScopeTest.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,21 @@ | ||
package hudson.plugins.tfs.model.servicehooks; | ||
|
||
import hudson.plugins.tfs.util.EndpointHelper; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* A class to test {@link EventScope}. | ||
*/ | ||
public class EventScopeTest { | ||
|
||
@Test | ||
public void deserialize_enumCasing() throws Exception { | ||
final String input = "{\"scope\": \"all\"}"; | ||
|
||
final Event actual = EndpointHelper.MAPPER.readValue(input, Event.class); | ||
|
||
Assert.assertEquals(EventScope.All, actual.getScope()); | ||
} | ||
|
||
} |
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