Question: Step 1 : Test one controller Review the ChocolateBoiler.java class, noting the validations that have been put in place for each method. Then, review the
Step : Test one controller
Review the ChocolateBoiler.java class, noting the validations that have been put in place for each method.
Then, review the Main.java class, which has a test scenario already staged for us
Go ahead and run the program.
Step : Test two controllers
Uncomment the second test in Main.java, where we have created a second ChocolateBoiler object. Now there are TWO CONTROLLERS connected to the same physical boiler.
If we run the program now, and each controller tries to fill the boiler, does it still stop the second fill attempt, or does it allow it
Step : Apply Singleton Pattern
Update the ChocolateBoiler.java class, implementing the Singleton pattern such that even if we try to create multiple ChocolateBoiler objects, we only have ONE connection to the physical boiler.
Update Main.java as needed and run the tests again.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
