use of gov.cms.qpp.conversion.model.error.ErrorCode in project qpp-conversion-tool by CMSgov.
the class ErrorCodeDocumentationGenerator method main.
public static void main(String... args) throws IOException {
MustacheFactory mf = new DefaultMustacheFactory();
Mustache mdTemplate = mf.compile("error-code/error-code-tempate.md");
try (FileWriter fw = new FileWriter("./ERROR_MESSAGES.md")) {
List<ErrorCode> errorCodes = Arrays.asList(ErrorCode.values());
mdTemplate.execute(fw, errorCodes).flush();
fw.flush();
}
}
use of gov.cms.qpp.conversion.model.error.ErrorCode in project qpp-conversion-tool by CMSgov.
the class ErrorCodeTest method testGetMessagePrependsConversionToolLabel.
@Test
void testGetMessagePrependsConversionToolLabel() {
ErrorCode code = ErrorCode.NUMERATOR_DENOMINATOR_INVALID_VALUE;
Truth.assertThat(code.getMessage()).startsWith(ErrorCode.CT_LABEL);
}
use of gov.cms.qpp.conversion.model.error.ErrorCode in project qpp-conversion-tool by CMSgov.
the class ErrorCodeTest method testFormatOnFormattedErrorCode.
@Test
void testFormatOnFormattedErrorCode() {
ErrorCode code = ErrorCode.NUMERATOR_DENOMINATOR_INVALID_VALUE;
Truth.assertThat(code.format("mock").getMessage()).isEqualTo(code.getMessage().replace("`(Numerator or Denominator)`", "mock"));
}
use of gov.cms.qpp.conversion.model.error.ErrorCode in project qpp-conversion-tool by CMSgov.
the class FixtureErrorData method getMessage.
/**
* Get or generate an {@link ErrorCode}'s message.
*
* @return generated error message
*/
public String getMessage() {
if (message == null) {
ErrorCode ec = ErrorCode.getByCode(errorCode);
message = (subs != null) ? ec.format(subs.toArray()).getMessage() : ec.getMessage();
}
return message;
}
Aggregations