Question: Hi i need help implementing the proper code for a JUnit test within my code for eclipse oxygen: package medical.com.medicalApplication.model; import static org.junit.Assert.*; import java.util.ArrayList;

Hi i need help implementing the proper code for a JUnit test within my code for eclipse oxygen:

package medical.com.medicalApplication.model;

import static org.junit.Assert.*;

import java.util.ArrayList; import java.util.List;

import org.junit.Test;

import medical.com.medicalApplication.services.DoctorService;

public class DoctorService { private static DoctorService reference = new DoctorService(); private static List doctors; DoctorService(){ doctors = new ArrayList(); } @Test public static DoctorService getReference(){ return reference; } @Test public List getAllDoctors(){ return doctors; } @Test public boolean addDoctor(String name, String id){ String tempId = new String(id); boolean createDoctor = !doctors.stream().anyMatch(doctor -> doctor.getId() == tempId); if (createDoctor) { doctors.add(new Doctor(name, id)); } return createDoctor; }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!