HelloWorld
basic()
returns 'Hello World!'
name()
returns '{request.params.name} says:'
NoteController
getNoteById()
Question: Is this useful? Or should we just check that it calls the backend dataservice?
Maybe we should use Model classes for objects returned from service, so we can instantiate in the fakes/returns we stub
should return error message if id is invalid
should return error message if Note doesn't exist
createNote()
should call DataService.createNote (with newName?)
should return note with name passed and new id
should return error if note name is empty
should return error message if error creating note
updateNote()
should call NoteDataservice.updateNote (with params)
should return note with updated name, as passed
should return error message if error updating note
deleteNote()
should call NoteDataservice.deleteNote (with id)
should return the deleted note id
should return error message if error deleting note
NoteDataservice
getNote()
should return a note object with matching id
should throw error if id is invalid
should throw error if id doesnt return note
should throw error with code if mysql unreachable
should return a note with the name passed
createNotes()
should return same number of notes passed to be created