-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
comp-springIssue is related to Spring projects supportIssue is related to Spring projects supportcomp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-enhancementNew feature, improvement or change requestNew feature, improvement or change request
Milestone
Description
Description
Let's generate tests for the following code snippet
public UserServiceImpl(UserDao userDao) {
this.userDao = userDao;
}
@Transactional
@Override
public void add(User user) {
userDao.add(user);
}The following test is generated
@Test
public void testListUsers_UserDaoListUsers_1() {
/* This test fails because method [web.service.UserServiceImpl.listUsers] produces [java.lang.NullPointerException]
web.service.UserServiceImpl.listUsers(UserServiceImpl.java:28) */
userServiceImpl.listUsers();
}Actually, this test passes :)
And this behavior is correct because NPE is impossible on objects injected with Mock and InjectMocks.
Expected behavior
NPE tests should be generated only when this exception is really possible. We need to tune Symbolic engine for that.
Metadata
Metadata
Assignees
Labels
comp-springIssue is related to Spring projects supportIssue is related to Spring projects supportcomp-symbolic-engineIssue is related to the symbolic execution engineIssue is related to the symbolic execution enginectg-enhancementNew feature, improvement or change requestNew feature, improvement or change request
Type
Projects
Status
Done