Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space ENGINES1031 and version 10.4.1

...

  1. Choose Parasoft> Show View> Unit Test Assistant from the Eclipse menu bar to open the Unit Test Assistant interface.
  2. Select a Spring controller in the editor. UTA will analyze your code and display one or more options that are available for the selection. The following options may be displayed:
    - Regular Spring creates a test for the selected method.
    Parameterized Spring creates parameterized test cases. 
    - Add Spring test case(s) creates tests for multiple methods from the controller.
  3. Select one of the available options. If you choose Add Spring test case(s), select the methods you want to create test cases for when prompted, and click OK. See Creating Multiple Unit Tests for details.
  4. The generated test or tests

    generated

    include sample assertion templates and default UTA values. View the test(s) to uncomment the sample assertions and modify the values.
    Image Modified

    Info

    Spring tests created with UTA do not include optional parameters. For example the following parameter will not be included:
    @RequestParam(value = "count", required = false)

  5. Run the test with UTA to collect coverage information and recommendations for possible improvements (see Executing Unit Tests with Unit Test Assistant). To facilitate finding handler method calls in the execution flow tree, most internal Spring calls are hidden.

Configuring Spring tests with the ContextConfiguration Annotation

...