• 10 hours
  • Medium

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 1/4/21

Validate requirements using integration & end-to-end testing

Evaluated skills

  • Validate requirements using Integration & End to End Testing

Description

A quiz covering different types of integration tests, interspersed with code interpretation and definitions. The test will cover the integration testing scenarios and suitable user journeys for E2E tests, as well as the PageObject pattern.

  • Question 1

    Which one of the following statements is true of component integration tests?

    • They test individual classes in isolation. 

    • They focus on testing visual components in your user interface layer.

    • They test how well real instances of classes work together. 

    • They launch your complete application, and ensure that it can be used by users.

  • Question 2

    Which of the following is true of system integration tests?

    Careful, there are several correct answers.
    • They test many different scenarios for each implemented class.

    • They test whether the integration of our frameworks and classes work together as expected. 

    • They test whether our application can communicate with other applications it needs to work with.

    • They test whether our application has accessible user interfaces and uses readable fonts.

    • They test whether an application running in production is working as expected. 

  • Question 3

    Have a look at the following Spring system integration test, taking special note of the comment at line 13. 

    @WebMvcTest(controllers = {PersonController.class})
    @RunWith(SpringJUnit4ClassRunner.class)
    public class PersonControllerSIT {
    
        @Autowired
        private MockMvc mockMvc;
    
        @Autowired
        private PersonController personControllerUnderTest;
    
        @Test
        public void givenAPersonIsUsingTheApp_whenARequestIsMade_thenAPageIsShown() throws Exception {
            // NOTE that the controller uses the @ResponseBody annotation so that
            // whatever value it returns gets shown to us in the call to content() below.
            // This allows us to test
            mockMvc.perform(post("/application/person")).
                andExpect(status().is2xxSuccessful()).
                andExpect(content().string(containsString("person"));
        }
    }
    
    

    Which of the following methods in PersonController is being tested here?

    • @GetMapping("/application/person")
      public @ResponseBody String getAPerson() {
          return "person";
      }
      

       

    • @PostMapping("/person")
      public @ResponseBody String makeAPerson() {
          return "person";
      }
      

       

    • @PostMapping("/application/person")
      public @ResponseBody String makeAPerson() {
          return "person";
      }
      

       

    • @PutMapping("/path/to/person")
      public @ResponseBody String applicationPerson() {
          return "person";
      }
      
Ever considered an OpenClassrooms diploma?
  • Up to 100% of your training program funded
  • Flexible start date
  • Career-focused projects
  • Individual mentoring
Find the training program and funding option that suits you best