mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 03:57:33 +01:00
Change some PageCacheHandlerTest methods
This commit is contained in:
parent
8eff9720ba
commit
ad2a3d80ae
@ -60,7 +60,7 @@ public class AnalysisCacheHandler {
|
||||
* @return true if there is data in the cache.
|
||||
*/
|
||||
public boolean isCached() {
|
||||
return (cache != null);
|
||||
return cache != null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ import main.java.com.djrapitops.plan.data.cache.PageCacheHandler;
|
||||
import main.java.com.djrapitops.plan.data.cache.PageLoader;
|
||||
import main.java.com.djrapitops.plan.ui.webserver.response.Response;
|
||||
import org.junit.Test;
|
||||
import test.java.utils.RandomData;
|
||||
|
||||
import static junit.framework.TestCase.*;
|
||||
|
||||
@ -11,13 +12,23 @@ import static junit.framework.TestCase.*;
|
||||
* @author Fuzzlemann
|
||||
*/
|
||||
public class PageCacheHandlerTest {
|
||||
private final String IDENTIFIER = "test";
|
||||
private final PageLoader LOADER = () -> new Response() {
|
||||
private final String IDENTIFIER = RandomData.randomString(10);
|
||||
private final String RESPONSE_STRING = RandomData.randomString(10);
|
||||
private final Response RESPONSE = new Response() {
|
||||
@Override
|
||||
public String getResponse() {
|
||||
return "Test";
|
||||
return RESPONSE_STRING;
|
||||
}
|
||||
};
|
||||
private final PageLoader LOADER = () -> RESPONSE;
|
||||
|
||||
@Test
|
||||
public void testCreateResponse() {
|
||||
String expResponse = RESPONSE.getResponse();
|
||||
String response = LOADER.createResponse().getResponse();
|
||||
|
||||
assertEquals(expResponse, response);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCache() {
|
||||
|
Loading…
Reference in New Issue
Block a user