Skip to content

Commit

Permalink
Merge pull request #30995 from geoand/mongo-windows-issue
Browse files Browse the repository at this point in the history
Fix mongo test issues
  • Loading branch information
geoand authored Feb 8, 2023
2 parents 46ff02b + d7da5a5 commit 32d7672
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quarkus.mongodb.write-concern.journal=false
quarkus.mongodb.database=test
quarkus.mongodb.devservices.enabled=false
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.test.common.DevServicesContext;
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
@DisabledOnOs(OS.WINDOWS)
class MongoDbRestDataPanacheIT extends MongoDbRestDataPanacheTest {

DevServicesContext context;

@Test
public void testDevServicesProperties() {
assertThat(context.devServicesProperties()).hasSize(1).containsKey("quarkus.mongodb.connection-string");
assertThat(context.devServicesProperties()).isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.common.ResourceArg;
Expand All @@ -27,7 +25,6 @@

@QuarkusTest
@QuarkusTestResource(value = MongoTestResource.class, initArgs = @ResourceArg(name = MongoTestResource.PORT, value = "37017"))
@DisabledOnOs(OS.WINDOWS)
class MongoDbRestDataPanacheTest {

private Author dostoevsky;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public Map<String, String> start() {

startedServers = startReplicaSet(version, port, replicaSet);

return Collections.emptyMap();
return Collections.singletonMap("quarkus.mongodb.hosts", String.format("127.0.0.1:%d", port));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Map<String, String> start() {
.initializedWith(MongodArguments.defaults().withUseNoJournal(false)))
.start(version);

return Collections.emptyMap();
return Collections.singletonMap("quarkus.mongodb.hosts", String.format("127.0.0.1:%d", port));
}

@Override
Expand Down

0 comments on commit 32d7672

Please sign in to comment.