Question: 10.8.2. Test Data Builder The listing below shows the Transaction class. It is a simple POJO with no logic but only getters and setters methods

10.8.2. Test Data Builder The listing below shows the Transaction class. It is a simple POJO with no logic but only getters and setters methods (which have been omitted in the listing to make it shorter). Listing 10.16. Transaction class public class Transaction { private long id; private State state; O private boolean retryAllowed; 204 Chapter 10. Organization Of Tests private String message; private String billingid; // getters and setters omitted 0 There are four possible values of the state field - PROCESSING, OK, CANCELLED, ERROR. Write a test which creates a number of objects of the Transaction class using the Test Data Builder pattern. Compare the result with the "normal" approach of creating objects directly within your test code (using their constructor and setters). 10.8.2. Test Data Builder The listing below shows the Transaction class. It is a simple POJO with no logic but only getters and setters methods (which have been omitted in the listing to make it shorter). Listing 10.16. Transaction class public class Transaction { private long id; private State state; O private boolean retryAllowed; 204 Chapter 10. Organization Of Tests private String message; private String billingid; // getters and setters omitted 0 There are four possible values of the state field - PROCESSING, OK, CANCELLED, ERROR. Write a test which creates a number of objects of the Transaction class using the Test Data Builder pattern. Compare the result with the "normal" approach of creating objects directly within your test code (using their constructor and setters)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
