私はApache Jmeterでアプリケーションをテストしています。私は、データベース内のユーザを追加する登録ユーザメソッドを呼び出すことを考えました。しかし、電子メールがすでに存在する場合、データベースアクションは実行されません。身体データに乱数を追加するにはどうすればよいですか?または、私のアプリケーションがデータベースに接続されていることをテストすることができる他の方法がありますか?ありがとうございました。 Apache Jmeter:要求のために本文にランダムデータを追加してください
コントローラーコード:
@RequestMapping(value = "/person/add", method = RequestMethod.POST)
public String addPerson(@ModelAttribute("person") Person person, BindingResult bindingResult) {
System.out.println("Person add called"+person.getUsername());
person.setUsername(this.stripHTML(person.getUsername()));
int personId = this.personService.addPerson(person);
if (!(personId == 0)) {
Person person1 = this.personService.getPersonById(personId);
Collection<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
Authentication authentication = new UsernamePasswordAuthenticationToken(person1, null, authorities);
SecurityContextHolder.getContext().setAuthentication(authentication);
return "redirect:/canvaslisting";
} else {
return "redirect:/";
}
}
ありがとう
は、ここではいくつかのスクリーンショットです。
変数名emailValueと
あなたのUUIDがうまくいったので、私はそれを使用します。現在の問題の新しい質問を作成します。ありがとう。 –