Skip to content

Commit

Permalink
PRSD-642: Updates RegisterLandlordControllerTests
Browse files Browse the repository at this point in the history
  • Loading branch information
isobel-softwire committed Dec 12, 2024
1 parent 07d5fc8 commit eb25bab
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
package uk.gov.communities.prsdb.webapp.controllers

import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.mockito.kotlin.whenever
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.test.web.servlet.get
import org.springframework.web.context.WebApplicationContext
import uk.gov.communities.prsdb.webapp.forms.journeys.LandlordRegistrationJourney
import uk.gov.communities.prsdb.webapp.forms.steps.LandlordRegistrationStepId
import uk.gov.communities.prsdb.webapp.services.LandlordService
import uk.gov.communities.prsdb.webapp.services.OneLoginIdentityService

@WebMvcTest(RegisterLandlordController::class)
class RegisterLandlordControllerTests(
@Autowired val webContext: WebApplicationContext,
) : ControllerTest(webContext) {
@MockBean
lateinit var mockLandlordRegistrationJourney: LandlordRegistrationJourney
lateinit var landlordRegistrationJourney: LandlordRegistrationJourney

@MockBean
lateinit var identityService: OneLoginIdentityService

@BeforeEach
fun steup() {
whenever(mockLandlordRegistrationJourney.initialStepId).thenReturn(LandlordRegistrationStepId.Email)
}
@MockBean
lateinit var landlordService: LandlordService

@Test
fun `RegisterLandlordController returns 200 for unauthenticated user`() {
Expand Down

0 comments on commit eb25bab

Please sign in to comment.