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 Video.toString() output illegal json and refactor #3032

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xcyq
Copy link

@Xcyq Xcyq commented Sep 4, 2024

What problem does this PR solve?

  1. Fixes the issue where Video.toString() outputs an illegal JSON string. All samples should output valid JSON, but in the example below, line 3 is incorrect:
17:11:13.976 [main] INFO com.iluwatar.partialresponse.App -- Retrieving full response from server:-
17:11:13.985 [main] INFO com.iluwatar.partialresponse.App -- Get all video information:
17:11:14.014 [main] INFO com.iluwatar.partialresponse.App -- {"id": 1,"title": "Avatar","length": 178,"description": "epic science fiction film","director": "James Cameron","language": "English",}
17:11:14.015 [main] INFO com.iluwatar.partialresponse.App -- ----------------------------------------------------------
17:11:14.015 [main] INFO com.iluwatar.partialresponse.App -- Retrieving partial response from server:-
17:11:14.015 [main] INFO com.iluwatar.partialresponse.App -- Get video @id, @title, @director:
17:11:14.022 [main] INFO com.iluwatar.partialresponse.App -- {"id": 3,"title": "Interstellar","director": "Christopher Nolan"}
17:11:14.023 [main] INFO com.iluwatar.partialresponse.App -- Get video @id, @length:
17:11:14.023 [main] INFO com.iluwatar.partialresponse.App -- {"id": 3,"length": 169}
  1. Refactors FieldJsonMapper.toJson for better readability (possibly).


Assertions.assertEquals(expectedDetails, actualFieldsDetails);
}

}

Choose a reason for hiding this comment

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

Please add an extra line at EOF to satisfy github

Copy link

@Ritabrata1080 Ritabrata1080 left a comment

Choose a reason for hiding this comment

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

Please squash the commits

refactor: json string concat

add an extra line at EOF
Copy link

sonarcloud bot commented Sep 6, 2024

Copy link

@Ritabrata1080 Ritabrata1080 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants