Question: User Registration As a user, I should be able to create a new Account on the endpoint POST localhost: 8 0 8 0 / register
User Registration
As a user, I should be able to create a new Account on the endpoint POST localhost:register The body will contain a representation of a JSON Account, but will not contain an accountid
The registration will be successful if and only if the username is not blank, the password is at least characters long, and an Account with that username does not already exist. If all these conditions are met, the response body should contain a JSON of the Account, including its accountid The response status should be OK which is the default. The new account should be persisted to the database.
If the registration is not successful, the response status should be Client error
Login
As a user, I should be able to verify my login on the endpoint POST localhost:login The request body will contain a JSON representation of an Account, not containing an accountid In the future, this action may generate a Session token to allow the user to securely use the site. We will not worry about this for now.
The login will be successful if and only if the username and password provided in the request body JSON match a real account existing on the database. If successful, the response body should contain a JSON of the account in the response body, including its accountid The response status should be OK which is the default.
If the login is not successful, the response status should be Unauthorized
Create New Message
As a user, I should be able to submit a new post on the endpoint POST localhost:messages The request body will contain a JSON representation of a message, which should be persisted to the database, but will not contain a messageid
The creation of the message will be successful if and only if the messagetext is not blank, is under characters, and postedby refers to a real, existing user. If successful, the response body should contain a JSON of the message, including its messageid The response status should be which is the default. The new message should be persisted to the database.
If the creation of the message is not successful, the response status should be Client error
Get All Messages
As a user, I should be able to submit a GET request on the endpoint GET localhost:messages
The response body should contain a JSON representation of a list containing all messages retrieved from the database. It is expected for the list to simply be empty if there are no messages. The response status should always be which is the default.
Get One Message Given Message Id
As a user, I should be able to submit a GET request on the endpoint GET localhost:messagesmessageid
The response body should contain a JSON representation of the message identified by the messageid It is expected for the response body to simply be empty if there is no such message. The response status should always be which is the default.
Delete a Message Given Message Id
As a User, I should be able to submit a DELETE request on the endpoint DELETE localhost:messagesmessageid
The deletion of an existing message should remove an existing message from the database. If the message existed, the response body should contain the number of rows updated The response status should be which is the default.
If the message did not exist, the response status should be but the response body should be empty. This is because the DELETE verb is intended to be idempotent, ie multiple calls to the DELETE endpoint should respond with the same type of response.
Update Message Given Message Id
As a user, I should be able to submit a PATCH request on the endpoint PATCH localhost:messagesmessageid The request body should contain a new messagetext values to replace the message identified by messageid The request body can not be guaranteed to contain any other information.
The update of a message should be successful if and only if the message id already exists and the new messagetext is not blank and is not over characters. If the update is successful, the response body should contain the number of rows updated and the response status should be which is the default. The message existing on the database should have the updated messagetext.
If the update of the message is not successful for any reason, the response status should be Client error
Get All Messages From User Given Account Id
As a user, I should be able to submit a GET request on the endpoint GET localhost:accountsaccountidmessages
The response body should contain a JSON representation of a list containing all messages posted by a particular user, which is retrieved from the database. It is expected for the list to simply be empty if there are no messages. The response status should always be which is the default.
For more info type "spring social media blog api revature" in google first link.
CODE PLEASE.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
