Skip to content

Conversation

tcheeric
Copy link
Owner

Summary

  • enforce exact Kind values for concrete event implementations
  • add validation tests for mismatched kind values

Testing

  • mvn -q verify

https://chatgpt.com/codex/tasks/task_b_688a84fdfbb083318d79b9337c990fcb

Copilot

This comment was marked as outdated.

@tcheeric tcheeric requested a review from Copilot July 30, 2025 22:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds strict kind validation to concrete event implementations to ensure each event class validates that its kind field matches the expected Kind enum value.

  • Adds validateKind() method overrides to all concrete event classes
  • Adds a test to verify validation fails when kind values are mismatched
  • Updates README to document the new validation behavior

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 10 comments.

File Description
ValidateKindTest.java New test verifying AssertionError is thrown for mismatched kind values
Various event classes Added validateKind() method overrides to enforce expected Kind enum values
README.md Added documentation about the new event validation behavior

@@ -32,4 +33,11 @@ public PaymentShipmentStatus getPaymentShipmentStatus() {
protected PaymentShipmentStatus getEntity() {
return getPaymentShipmentStatus();
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -32,4 +33,11 @@ public PaymentRequest getPaymentRequest() {
protected PaymentRequest getEntity() {
return getPaymentRequest();
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -35,4 +36,11 @@ public CustomerOrder getCustomerOrder() {
protected CustomerOrder getEntity() {
return getCustomerOrder();
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -39,6 +39,12 @@ protected Stall getEntity() {
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -32,6 +33,12 @@ protected Product getEntity() {
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -54,4 +54,11 @@ protected void validateTags() {
throw new AssertionError("Missing or invalid `relay` tag.");
}
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -60,4 +60,11 @@ protected CalendarContent<T> getCalendarContent() {

return calendarContent;
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -97,4 +97,11 @@ protected CalendarRsvpContent getCalendarContent() {

return calendarRsvpContent;
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -81,4 +81,11 @@ protected void validateTags() {
throw new AssertionError("Missing `title` tag for the event title.");
}
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@@ -98,4 +98,11 @@ protected CalendarContent<T> getCalendarContent() {

return calendarContent;
}

@Override
public void validateKind() {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be protected to match the pattern used in all other event classes. The public access modifier is inconsistent with the rest of the codebase.

Suggested change
public void validateKind() {
protected void validateKind() {

Copilot uses AI. Check for mistakes.

@tcheeric tcheeric merged commit f0c572d into develop Jul 30, 2025
@tcheeric tcheeric deleted the codex/override-validatekind-in-event-classes branch July 30, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant