Content ITV PRO
This is Itvedant Content department
Business Scenario
In this lab, you will prepare the Medicare application for final verification by setting up test doctor accounts and profiles, then testing the complete application through the React frontend.
Pre-Lab Preparation
Module:
1) React Basics & Backend Integration (Spring Boot)
Phase 15 — Final Data Setup + API & Frontend Testing
1. Add enough test data 2. Test the complete application from the frontend 3. Run a small final API/security test
Add test data first
1
Appointments Payments Prescriptions Patients
Doctors
Page 1 → 6 doctors Page 2 → remaining doctor
Doctor test accounts
2
| Doctor | Specialization | Experience | Fee | |
|---|---|---|---|---|
| Dr. Ananya Sharma | ananya.doctor@example.com | Cardiologist | 12 | 1800 |
| Dr. Rohit Mehta | rohit.doctor@example.com | Orthopedic | 8 | 1200 |
| Dr. Neha Patil | neha.doctor@example.com | Dentist | 6 | 800 |
| Dr. Arjun Rao | arjun.doctor@example.com | General Physician | 10 | 700 |
| Dr. Kavya Iyer | kavya.doctor@example.com | Cardiologist | 5 | 1400 |
| Dr. Sameer Khan | sameer.doctor@example.com | Orthopedic | 15 | 2000 |
| Dr. Priya Nair | priya.doctor@example.com | Dentist | 9 | 1000 |
Doctor@123
Easiest way to insert them
3
USE medicare_db;
INSERT IGNORE INTO users
(name, email, phone, role, password)
VALUES
(
'Dr. Ananya Sharma',
'ananya.doctor@example.com',
'9000000001',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),
(
'Dr. Rohit Mehta',
'rohit.doctor@example.com',
'9000000002',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),
(
'Dr. Neha Patil',
'neha.doctor@example.com',
'9000000003',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),(
'Dr. Arjun Rao',
'arjun.doctor@example.com',
'9000000004',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),
(
'Dr. Kavya Iyer',
'kavya.doctor@example.com',
'9000000005',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),
(
'Dr. Sameer Khan',
'sameer.doctor@example.com',
'9000000006',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
),
(
'Dr. Priya Nair',
'priya.doctor@example.com',
'9000000007',
'DOCTOR',
'$2y$10$9vkfZH2psSI9/RAWTZ8bCOAt7J40JPHyhJEPg82RhsR4AvFZza71S'
);Insert doctor profiles
4
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'Cardiologist', 12, 1800.00, NULL
FROM users WHERE email = 'ananya.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'Orthopedic', 8, 1200.00, NULL
FROM users WHERE email = 'rohit.doctor@example.com'
AND NOT EXISTS ( SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'Dentist', 6, 800.00, NULL
FROM users WHERE email = 'neha.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'General Physician', 10, 700.00, NULL
FROM users WHERE email = 'arjun.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)SELECT id, 'Cardiologist', 5, 1400.00, NULL
FROM users WHERE email = 'kavya.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'Orthopedic', 15, 2000.00, NULL
FROM users WHERE email = 'sameer.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);
INSERT INTO doctor_profiles
(user_id, specialization, experience_years, consultation_fee, photo_url)
SELECT id, 'Dentist', 9, 1000.00, NULL
FROM users WHERE email = 'priya.doctor@example.com'
AND NOT EXISTS (
SELECT 1
FROM doctor_profiles
WHERE user_id = users.id
);Verify doctor data once
5
GET http://localhost:8080/api/doctors?page=0&size=6
totalElements = 7 totalPages = 2
Start frontend testing
6
http://localhost:5173
http://localhost:8080
Test 1 — Patient registration
Name: Rahul Patil Email: rahul.patient@example.com Phone: 9876543210 Password: Patient@123
Registration successful Role = PATIENT
Test 2 — Patient login
rahul.patient@example.com Patient@123
Test 3 — My Profile
Patient Dashboard → My Profile
Rahul Patil rahul.patient@example.com 9876543210 PATIENT
Test 4 — Doctor listing
Patient Dashboard → Find Doctor
Search by name Specialization Maximum fee Sort by fee Sort by name Sort by experience Ascending Descending Reset Filters
Page 1 Page 2
Test 5 — Book appointment
Dr. Ananya Sharma Cardiologist
Future date 10:00 AMAppointment Created PENDING UNPAID
Test 6 — Razorpay payment
success@razorpay
failure@razorpay
Appointment Status: CONFIRMED Payment Status: PAID
Test 7 — Email
Patient name Doctor Specialization Date Slot Fee CONFIRMED PAID
Test 8 — My Appointments
Patient Dashboard → My Appointments
Dr. Ananya Sharma CONFIRMED PAID
Test 9 — Doctor login
ananya.doctor@example.com Doctor@123
Test 10 — Doctor profile
Doctor Dashboard → My Profile
Cardiologist 12 years ₹1800
Experience: 12 → 13
Test 11 — Doctor schedule
Doctor Dashboard → My Schedule
CONFIRMED + PAID
Mark Completed
COMPLETED + PAID
Test 12 — Prescription
Add Prescription
Diagnosis: Seasonal viral fever Doctor Notes: Drink plenty of fluids and take adequate rest.
Medicine Name: Paracetamol Dosage: 500 mg Frequency: Twice daily Duration: 3 days
Medicine Name: Vitamin C Dosage: 500 mg Frequency: Once daily Duration: 5 days
Test 13 — Patient views prescription
rahul.patient@example.com Patient@123
COMPLETED PAID
View Prescription
Doctor name Diagnosis Paracetamol Vitamin C Dosage Frequency Duration Doctor Notes
Test 14 — Cancellation flow
Dr. Rohit Mehta
PENDING UNPAID
CANCELLED UNPAID
Test 15 — Failed/closed payment
PENDING UNPAID
Final API testing
7
GET http://localhost:8080/api/health
200 OK
{
"email": "rahul.patient@example.com",
"password": "WrongPassword123"
}401 Unauthorized
GET http://localhost:8080/api/users/me
Authorization: Bearer invalid-token
401 Unauthorized
POST http://localhost:8080/api/doctors/profile
403 FORBIDDEN
ananya.doctor@example.com , Doctor@123
POST http://localhost:8080/api/appointments
403 FORBIDDEN
Name: Amit Kumar Email: amit.patient@example.com Phone: 9876501234 Password: Patient@123
GET http://localhost:8080/api/appointments/12
403 FORBIDDEN
HURRAY!! WE DID IT!
Congratulations on completing all the labs and building Medicare from the ground up!
One project, countless concepts, and a lot of learning. What an achievement!
Git Push
git push origin branchNameBy Content ITV