ImportUser { public void add(User user){ this.storage.add(user); } @Autowired  ImportUser(Crud storage); void add(User user); void getUsers(); static void main(String[] args);  }
@Test public void whenAddUserInMemoryStorageShouldAssignId(){ ApplicationContext context = new ClassPathXmlApplicationContext("spring-config-test.xml"); ImportUser importUser = new ImportUser(context.getBean(MemoryDAO.class)); User user = new User(); user.setName("test"); importUser.add(user); assertThat(1,is(user.getId())); }