Class ExpectNewDemo


  • public class ExpectNewDemo
    extends Object
    • Constructor Detail

      • ExpectNewDemo

        public ExpectNewDemo()
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getMessage

        public String getMessage()
      • getMessageWithArgument

        public String getMessageWithArgument()
      • invokeVoidMethod

        public void invokeVoidMethod()
      • throwExceptionWhenInvoction

        public void throwExceptionWhenInvoction()
        The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.
      • throwExceptionAndWrapInRunTimeWhenInvoction

        public void throwExceptionAndWrapInRunTimeWhenInvoction()
        The purpose of the method is to demonstrate that a test case can mock the new instance call and throw an exception upon instantiation.
      • multipleNew

        public String multipleNew()
      • simpleMultipleNew

        public void simpleMultipleNew()
      • simpleSingleNew

        public void simpleSingleNew()
      • makeDate

        public Date makeDate()
      • fileExists

        public boolean fileExists​(String name)
      • alternativePath

        public InputStream alternativePath()
      • newWithArguments

        public String newWithArguments​(Service service,
                                       int times)
      • newWithWrongArguments

        public String newWithWrongArguments​(Service service,
                                            int times)
      • newVarArgs

        public String[] newVarArgs​(String... strings)
      • newVarArgs

        public int[] newVarArgs​(float myFloat,
                                int... ints)
      • newVarArgs

        public byte[][] newVarArgs​(byte[]... bytes)
      • newVarArgsWithMatchers

        public byte[][] newVarArgsWithMatchers()