Saving table changes

Report a typo

You have the following test class in your project:

@DataJpaTest
//annotation missed
class ApplicationTests {

    @Autowired
    private UserRepository userRepository;

    @Test
    void testAddindDataToTable() {
        userRepository.save(new User(1, "John"));
        userRepository.save(new User(2, "Jack"));
        List<Product> userList = userRepository.findAll();
        assertEquals(2, userList.size());
    }
}

What code line must be used instead of the comment to save new users after the test execution?

Select one option from the list
___

Create a free account to access the full topic