use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.
the class FileDispatcherTest method testParty.
@Test
public void testParty() {
PartiesYAMLDispatcher dispatcher = getFileDispatcher();
party(dispatcher, true);
dispatcher.stop();
}
use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.
the class FileDispatcherTest method testListParties.
@Test
public void testListParties() {
PartyManager mockPartyManager = mock(PartyManager.class);
when(mockPlugin.getPartyManager()).thenReturn(mockPartyManager);
when(mockPartyManager.initializeParty(any())).thenAnswer((mock) -> initializeParty(mock.getArgument(0)));
PlayerManager mockPlayerManager = mock(PlayerManager.class);
when(mockPlugin.getPlayerManager()).thenReturn(mockPlayerManager);
when(mockPlayerManager.initializePlayer(any())).thenAnswer((mock) -> initializePlayer(mock.getArgument(0)));
PartiesYAMLDispatcher dispatcher = getFileDispatcher();
populateWithParties(dispatcher);
listPartiesNumber(dispatcher);
listPartiesByName(dispatcher);
listPartiesByMembers(dispatcher);
listPartiesByKills(dispatcher);
listPartiesByExperience(dispatcher);
dispatcher.stop();
}
use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.
the class FileDispatcherTest method testExists.
@Test
public void testExists() {
PartiesYAMLDispatcher dispatcher = getFileDispatcher();
party(dispatcher, false);
exists(dispatcher);
dispatcher.stop();
}
use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.
the class FileDispatcherTest method testCountPlayersInParty.
@Test
public void testCountPlayersInParty() {
PartiesYAMLDispatcher dispatcher = getFileDispatcher();
countPlayersInParty(dispatcher);
dispatcher.stop();
}
use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.
the class FileDispatcherTest method getFileDispatcher.
private PartiesYAMLDispatcher getFileDispatcher() {
ConfigMain.STORAGE_SETTINGS_YAML_DBFILE = "database-" + (databaseId++) + ".yaml";
PartiesYAMLDispatcher ret = new PartiesYAMLDispatcher(mockPlugin);
ret.init();
assertFalse(ret.isFailed());
return ret;
}
Aggregations