-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_test_enum.xml
More file actions
9 lines (9 loc) · 1.49 KB
/
_test_enum.xml
File metadata and controls
9 lines (9 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
<template name="_test_enum" value="private final String VALUE_1 = "VALUE_1"; private final String VALUE_2 = "VALUE_2"; private final String INVALID_$CLASS_NAME_UPPER_SNAKE$ = "INVALID_$CLASS_NAME_UPPER_SNAKE$"; @Test$END$ void only_be_created_with_a_valid_$CLASS_NAME_LOWER_SNAKE$() { org.junit.jupiter.api.Assertions.assertNotNull($OBJECT_NAME$.from(VALUE_1)); org.junit.jupiter.api.Assertions.assertNotNull($OBJECT_NAME$.from(VALUE_2)); } @Disabled @Test void fail_when_$CLASS_NAME_LOWER_SNAKE$_is_invalid() { org.junit.jupiter.api.Assertions.assertThrows(Invalid$OBJECT_NAME$.class, () -> $OBJECT_NAME$.from(INVALID_$CLASS_NAME_UPPER_SNAKE$)); }" description="Add a battery of default test for enum with JUnit5 and Assertj" toReformat="false" toShortenFQNames="true">
<variable name="CLASS_NAME_UPPER_SNAKE" expression="regularExpression(capitalizeAndUnderscore(className()), "_SHOULD", "")" defaultValue="" alwaysStopAt="true" />
<variable name="CLASS_NAME_LOWER_SNAKE" expression="regularExpression(snakeCase(className()), "_should", "")" defaultValue="" alwaysStopAt="true" />
<variable name="OBJECT_NAME" expression="regularExpression(className(), "Should", "")" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_CODE" value="true" />
<option name="JAVA_COMMENT" value="false" />
</context>
</template>