public void submit() {
    //Transmit information to our transfer object to communicate between layers
    saveToWorker();
    //call the service layer to register our worker
    service.registerWorker(worker);

    //check for any errors
    if (worker.getNotification().hasErrors()) {
      indicateErrors();
      LOGGER.info("Not registered, see errors");
    } else {
      LOGGER.info("Registration Succeeded");
    }
  }
@Test
    void submitWithErrors() {
        // Set up the worker with a notification containing errors
        registerWorkerForm = new RegisterWorkerForm(null, null, null);

        // Submit the form
        registerWorkerForm.submit();

        // Verify that the worker's properties remain unchanged
        assertNull(registerWorkerForm.worker.getName());
        assertNull(registerWorkerForm.worker.getOccupation());
        assertNull(registerWorkerForm.worker.getDateOfBirth());

        // Verify the presence of errors
        assertEquals(registerWorkerForm.worker.getNotification().getErrors().size(), 4);
    }