Created
May 29, 2019 00:25
-
-
Save varmas/f4c8c77a47a00d00eae3004bc7acf801 to your computer and use it in GitHub Desktop.
override methods for test
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
it should "something dirty" in { | |
val list: java.util.List[String]= new java.util.ArrayList[String] { | |
@throws(classOf[NullPointerException]) | |
override def get(a: Int): String = { | |
throw new NullPointerException() | |
} | |
} | |
a[NullPointerException] should be thrownBy { // Result type: Assertion | |
list.get(0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment