Bug 812 - Exception when create appointment with invalid date or time
Summary: Exception when create appointment with invalid date or time
Status: RESOLVED FIXED
Alias: None
Product: 2023 CS3343 Group 20 System
Classification: Unclassified
Component: Appointment (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Assignee: hfwong56-c
URL:
Depends on:
Blocks:
 
Reported: 2023-12-07 21:27 HKT by mhlee64-c
Modified: 2023-12-09 14:02 HKT (History)
0 users

See Also:


Attachments
Test case for invalid date time when create appointment (30.28 KB, image/png)
2023-12-07 21:27 HKT, mhlee64-c
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mhlee64-c 2023-12-07 21:27:12 HKT
Created attachment 161 [details]
Test case for invalid date time when create appointment

it is expected for the user to enter date in DD/MM/YYYY format and time in HH:MM:SS format when creating appointment, but when the user input an invalid date or invalid time, instead of asking the user to input again, exception occur.
--------------------------------------------------------------------------------
Welcome to CMS!
============================================== Login ===============================================
Please enter your staff ID: n
Please enter your password: n
============================================ Main Menu =============================================
Login as [Nurse] dummy Nurse | n | 
0.	Patient Mangement
1.	Appointment Management
2.	MedRecord Management
3.	Medicine Management
4.	Admin
5.	Logoff
Please select a function: 1
====================================== Appointment Mangement =======================================
0.	View Appointment History
1.	View Pending Appointment
2.	Create Appointment
3.	Update Appointment Status
4.	Earliest next Appointment
Please select a function: 2
========================================== Select Patient ==========================================
Please input patient's HKID: a123456
[Patient] Dummy patient | M | a123456 | 2020-06-29 | 
======================================== Create appointment ========================================
Please enter the date (DD/MM/YYYY): 1
Please enter the time (HH:MM:SS): 1
============================================== ERROR ===============================================
java.lang.NullPointerException: Cannot invoke "java.time.LocalDate.atTime(java.time.LocalTime)" because "date" is null