honeytrap.devexercisesstate.javaSettings
Description

22. State

MediumBehavioural1 hidden requirement

Letting the current state say what comes next, instead of one chain deciding for all of them

Article moves through a workflow and knows when it can still be edited. The tests pass.

It keeps the stage as a string and decides the transitions in one if-chain — so the whole workflow lives in one method, and every stage’s rules are tangled with every other stage’s.

Draft, Review and Published each already answer name(), next() and editable(). Rewrite Article to hold the current Stage and ask it.

Run compiles every file and runs Tests.java — the tests you can read.

Submit runs those again, then applies 1 requirement you have not seen, one at a time.

Your code is never edited. Each requirement is added to the project as it stands. If the design is right, nothing you wrote has to change.

  • Ctrl/⌘ + Enter runs the tests