Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 : 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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started