Skip to content

Tests: LocalDate uses DATE_TIME_FORMAT instead of LOCAL_DATE_FORMAT #537

@amatosg

Description

@amatosg

Describe the bug
A clear and concise description of what the bug is.

On fields with type LocalDate, tests are using the method

public static String formatDateTime(Temporal temporal) {
    return DATE_TIME_FORMATTER.format(temporal);
}

DATE_TIME_FORMATTER using the pattern yyyy-MM-dd'T'HH:mm:ss.SSS'Z' which results on an error UnsupportedTemporalType Unsupported field: HourOfDay

TestUtil class should have another method to deal with LocalDate

    private static DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern(LOCAL_DATE_FORMAT)
            .withZone(ZoneId.of("UTC"));

    public static String formatLocalDate(Temporal temporal) {
        return DATE_FORMATTER.format(temporal);
    }

To Reproduce
Steps to reproduce the behavior:

  1. create a field with LocalDate type.
  2. Generate the entity
  3. run mvn clean install
  4. See error

Expected behavior
All tests should pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions