Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing enum import #311

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
let enumValue1;
let enumValue2;
if (isEnum) {
const values = field.fieldValues.replace(/\s/g, '').split(',');
enumValue1 = values[0];
if (values.length > 1) {
enumValue2 = values[1];
const enumValues = field.enumValues;
enumValue1 = enumValues[0];
if (enumValues.length > 1) {
enumValue2 = enumValues[1];
} else {
enumValue2 = enumValue1;
}
Expand Down Expand Up @@ -149,8 +149,9 @@
updatedValue = 'ByteBuffer.wrap(TestUtil.createByteArray(1, "1"))';
}
} else if (isEnum) {
defaultValue = enumValue1;
updatedValue = enumValue2;
const enumFieldType = `${fieldType}.`;
defaultValue = enumFieldType + enumValue1.name;
updatedValue = enumFieldType + enumValue2.name;
}
_%>
private static final <%= fieldType %> <%= defaultValueName %> = <%- defaultValue %>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import <%= packageName %>.domain.<%= entityClass %>;
<%_ } else { _%>
import <%= packageName %>.service.dto.<%= dtoClass %>;
<%_ } _%>
<%_ for (const enumField of fields.filter(field => !field.transient && field.fieldIsEnum)) { _%>
import <%= packageName %>.domain.enumeration.<%= enumField.fieldType %>;
<%_ } _%>
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.common.mapper.TypeRef;
Expand Down