use of fr.xephi.authme.initialization.DataFolder in project AuthMeReloaded by AuthMe.
the class MessageFileHandlerProviderTest method shouldCreateHandler.
@Test
public void shouldCreateHandler() {
// given
String language = "fr";
given(settings.getProperty(PluginSettings.MESSAGES_LANGUAGE)).willReturn(language);
MessageFileHandlerProvider provider = Mockito.spy(handlerProvider);
Function<String, String> fileFunction = lang -> "file_" + lang + ".txt";
File file = new File(dataFolder, "some_file.txt");
doReturn(file).when(provider).initializeFile(language, fileFunction);
// when
MessageFileHandler handler = provider.initializeHandler(fileFunction);
// then
assertThat(handler, not(nullValue()));
verify(settings).getProperty(PluginSettings.MESSAGES_LANGUAGE);
verify(provider).initializeFile(language, fileFunction);
}
Aggregations