Class ApplicationTests

java.lang.Object
org.oxerr.spring.security.otp.samples.helloworld.ApplicationTests

@SpringBootTest @AutoConfigureMockMvc class ApplicationTests extends Object
  • Field Details

    • mockMvc

      @Autowired private org.springframework.test.web.servlet.MockMvc mockMvc
  • Constructor Details

    • ApplicationTests

      ApplicationTests()
  • Method Details

    • loginWithValidUserThenAuthenticated

      @Test void loginWithValidUserThenAuthenticated() throws Exception
      Throws:
      Exception
    • loginWithInvalidUserThenUnauthenticated

      @Test void loginWithInvalidUserThenUnauthenticated() throws Exception
      Throws:
      Exception
    • accessUnsecuredResourceThenOk

      @Test void accessUnsecuredResourceThenOk() throws Exception
      Throws:
      Exception
    • accessSecuredResourceUnauthenticatedThenRedirectsToLogin

      @Test void accessSecuredResourceUnauthenticatedThenRedirectsToLogin() throws Exception
      Throws:
      Exception
    • accessSecuredResourceAuthenticatedThenOk

      @Test @WithMockUser void accessSecuredResourceAuthenticatedThenOk() throws Exception
      Throws:
      Exception