Code:
public void addTest(int idUser) throws IOException {
String date = null;
String tec = null;
System.out.println("Enter name for test file :");
String file = input.next(); //Name of file
System.out.println("Enter date formatted as dd/mm/yyyy hh:mm :");
date = input.nextLine(); //String 2 parts
input.next();
System.out.println("Enter technician name :");
tec = input.nextLine(); // String 2+ parts
input.next();
String path = "C:\\Test\\Sample\\" + file;
String chain = readFile(path);
ClinicalTest test = new ClinicalTest(chain, date, idUser, tec);
System.out.println(test.getDate()+"\n" + test.getTec());
createTest(test);
}
When enter date 12-12-2018 13:45 and tec name Mark Zus, trying to create test fails. sysout only shows 13:45.
I tried input.next() under each nextLine() because if I don't, never let me complete date field.
This is what happen if only use nextLine() for each entry

