mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-01 23:53:27 +00:00
[AB-136] replacing some rare occurrences where fake objects where used for actual database operations
replacing a few sync commands with async commands refactoring parameters in assignable role place service bean fixing emote parameter handler to also consider default emojis removing unused description in command replacing some ARole parameters with Role parameters, so we can be sure they exists added a few TODOs marking exception changes required
This commit is contained in:
@@ -56,5 +56,14 @@ public class AEmoteParameterHandlerTest {
|
||||
Assert.assertEquals(aEmote, parsed);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultEmoteHandling() {
|
||||
String input = "test";
|
||||
when(emoteParameterHandler.handle(input, iterators, Emote.class, message)).thenReturn(null);
|
||||
when(emoteService.getFakeEmote(input)).thenReturn(aEmote);
|
||||
AEmote parsed = (AEmote) testUnit.handle(input, iterators, AEmote.class, message);
|
||||
Assert.assertEquals(aEmote, parsed);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -62,10 +62,9 @@ public class EmoteParameterHandlerTest {
|
||||
Assert.assertEquals(parsed, emote);
|
||||
}
|
||||
|
||||
@Test(expected = NumberFormatException.class)
|
||||
@Test
|
||||
public void testInvalidEmoteMention() {
|
||||
String input = "test";
|
||||
testUnit.handle(input, null, Emote.class, null);
|
||||
Assert.assertNull(testUnit.handle("test", null, Emote.class, null));
|
||||
}
|
||||
|
||||
private String getEmoteMention() {
|
||||
|
||||
@@ -59,4 +59,15 @@ public class FullEmoteParameterHandlerTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testDefaultEmoteHandling() {
|
||||
String input = "test";
|
||||
when(emoteParameterHandler.handle(input, iterators, Emote.class, message)).thenReturn(null);
|
||||
when(emoteService.getFakeEmote(input)).thenReturn(aEmote);
|
||||
FullEmote parsed = (FullEmote) testUnit.handle(input, iterators, AEmote.class, message);
|
||||
Assert.assertNull(parsed.getEmote());
|
||||
Assert.assertEquals(aEmote, parsed.getFakeEmote());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user