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