Created
June 7, 2013 14:43
-
-
Save meza/5729760 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private String getCreateContentForm(String contentType) { | |
if ("article".equals(contentType)) { | |
return createArticleForm(); | |
} | |
if ("audio".equals(contentType)) { | |
return createAudioForm(); | |
} | |
if ("cartoon".equals(contentType)) { | |
return createCartoonForm(); | |
} | |
if ("competition".equals(contentType)) { | |
return createCompetitionForm(); | |
} | |
throw new IllegalArgumentException("No such content type"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone stumbling on this thread:
The following examples are modified for the sake of the gist, but the end solution is something like:
As Cucumber can use ENUMS as parameters, the usage follows: