Friday, 21 April 2017

What is the difference between @Before and @BeforeClass annotations?


  • @Before
    public void method()
    The Before annotation indicates that this method must be executed before each test in the class, so as to execute some preconditions necessary for the test.
  • @BeforeClass
    public static void method()
    The BeforeClass annotation indicates that the static method to which is attached must be executed once and before all tests in the class. That happens when the test methods share computationally expensive setup (e.g. connect to database).

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...