Closed snicoll closed 8 years ago
In https://github.com/spring-projects/spring-boot/commit/b88cb35ea231fffa807a9f1d97b6b38e412bb34b I had to mock a void method (throw an exception if it's invoked). I haven't found a way to do that with the bdd imports so I've tricked by a full import.
What am I missing? We need to fix that commit with the proper way of doing this or change the checkstyle rules.
You need something like this:
willThrow(new JMSException("Could not start", "123")).given(connection).start();
That's what I am doing right now. Oh no I am not. willThrow :|
willThrow
In https://github.com/spring-projects/spring-boot/commit/b88cb35ea231fffa807a9f1d97b6b38e412bb34b I had to mock a void method (throw an exception if it's invoked). I haven't found a way to do that with the bdd imports so I've tricked by a full import.
What am I missing? We need to fix that commit with the proper way of doing this or change the checkstyle rules.