Skip to content

Commit

Permalink
Merge pull request #45201 from ozangunalp/devservicescontext_injection
Browse files Browse the repository at this point in the history
Inject DevServicesContext in QuarkusTest via default TestResource
  • Loading branch information
geoand authored Dec 20, 2024
2 parents 00b8eb2 + a2fbed4 commit ef4b24e
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 272 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.hamcrest.Matchers.is;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -49,12 +48,6 @@ public String getConfigProfile() {
// In this test, we do NOT set quarkus.hibernate-search-orm.elasticsearch.hosts.
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -47,12 +46,6 @@ public String getConfigProfile() {
// In this test, we DO set quarkus.hibernate-search-orm.elasticsearch.hosts (see above).
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
Expand All @@ -27,12 +25,6 @@ public String getConfigProfile() {
// In this test, we do NOT set quarkus.hibernate-search-orm.elasticsearch.hosts.
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -40,11 +39,6 @@ public String getConfigProfile() {
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.hamcrest.Matchers.is;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -49,12 +48,6 @@ public String getConfigProfile() {
// In this test, we do NOT set quarkus.hibernate-search-orm.elasticsearch.hosts.
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -47,12 +46,6 @@ public String getConfigProfile() {
// In this test, we DO set quarkus.hibernate-search-orm.elasticsearch.hosts (see above).
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
Expand All @@ -28,12 +26,6 @@ public String getConfigProfile() {
// In this test, we do NOT set quarkus.hibernate-search-orm.elasticsearch.hosts.
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.hamcrest.Matchers.is;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -50,11 +49,6 @@ public String getConfigProfile() {
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -48,11 +47,6 @@ public String getConfigProfile() {
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
Expand All @@ -28,11 +26,6 @@ public String getConfigProfile() {
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.hamcrest.Matchers.is;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -49,12 +48,6 @@ public String getConfigProfile() {
// In this test, we do NOT set quarkus.hibernate-search-standalone.elasticsearch.hosts.
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -48,11 +47,6 @@ public String getConfigProfile() {
return "someotherprofile";
}

@Override
public List<TestResourceEntry> testResources() {
// Enables injection of DevServicesContext
return List.of(new TestResourceEntry(DevServicesContextSpy.class));
}
}

DevServicesContext context;
Expand Down
Loading

0 comments on commit ef4b24e

Please sign in to comment.