Conversation
msgilligan
left a comment
There was a problem hiding this comment.
I know this is a draft, but I have a couple suggestions
| return result(appName + " stopping"); | ||
| } | ||
|
|
||
| private record helpMessages(String shortMessage, String longMessage){} |
There was a problem hiding this comment.
Classes in Java (and records are classes) start with a capital letter. And the name of a type representing a single help message should not be plural.
There was a problem hiding this comment.
Also summary and details might be better names than shortMesage and longMessage.
| import java.io.Closeable; | ||
| import java.lang.invoke.MethodHandles; | ||
| import java.lang.reflect.Method; | ||
| import java.util.HashMap; |
There was a problem hiding this comment.
It looks like this import is no longer being used.
| import org.consensusj.jsonrpc.JsonRpcError; | ||
| import org.consensusj.jsonrpc.JsonRpcStatusException; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Disabled; |
There was a problem hiding this comment.
I don't think this is still being used.
| return result(appName + " stopping"); | ||
| } | ||
|
|
||
| private record helpMessages(String shortMessage, String longMessage){} |
There was a problem hiding this comment.
Also summary and details might be better names than shortMesage and longMessage.
|
@liamgilligan See PR #303 |
4b0f436 to
c6e6377
Compare
Added short summary and detailed help text, added and updated tests, and added javadoc and copyright headers when applicable.
c6e6377 to
d7729fa
Compare
msgilligan
left a comment
There was a problem hiding this comment.
A few requested changes...
| */ | ||
| package org.consensusj.jsonrpc.help; | ||
|
|
||
| public class JsonRpcHelp { |
There was a problem hiding this comment.
There should be class-level help here. It should note that this is a record-like structure and what it is used for.
| */ | ||
| @Test | ||
| void helpMethodOneArg() throws IOException { | ||
| void helpMethodNoArg() throws IOException { |
There was a problem hiding this comment.
help with no-arg should return a list of commands and their arguments, not an error code. The test and the server are both wrong.
| stop | ||
| """; | ||
| void helpForStopMethod() throws IOException { | ||
| var expectedResult = "Initiate a graceful shutdown of the server."; |
There was a problem hiding this comment.
This should be the detailed help or at least spot check of the detailed help.
| "echo message\n" + | ||
| "help\n" + | ||
| "stop\n"; | ||
| private static final Map<String, JsonRpcHelp> helpMap = Map.of( |
There was a problem hiding this comment.
helpString above should be generated from this Map.
PR for #260
Currently filler text is being used, tests have been written/modified to account for new
helpbehavior.