Buggy code:
public class WhenRunningATestScenario extends AbstractTestStepRunnerTest { @ Before public void initMocks ( ) { } WebdriverInstanceFactory webdriverInstanceFactory ; @ Mock FirefoxDriver firefoxDriver ; MockEnvironmentVariables environmentVariables ; @ Rule public TemporaryFolder temporaryFolder = new TemporaryFolder ( ) ; WebDriverFactory webDriverFactory ; @ Before public void createATestableDriverFactory ( ) throws Exception { } @ Test public void the_test_can_specify_a_diffrent_driver ( ) throws InitializationError { } @ Test public void the_test_can_specify_a_diffrent_driver_for_an_individual_test ( ) throws InitializationError { } @ Test public void the_test_runner_records_the_steps_as_they_are_executed ( ) throws InitializationError { } @ Test public void private_annotated_fields_should_be_allowed ( ) throws InitializationError { } @ Test public void annotated_fields_should_be_allowed_in_parent_classes ( ) throws InitializationError { } @ Test public void tests_marked_as_pending_should_be_pending ( ) throws InitializationError { } @ Test public void tests_marked_as_ignored_should_be_skipped ( ) throws InitializationError { } @ Test public void non_pending_tests_with_no_steps_should_be_marked_as_successful ( ) throws InitializationError { } @ Test public void tests_should_be_run_after_an_assertion_error ( ) throws InitializationError { } @ Test public void tests_should_be_run_after_a_webdriver_error ( ) throws InitializationError { } @ Test public void webdriver_error_should_be_recorded_when_at_the_end_of_the_test ( ) throws InitializationError { } @ Test public void failing_tests_with_no_steps_should_still_record_the_error ( ) throws InitializationError { } @ Test public void the_test_runner_skips_any_tests_after_a_failure ( ) throws Exception { } @ Test public void the_test_runner_skips_any_ignored_tests ( ) throws Exception { } @ Test public void the_test_runner_skips_any_tests_after_a_webdriver_error ( ) throws Exception { } @ Test public void when_a_test_fails_the_message_is_recorded_in_the_test_step ( ) throws Exception { ThucydidesRunner runner = new ThucydidesRunner ( SingleTestScenario . class , webDriverFactory ) ; runner . run ( new RunNotifier ( ) ) ; List < TestOutcome > executedScenarios = runner . getTestOutcomes ( ) ; TestOutcome testOutcome = executedScenarios . get ( 0 ) ; List < TestStep > steps = testOutcome . getTestSteps ( ) ; TestStep failingStep = ( ( TestStep ) ( steps . get ( 5 ) ) ) ; <START_BUG> assertThat ( failingStep . getErrorMessage ( ) , allOf ( containsString ( "Expected:<seq2seq4repair_space>is<seq2seq4repair_space><2>" ) , containsString ( "got:<seq2seq4repair_space><1>" ) ) ) ; <END_BUG> } @ Test public void when_a_test_fails_the_exception_is_recorded_in_the_test_step ( ) throws Exception { } @ Test public void when_a_test_throws_a_webdriver_exception_it_is_recorded_in_the_test_step ( ) throws Exception { } @ Test public void when_a_test_throws_a_runtime_exception_it_is_recorded_in_the_test_step ( ) throws Exception { } @ Test public void the_test_runner_should_notify_test_failures ( ) throws Exception { } @ Test public void the_test_runner_initializes_the_steps_object ( ) throws InitializationError { } @ Test public void the_test_runner_records_the_name_of_the_test_scenario ( ) throws InitializationError { } @ Test public void the_test_runner_records_each_step_of_the_test_scenario ( ) throws InitializationError { } @ Test public void the_test_runner_distinguishes_between_ignored_skipped_and_pending_steps ( ) throws InitializationError { } @ Test public void the_test_runner_executes_steps_with_parameters ( ) throws InitializationError { } @ Test public void the_test_runner_should_store_screenshots_only_for_successful_and_failed_tests ( ) throws Exception { } @ Test public void the_test_runner_executes_tests_in_groups ( ) throws InitializationError { } @ Test public void the_test_runner_records_an_acceptance_test_result_for_each_test ( ) throws InitializationError { } @ Test public void the_test_runner_derives_the_user_story_from_the_test_case_class ( ) throws InitializationError { } @ Test public void the_test_runner_records_each_step_with_a_nice_name ( ) throws InitializationError { } @ Test public void default_test_names_can_be_overriden_in_the_Test_annotation ( ) throws InitializationError { } @ Test public void the_test_runner_records_each_step_with_a_nice_name_when_steps_have_parameters ( ) throws InitializationError { } @ Test public void the_test_runner_records_each_step_with_a_nice_name_when_steps_have_multiple_parameters ( ) throws InitializationError { } @ Test public void step_titles_can_be_overridden_with_the_StepDescription_annotation ( ) throws InitializationError { } @ Test public void scenario_titles_can_be_overridden_with_the_Title_annotation ( ) throws InitializationError { } @ Test public void the_test_scenario_does_not_need_a_steps_field ( ) throws InitializationError { } @ Test public void the_test_scenario_does_not_need_steps ( ) throws InitializationError { } @ Test public void the_manager_should_ignore_close_if_the_webdriver_if_not_defined ( ) { } class TestableThucydidesRunner extends ThucydidesRunner { private final File testOutputDirectory ; public TestableThucydidesRunner ( final Class < ? > klass , File outputDirectory ) throws InitializationError { } public TestableThucydidesRunner ( Class < ? > klass , WebDriverFactory webDriverFactory , File outputDirectory ) throws InitializationError { } @ Override public File getOutputDirectory ( ) { } } @ Test public void xml_test_results_are_written_to_the_output_directory ( ) throws InitializationError { } @ Test public void xml_test_results_for_multiple_stories_are_written_to_the_output_directory ( ) throws InitializationError { } @ Test public void xml_test_results_for_multiple_successful_stories_are_written_to_the_output_directory ( ) throws InitializationError { } @ Test public void html_test_results_are_written_to_the_output_directory ( ) throws InitializationError { } @ Test public void test_scenarios_should_not_need_a_webdriver ( ) throws InitializationError { } private class XMLFileFilter implements FilenameFilter { public boolean accept ( File file , String filename ) { } } private class HTMLFileFilter implements FilenameFilter { public boolean accept ( File file , String filename ) { } } No newline ; at end ; of file ; }

Fix:
assertThat ( failingStep . getErrorMessage ( ) , allOf ( containsString ( "Expected:<seq2seq4repair_space>is<seq2seq4repair_space><2>" ) , containsString ( "but:<seq2seq4repair_space>was<seq2seq4repair_space><1>" ) ) ) ;