Skip to content

Commit e5a77ce

Browse files
committed
kinda fix tests
1 parent eb4f20a commit e5a77ce

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@
209209
<extensions>true</extensions>
210210
</plugin>
211211
</plugins>
212+
<testResources>
213+
<testResource>
214+
<directory>src/main/resources</directory>
215+
</testResource>
216+
</testResources>
212217
</build>
213218

214219
<profiles>

src/main/java/com/github/sfxd/trust/discord/JdaMessages.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010

1111
@Singleton
1212
public class JdaMessages implements Messages {
13-
//field injection is delayed so it avoids the circle
14-
@Inject JDA jda;
13+
private final JDA jda;
14+
15+
@Inject
16+
public JdaMessages(JDA jda) {
17+
this.jda = jda;
18+
}
1519

1620
@Override
1721
public void send(Message message) {

src/main/java/com/github/sfxd/trust/inject/PropertiesProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PropertiesProducer {
1212
@Bean
1313
public Properties produceProperties() throws IOException {
1414
var properties = new Properties();
15-
try (InputStream is = getClass().getResourceAsStream("application.properties")) {
15+
try (InputStream is = getClass().getClassLoader().getResourceAsStream("application.properties")) {
1616
properties.load(is);
1717
}
1818

src/main/java/com/github/sfxd/trust/instances/InstanceRepository.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@
66

77

88
import com.github.sfxd.trust.instances.query.QInstance;
9-
import io.ebean.Database;
10-
import jakarta.inject.Inject;
9+
import io.ebean.DB;
1110
import jakarta.inject.Singleton;
1211

1312
/** Finder for the Instance model */
1413
@Singleton
1514
public class InstanceRepository {
1615

17-
private final Database database;
18-
19-
@Inject
20-
public InstanceRepository(Database database) {
21-
this.database = database;
22-
}
23-
2416
/**
2517
* Finds an instance by its unique key (i.e. NA99, CS104)
2618
*
@@ -61,6 +53,6 @@ public Collection<Instance> findByIdIn(Collection<Long> ids) {
6153
}
6254

6355
public void save(Collection<Instance> instances) {
64-
this.database.saveAll(instances);
56+
DB.saveAll(instances);
6557
}
6658
}

0 commit comments

Comments
 (0)