Class PayloadRule

java.lang.Object
org.kohsuke.github.PayloadRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class PayloadRule extends Object implements org.junit.rules.TestRule
The Class PayloadRule.
Author:
Stephen Connolly
  • Constructor Details

    • PayloadRule

      public PayloadRule(String type)
      Instantiates a new payload rule.
      Parameters:
      type - the type
  • Method Details

    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
      Apply.
      Specified by:
      apply in interface org.junit.rules.TestRule
      Parameters:
      base - the base
      description - the description
      Returns:
      the statement
    • asInputStream

      public InputStream asInputStream() throws FileNotFoundException
      As input stream.
      Returns:
      the input stream
      Throws:
      FileNotFoundException - the file not found exception
    • asBytes

      public byte[] asBytes() throws IOException
      As bytes.
      Returns:
      the byte[]
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asString

      public String asString(Charset encoding) throws IOException
      As string.
      Parameters:
      encoding - the encoding
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asString

      public String asString(String encoding) throws IOException
      As string.
      Parameters:
      encoding - the encoding
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asString

      public String asString() throws IOException
      As string.
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asReader

      public Reader asReader() throws FileNotFoundException
      As reader.
      Returns:
      the reader
      Throws:
      FileNotFoundException - the file not found exception
    • asReader

      public Reader asReader(@Nonnull Function<String,String> transformer) throws IOException
      As reader.
      Parameters:
      transformer - the transformer
      Returns:
      the reader
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asReader

      public Reader asReader(String encoding) throws IOException
      As reader.
      Parameters:
      encoding - the encoding
      Returns:
      the reader
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • asReader

      public Reader asReader(Charset encoding) throws FileNotFoundException
      As reader.
      Parameters:
      encoding - the encoding
      Returns:
      the reader
      Throws:
      FileNotFoundException - the file not found exception