mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-08 03:29:41 +01:00
Fix test unit
This commit is contained in:
parent
7a78b321e7
commit
d7ae2a96e3
@ -94,11 +94,11 @@ public class Messages extends CustomConfiguration {
|
||||
*
|
||||
* @return The message
|
||||
*/
|
||||
private static String[] retrieve(String key) {
|
||||
if (!Settings.messagesLanguage.equalsIgnoreCase(singleton.language)) {
|
||||
singleton.reloadMessages();
|
||||
private String[] retrieve(String key) {
|
||||
if (!Settings.messagesLanguage.equalsIgnoreCase(language)) {
|
||||
reloadMessages();
|
||||
}
|
||||
String message = (String) singleton.get(key);
|
||||
String message = (String) get(key);
|
||||
if (message != null) {
|
||||
return formatMessage(message);
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class Messages extends CustomConfiguration {
|
||||
// Message is null: log key not being found and send error back as message
|
||||
String retrievalError = "Error getting message with key '" + key + "'. ";
|
||||
ConsoleLogger.showError(retrievalError + "Please verify your config file at '"
|
||||
+ singleton.getConfigFile().getName() + "'");
|
||||
+ getConfigFile().getName() + "'");
|
||||
return new String[]{
|
||||
retrievalError + "Please contact the admin to verify or update the AuthMe messages file."};
|
||||
}
|
||||
|
@ -33,12 +33,12 @@ public class RegisterCommandTest {
|
||||
|
||||
@Before
|
||||
public void initializeAuthMeMock() {
|
||||
AuthMeMockUtil.mockMessagesInstance();
|
||||
messagesMock = Messages.getInstance();
|
||||
|
||||
AuthMeMockUtil.mockAuthMeInstance();
|
||||
AuthMe pluginMock = AuthMe.getInstance();
|
||||
|
||||
messagesMock = mock(Messages.class);
|
||||
Mockito.when(pluginMock.getMessages()).thenReturn(messagesMock);
|
||||
|
||||
Settings.captchaLength = 10;
|
||||
managementMock = mock(Management.class);
|
||||
Mockito.when(pluginMock.getManagement()).thenReturn(managementMock);
|
||||
|
Loading…
Reference in New Issue
Block a user