Closed tian-pengfei closed 3 years ago
you can get random number with special range .
server.request(by(uri("/random"))).response(template("${random(99,100)}")); running(server, () -> { String response = helper.get(remoteUrl("/random")); try { double result = Double.parseDouble(response); assertThat(result, lessThan(100d)); assertThat(result, greaterThan(99d)); System.out.println(result); } catch (NumberFormatException e) { fail(); } });
99.13 Results: SUCCESS (1 tests, 1 successes, 0 failures, 0 skipped)
Merged and also fixed a bug which get wrong index for end. :)
you can get random number with special range .