You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by bm...@apache.org on 2023/06/21 08:40:33 UTC
[shiro] 01/01: [#942] Fix flaky test; update snakeyaml for test app
This is an automated email from the ASF dual-hosted git repository.
bmarwell pushed a commit to branch #942_fix_flaky_ol_test
in repository https://gitbox.apache.org/repos/asf/shiro.git
commit bf67793c304cc3742a621708cceefde6bd310e87
Author: Benjamin Marwell <bm...@apache.org>
AuthorDate: Wed Jun 21 10:40:01 2023 +0200
[#942] Fix flaky test; update snakeyaml for test app
---
integration-tests/jaxrs/app/pom.xml | 13 +++++++++++++
.../testing/jaxrs/app/dao/InMemoryStormtrooperDao.java | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/integration-tests/jaxrs/app/pom.xml b/integration-tests/jaxrs/app/pom.xml
index 7d9463c1f..91564ba05 100644
--- a/integration-tests/jaxrs/app/pom.xml
+++ b/integration-tests/jaxrs/app/pom.xml
@@ -46,10 +46,23 @@
<artifactId>shiro-jaxrs</artifactId>
</dependency>
+ <!-- needed by javafaker, override -->
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>2.0</version>
+ </dependency>
+
<dependency>
<groupId>com.github.javafaker</groupId>
<artifactId>javafaker</artifactId>
<version>1.0.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
diff --git a/integration-tests/jaxrs/app/src/main/java/org/apache/shiro/testing/jaxrs/app/dao/InMemoryStormtrooperDao.java b/integration-tests/jaxrs/app/src/main/java/org/apache/shiro/testing/jaxrs/app/dao/InMemoryStormtrooperDao.java
index 4c4f0e250..25ad4b440 100644
--- a/integration-tests/jaxrs/app/src/main/java/org/apache/shiro/testing/jaxrs/app/dao/InMemoryStormtrooperDao.java
+++ b/integration-tests/jaxrs/app/src/main/java/org/apache/shiro/testing/jaxrs/app/dao/InMemoryStormtrooperDao.java
@@ -45,7 +45,7 @@ public class InMemoryStormtrooperDao implements StormtrooperDao {
static {
Faker faker = new Faker();
final FakeValuesService fakeValuesService = new FakeValuesService(Locale.ENGLISH, new RandomService());
- for (int ii = 0; ii < 50; ii++) {
+ while (TROOPERS.size() < 50) {
final StormtrooperId stormtrooperId = new StormtrooperId(fakeValuesService.numerify("u######"));
final Name name = faker.name();
final Instant registeredAt = faker.date().birthday(16, 67).toInstant();