Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JUnit 5 Workshop at Dev Nexus 2018

JUnit 5 Workshop at Dev Nexus 2018

This is similar to the JUnit Hands On Lab I did at JavaOne in September 2017 except:
1) It has been updated now that JUnit 5 has been released more than a week
2) It uses Gradle
3) The content is expanded since the timeframe is longer

Jeanne Boyarsky

February 11, 2018
Tweet

More Decks by Jeanne Boyarsky

Other Decks in Technology

Transcript

  1. What’s New with JUnit 5
    speakerdeck.com/boyarsky
    Twitter @jeanneboyarsky
    Blog: http://www.selikoff.net
    Dev Nexus
    Jeanne Boyarsky
    February 21, 2018

    View full-size slide

  2. @jeanneboyarsky
    About Me
    15 years as
    •  Java Developer
    •  JUnit user

    View full-size slide

  3. I’m the reason this
    workshop was split
    into two halves.
    -Wildcard

    View full-size slide

  4. Why JUnit 5?
    •  Java 8 support!
    •  More annotations/assertions!
    •  More power!
    •  Released September 10, 2017

    View full-size slide

  5. Supports Not Yet

    View full-size slide

  6. What you’ll learn in the lab
    •  How to convert a Gradle project
    •  New dependencies
    •  Required config
    Note: If you use Maven at your job, you can read the Maven equivalents
    at https://github.com/boyarsky/JavaOne2017-HOL-JUnit5

    View full-size slide

  7. What you’ll learn in the lab
    •  Changes from JUnit 4
    •  Imports
    •  Annotations
    •  Assertion messages and assertThat()
    •  Parameterized tests
    •  Rules

    View full-size slide

  8. What you’ll learn in the lab
    •  New functionality
    •  Parameterized tests
    •  Repeating tests
    •  Display names
    •  Tags

    View full-size slide

  9. What you’ll learn in the lab
    •  Working with Libraries
    •  Soft Assertions
    •  Mockito

    View full-size slide

  10. Flow
    •  The lab is self paced
    •  Raise your hand if you get stuck or have a
    question.
    •  If there is a FAQ, I’ll demo it on the screen.

    View full-size slide

  11. What tools do I use?
    •  Eclipse
    or
    •  IntelliJ
    or
    •  Command line Gradle/Git
    + your choice of text editor

    View full-size slide

  12. Let’s start!
    On to the lab!
    In a browser go to
    https://github.com/boyarsky/2018-
    devnexus-junit5-workshop
    Open instructions word doc

    View full-size slide