<commit_before>package controllers.disposal_of_vehicle

import helpers.{WithApplication, UnitSpec}
import play.api.test.FakeRequest
import services.fakes.FakeDateServiceImpl._
import services.DateService
import org.mockito.Mockito._
import composition.TestComposition.{testInjector => injector}
import common.ClientSideSessionFactory
import play.api.http.Status._

final class VrmLockedUnitSpec extends UnitSpec {
  "present" should {
    "display the page" in new WithApplication {
      val request = FakeRequest().withSession()
      val clientSideSessionFactory = injector.getInstance(classOf[ClientSideSessionFactory])
      val result = new controllers.disposal_of_vehicle.VrmLocked(dateServiceStubbed())(clientSideSessionFactory).present(request)
      whenReady(result) {
        r => r.header.status should equal(OK)
      }
    }
  }

  private def dateServiceStubbed(day: Int = dateOfDisposalDayValid.toInt,
                                 month: Int = dateOfDisposalMonthValid.toInt,
                                 year: Int = dateOfDisposalYearValid.toInt) = {
    val dateService = mock[DateService]
    when(dateService.today).thenReturn(new models.DayMonthYear(day = day,
      month = month,
      year = year))
    dateService
  }

}<commit_msg>US270 CSRF needs to be in unit spec requests<commit_after>package controllers.disposal_of_vehicle

import helpers.{WithApplication, UnitSpec}
import play.api.test.FakeRequest
import services.fakes.FakeDateServiceImpl._
import services.DateService
import org.mockito.Mockito._
import composition.TestComposition.{testInjector => injector}
import common.ClientSideSessionFactory
import play.api.http.Status._

final class VrmLockedUnitSpec extends UnitSpec {
  "present" should {
    "display the page" in new WithApplication {
      val request = FakeCSRFRequest()
      val clientSideSessionFactory = injector.getInstance(classOf[ClientSideSessionFactory])
      val result = new controllers.disposal_of_vehicle.VrmLocked(dateServiceStubbed())(clientSideSessionFactory).present(request)
      whenReady(result) {
        r => r.header.status should equal(OK)
      }
    }
  }

  private def dateServiceStubbed(day: Int = dateOfDisposalDayValid.toInt,
                                 month: Int = dateOfDisposalMonthValid.toInt,
                                 year: Int = dateOfDisposalYearValid.toInt) = {
    val dateService = mock[DateService]
    when(dateService.today).thenReturn(new models.DayMonthYear(day = day,
      month = month,
      year = year))
    dateService
  }

}
{'fraction_non_alphanumeric': 0.08186447316882099, 'fraction_numerical': 0.0011750881316098707, 'mean_word_length': 3.6268115942028984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2767271', 'n_tokens_mistral': 719, 'n_tokens_neox': 713, 'n_words': 148}