<commit_before>/*
 * Copyright 2019 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package controllers.aboutthebusiness

import java.util.UUID

import connectors.DataCacheConnector
import models.aboutthebusiness.{AboutTheBusiness, ContactingYou}
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.mockito.Matchers._
import org.mockito.Mockito._
import org.scalatest.BeforeAndAfterEach
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.mock.MockitoSugar
import utils.AmlsSpec
import play.api.i18n.Messages
import play.api.test.Helpers._
import uk.gov.hmrc.http.cache.client.CacheMap
import utils.AuthorisedFixture

import scala.concurrent.Future

class ContactingYouControllerSpec extends AmlsSpec with MockitoSugar with ScalaFutures with BeforeAndAfterEach {

  val userId = s"user-${UUID.randomUUID}"
  val contactingYou = Some(ContactingYou(Some("+44 (0)123 456-7890"), Some("<EMAIL>")))
  val aboutTheBusinessWithData = AboutTheBusiness(contactingYou = contactingYou)

  trait Fixture extends AuthorisedFixture {
    self => val request = addToken(authRequest)

    val controller = new ContactingYouController {
      override val dataCache = mock[DataCacheConnector]
      override val authConnector = self.authConnector
    }
  }

  val emptyCache = CacheMap("", Map.empty)

  "BusinessHasEmailController" must {

    "Get" must {

      "load the page" in new Fixture {<commit_msg>AMLS-4636 | Amended ContactingYouControllerSpec to DI<commit_after>/*
 * Copyright 2019 HM Revenue & Customs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package controllers.aboutthebusiness

import java.util.UUID

import connectors.DataCacheConnector
import models.aboutthebusiness.{AboutTheBusiness, ContactingYou}
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.mockito.Matchers._
import org.mockito.Mockito._
import org.scalatest.BeforeAndAfterEach
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.mock.MockitoSugar
import utils.AmlsSpec
import play.api.i18n.Messages
import play.api.test.Helpers._
import uk.gov.hmrc.http.cache.client.CacheMap
import utils.AuthorisedFixture

import scala.concurrent.Future

class ContactingYouControllerSpec extends AmlsSpec with MockitoSugar with ScalaFutures with BeforeAndAfterEach {

  val userId = s"user-${UUID.randomUUID}"
  val contactingYou = Some(ContactingYou(Some("+44 (0)123 456-7890"), Some("<EMAIL>")))
  val aboutTheBusinessWithData = AboutTheBusiness(contactingYou = contactingYou)

  trait Fixture extends AuthorisedFixture {
    self => val request = addToken(authRequest)

    val controller = new ContactingYouController (
      dataCache = mock[DataCacheConnector],
      authConnector = self.authConnector
    )
  }

  val emptyCache = CacheMap("", Map.empty)

  "BusinessHasEmailController" must {

    "Get" must {

      "load the page" in new Fixture {
{'fraction_non_alphanumeric': 0.07919531448943214, 'fraction_numerical': 0.012732365673542145, 'mean_word_length': 4.63558106169297, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4627628', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1109, 'n_words': 352}