Skip to content

Latest commit

 

History

History
34 lines (16 loc) · 1.12 KB

File metadata and controls

34 lines (16 loc) · 1.12 KB

Workshop introduction refactoring in Java

Use Maven to open this project and copy the contents of the file corresponding to the installed Java version (java8-pom.txt or java11-pom.txt) into the pom.xml file.

In this repository you will find the first 3 exercises of our course of advanced refactoring:

Prerequisites

In order to run this workshop you will need to have installed the Intellij IDE https://www.jetbrains.com/idea/

Exercises

  • Exercise 1:

    The aim of this exercise is for you to understand how values and references work in Java. You must complete the tests in the file youShouldUnderstandValuesAndReferences.java , getting them to pass.

  • Exercise 2:

    In this second exercise, you must change the price attribute of the shopping cart to a price list:

    List<Integer> prices;

    You must make sure that the tests keep passing.

  • Exercise 2 - Second iteration:

    When you have the price list, you must change the type of the variable from integer to a Price object.

  • Exercise 3:

    You must convert the Id parameter to a value object. Remember to check that the tests are green.