Skip to content

Create a Resolver for java.time.ZonedDateTime #57

Description

@MessiasLima

Description

The library supports java.time.Instant and java.time.Duration but does not yet support java.time.ZonedDateTime. Adding this resolver will allow users to generate random ZonedDateTime instances as part of their test fixtures.

This follows the existing pattern for Java time resolvers: a JavaZonedDateTimeResolver class implementing TypeResolver, registered in SomeConfig.buildResolvers, and covered by unit tests.

Scope

  • In scope: JavaZonedDateTimeResolver, registration in SomeConfig, and unit tests.
  • Out of scope: Kotlin kotlinx.datetime types, OffsetDateTime, or other java.time types.

Acceptance criteria

  • GIVEN a java.time.ZonedDateTime type
    WHEN some<ZonedDateTime>() is called
    THEN a valid ZonedDateTime instance is generated
  • GIVEN JavaZonedDateTimeResolver
    WHEN it resolves a value
    THEN the generated instant falls within a reasonable range (e.g., 1970 to 2100)
  • GIVEN SomeConfig.buildResolvers()
    THEN JavaZonedDateTimeResolver is present in the resolver chain after JavaDurationResolver
  • GIVEN JavaZonedDateTimeResolver.canResolve(type)
    WHEN type is String, Int, or java.time.Instant
    THEN it returns false

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesJules lives

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions