public String getDescription(Method method) { CukesDocs docs = method.getAnnotation(CukesDocs.class); return docs == null ? null : docs.value(); } }
@Given("^using OAuth$") @CukesDocs("The following scenario will use OAuth") public void usingOAuth() { httpRequestFacade.authenticationType("OAuth"); }
@Given("^using (.+) grant type$") @CukesDocs("Specify which grant type is used") public void usingGrantType(String grantType) { oAuthFacade.setGrantType(grantType); }
@Given("^using \"(.+)\" scopes$") @CukesDocs("Specify for which scopes access token will be requested") public void usingScopes(String scopes) { oAuthFacade.setScopes(scopes); } }
@Given("^let variable \"(.+)\" to be random UUID$") @CukesDocs("Generates random UUID and assigns it to a variable") public void var_random_UUID(String varName) { this.variableFacade.setUUIDToVariable(varName); }
@Given("^let variable \"(\\S+)\" to be random password by matching pattern \"([Aa0]+)\"$") @CukesDocs("Generates random password by given pattern. Pattern may contain symbils a,A,0. " + "So A is replaced with random capital letter, a - with random letter and 0 - with random number") public void var_random_password_by_pattern(String variableName, String pattern) { this.variableFacade.setVariable(variableName, this.randomGeneratorFacade.byPattern(pattern)); }
@Given("^let variable \"(\\S+)\" to be random password with length (\\d+)$") @CukesDocs("Generates random password with given length") public void var_randomPassword_by_length(String variableName, int length) { this.variableFacade.setVariable(variableName, this.randomGeneratorFacade.withLength(length)); }