A248 / LibertyBans

The be-all, end-all of discipline.
https://ci.hahota.net:8443/job/LibertyBans/
GNU Affero General Public License v3.0
169 stars 41 forks source link

Add method to get back a builder from a DraftPunishment #211

Closed MCMDEV closed 1 year ago

MCMDEV commented 1 year ago

This adds a convenience method to DraftPunishment to construct a new builder, copying all its properties. This PR in combination with https://github.com/A248/LibertyBans/pull/212 are to address https://github.com/A248/LibertyBans/issues/130 A unit test is still required, but I didn't really know where to put it. Some advise on that would be greatly appreciated. Javadoc could probably also be improved.

A248 commented 1 year ago

A unit test which checks that toBuilder().build() equals the original object will suffice, with a mock on Enactor. You can place it in bans-core/src/test/java/, in the same package to achieve package-private access.

A248 commented 1 year ago

I believe @KoxSosen was planning to add the mentioned unit tests. We're hoping to add this to 1.1.0 since it is an API addition, which requires a minor version increment.

KoxSosen commented 1 year ago

That's correct, I have a part of the full test figured out in a local repository, however I didn't exactly get to completely finish my work. If someone wants to PR this in the mean time, that would be appreciated, otherwise I'll get to it eventually.

A248 commented 1 year ago

@KoxSosen Would you be able to push your changes to a visible separate branch? Then I can pick up where you left off, and credit everyone as co-authors on the resulting commit.

KoxSosen commented 1 year ago

Pushed my changes to the add-test-builder branch in my fork. Thank you A248!

A248 commented 1 year ago

Merged with eeda7542e612f0cb160951e21e5a0181f25d65d8