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 submitSuccessfully() {
        // Ensure the worker is null initially
        registerWorkerForm = new RegisterWorkerForm("John Doe", "Engineer", LocalDate.of(1990, 1, 1));

        assertNull(registerWorkerForm.worker);

        // Submit the form
        registerWorkerForm.submit();

        // Verify that the worker is not null after submission
        assertNotNull(registerWorkerForm.worker);

        // Verify that the worker's properties are set correctly
        assertEquals("John Doe", registerWorkerForm.worker.getName());
        assertEquals("Engineer", registerWorkerForm.worker.getOccupation());
        assertEquals(LocalDate.of(1990, 1, 1), registerWorkerForm.worker.getDateOfBirth());
    }