public abstract class GiphyStepExecution<T,S extends GiphyStep>
extends org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<T>
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_IMAGE_SIZE |
protected S |
step |
Constructor and Description |
---|
GiphyStepExecution(S giphyStep,
org.jenkinsci.plugins.workflow.steps.StepContext context)
Constructor for StepExecution
|
Modifier and Type | Method and Description |
---|---|
protected String |
getGiphyHost()
We can now override it in the tests and test the api calls to giphy without actually calling giphy each time
|
protected abstract URI |
getGiphyUri(String apiKey)
build the giphy uri
|
protected String |
getScheme()
We can now override it in the tests and test the api calls to giphy without actually calling giphy each time
TODO: make mockServer work with https and then remove this method
|
protected abstract T |
handleGiphyResponse(S step,
org.json.simple.JSONObject json)
method that responsible to what should we do with the response from giphy
|
protected T |
run()
Meat of the execution.
|
protected abstract void |
validateSpecificStepValues()
validate the required values for the specific step implementation exists, and set default value to optional in
case they don't exists
|
protected void |
validateValues()
validate the required values exists, and set default value to optional in case they don't exists
|
getStatus, onResume, start, stop
protected static final String DEFAULT_IMAGE_SIZE
public GiphyStepExecution(S giphyStep, org.jenkinsci.plugins.workflow.steps.StepContext context)
giphyStep
- the step runningcontext
- step contextprotected T run() throws Exception
protected void validateValues()
protected abstract void validateSpecificStepValues()
protected abstract URI getGiphyUri(String apiKey) throws URISyntaxException
apiKey
- the apikey to giphyURISyntaxException
- in case the uri is not validprotected abstract T handleGiphyResponse(S step, org.json.simple.JSONObject json)
step
- the step with all the values from the userjson
- the response from giphy with JSON formatprotected String getScheme()
protected String getGiphyHost()
Copyright © 2016–2019. All rights reserved.