### Question:
PostmanService { int toErrorLine(Failure failure) { if (Failure.AT_PRE_REQUEST_SCRIPT.equals(failure.getAt())) { return LINE_PRE_REQUEST_SCRIPT; } if (Failure.AT_TEST_SCRIPT.equals(failure.getAt())) { return LINE_TEST_SCRIPT; } return (failure.getError().getIndex() == null ? REQUEST_LINE : failure.getError().getIndex().intValue()); }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); static final String FOLDER_DELIMITER; }### Answer:
@Test public void toErrorLine_should_return_minus_100000_for_pre_request_script() { Failure failure = new Failure().withAt("prerequest-script"); final int line = cut.toErrorLine(failure); assertThat(line).isEqualTo(-100000); }
@Test public void toErrorLine_should_return_100000_for_test_script() { Failure failure = new Failure().withAt("test-script"); final int line = cut.toErrorLine(failure); assertThat(line).isEqualTo(100000); }
@Test public void toErrorLine_should_return_request_line_for_null_error_index() { Failure failure = new Failure().withError(new com.decathlon.ara.scenario.postman.bean.Error()); final int line = cut.toErrorLine(failure); assertThat(line).isEqualTo(-1); }
@Test public void toErrorLine_should_return_error_index_when_present() { Failure failure = new Failure().withError(new com.decathlon.ara.scenario.postman.bean.Error().withIndex(Integer.valueOf(5))); final int line = cut.toErrorLine(failure); assertThat(line).isEqualTo(5); }