Record Class FixtureSpec
java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.trackerlens.fixture.FixtureSpec
- Record Components:
asOf- the instant to generate the fixture as of; defaults toInstant.now()indefaults()historyStartDaysAgo- how many days of history, ending atasOf, the generated timestamps are spread acrossforecastTargetDaysOut- how many calendar days out fromasOfthe calibrated forecast should land, verified against the realProgressProjectorat generation timeworkingDaysPerWeek- must equal 5 - the number of business days per weekProgressProjectoritself currently, non-configurably, assumes; present so a future version of this spec can widen that assumption without an incompatible signature change, and validated against today's fixed assumption in the meantime so a caller can never silently miscalibrate against itbddScenarioCount- how many BDD-scenario records to generate; scaled up from the default proportionally across every represented stage, not paddedapiContractCount- how many API-contract records to generate; scaled up from the default proportionally across every represented category, not padded
public record FixtureSpec(Instant asOf, int historyStartDaysAgo, int forecastTargetDaysOut, int workingDaysPerWeek, int bddScenarioCount, int apiContractCount)
extends Record
Parameters for
TrackerLensFixtureGenerator: how much history to synthesize, how far out
the resulting forecast should land, and how many items each of the two trackers should carry.
The same spec serves two distinct callers. A prototyping caller (e.g. the
generateTrackerLensFixture Gradle task) leaves asOf() at its default of
Instant.now(), so the fixture is always fresh relative to whenever it's regenerated. An
automated-test caller sets asOf() explicitly (see withAsOf(Instant)), so the
generator produces byte-identical output on every run regardless of what day it is. Both are the
same generator and the same spec - only whether asOf() is left at its default or
overridden differs.
-
Constructor Summary
ConstructorsConstructorDescriptionFixtureSpec(Instant asOf, int historyStartDaysAgo, int forecastTargetDaysOut, int workingDaysPerWeek, int bddScenarioCount, int apiContractCount) Validates every field. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theapiContractCountrecord component.asOf()Returns the value of theasOfrecord component.intReturns the value of thebddScenarioCountrecord component.static FixtureSpecdefaults()The default spec:asOfset to the current instant, 60 days of history, a forecast calibrated to land approximately 30 days out, a 5-day working week, 8 BDD scenarios, and 20 API contracts - immediately useful coverage, not a thin example (seeTrackerLensFixtureGenerator's own Javadoc for exactly what's guaranteed).final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theforecastTargetDaysOutrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thehistoryStartDaysAgorecord component.final StringtoString()Returns a string representation of this record class.Returns a copy of this spec withasOf()replaced, every other field unchanged - the usual way an automated test pins this spec to a fixed instant for byte-identical output, starting fromdefaults().intReturns the value of theworkingDaysPerWeekrecord component.
-
Constructor Details
-
FixtureSpec
public FixtureSpec(Instant asOf, int historyStartDaysAgo, int forecastTargetDaysOut, int workingDaysPerWeek, int bddScenarioCount, int apiContractCount) Validates every field.
-
-
Method Details
-
defaults
The default spec:asOfset to the current instant, 60 days of history, a forecast calibrated to land approximately 30 days out, a 5-day working week, 8 BDD scenarios, and 20 API contracts - immediately useful coverage, not a thin example (seeTrackerLensFixtureGenerator's own Javadoc for exactly what's guaranteed).- Returns:
- the default spec
-
withAsOf
Returns a copy of this spec withasOf()replaced, every other field unchanged - the usual way an automated test pins this spec to a fixed instant for byte-identical output, starting fromdefaults().- Parameters:
newAsOf- the instant to generate the fixture as of- Returns:
- a new spec, otherwise identical to this one
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
asOf
Returns the value of theasOfrecord component.- Returns:
- the value of the
asOfrecord component
-
historyStartDaysAgo
public int historyStartDaysAgo()Returns the value of thehistoryStartDaysAgorecord component.- Returns:
- the value of the
historyStartDaysAgorecord component
-
forecastTargetDaysOut
public int forecastTargetDaysOut()Returns the value of theforecastTargetDaysOutrecord component.- Returns:
- the value of the
forecastTargetDaysOutrecord component
-
workingDaysPerWeek
public int workingDaysPerWeek()Returns the value of theworkingDaysPerWeekrecord component.- Returns:
- the value of the
workingDaysPerWeekrecord component
-
bddScenarioCount
public int bddScenarioCount()Returns the value of thebddScenarioCountrecord component.- Returns:
- the value of the
bddScenarioCountrecord component
-
apiContractCount
public int apiContractCount()Returns the value of theapiContractCountrecord component.- Returns:
- the value of the
apiContractCountrecord component
-