@Test
public void shouldRejectSpaceServiceAccountWithTailingSpace() {

  String[] invalidServiceAccounts = {"sa@abc.com ", "sa@abc.com\n"};
  // We are looping through the invalid service account list because JUnitParameter removes
  // the trailing spaces and new line but that are the cases we need to test
  for (String serviceAccount : invalidServiceAccounts) {
    WorkflowConfiguration configuration =
        WorkflowConfigurationBuilder.from(FULL_WORKFLOW_CONFIGURATION)
            .serviceAccount(serviceAccount)
            .build();
    assertThat(
        sut.validateWorkflow(Workflow.create("test", configuration)),
        contains("service account is not a valid email address: " + serviceAccount));
    }
}