[AB-205] making exception message for command not found configurable

making feature config classes more unified in the naming
This commit is contained in:
Sheldan
2021-03-21 22:59:01 +01:00
parent 5eefc3909e
commit f53f0cb66c
44 changed files with 176 additions and 129 deletions

View File

@@ -20,7 +20,7 @@ import org.mockito.junit.MockitoJUnitRunner;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
import static dev.sheldan.abstracto.entertainment.config.EntertainmentFeature.ROLL_DEFAULT_HIGH_KEY;
import static dev.sheldan.abstracto.entertainment.config.EntertainmentFeatureConfig.ROLL_DEFAULT_HIGH_KEY;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

View File

@@ -1,7 +1,7 @@
package dev.sheldan.abstracto.entertainment.service;
import dev.sheldan.abstracto.core.service.ConfigService;
import dev.sheldan.abstracto.entertainment.config.EntertainmentFeature;
import dev.sheldan.abstracto.entertainment.config.EntertainmentFeatureConfig;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import org.junit.Assert;
@@ -79,7 +79,7 @@ public class EntertainmentServiceBeanTest {
when(guild.getIdLong()).thenReturn(serverId);
when(member.getGuild()).thenReturn(guild);
Long sides = 6L;
when(configService.getLongValue(EntertainmentFeature.ROULETTE_BULLETS_CONFIG_KEY, serverId)).thenReturn(sides);
when(configService.getLongValue(EntertainmentFeatureConfig.ROULETTE_BULLETS_CONFIG_KEY, serverId)).thenReturn(sides);
when(secureRandom.nextInt(sides.intValue())).thenReturn(randomValue);
boolean shot = testUnit.executeRoulette(member);
Assert.assertEquals(randomValue == 0, shot);