So I'm new in java and in testing and I keep trying to test this function but i could not find a way. Any test goes. The function is part of bigger class called SignUp, that has other methods aswell. I know its not very well done :)
public static String newDayOfBirth() {
Scanner scanner = new Scanner(System.in);
String dayOfBirth = scanner.nextLine();
if(Integer.parseInt(dayOfBirth) > 0 && Integer.parseInt(dayOfBirth) < 32){
return dayOfBirth;
}
else {
System.out.println("Eneter a valid day of birth");
dayOfBirth = scanner.nextLine();
return dayOfBirth;
}
}