mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-29 12:37:40 +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.
|
* @return true if there is data in the cache.
|
||||||
*/
|
*/
|
||||||
public boolean isCached() {
|
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.data.cache.PageLoader;
|
||||||
import main.java.com.djrapitops.plan.ui.webserver.response.Response;
|
import main.java.com.djrapitops.plan.ui.webserver.response.Response;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import test.java.utils.RandomData;
|
||||||
|
|
||||||
import static junit.framework.TestCase.*;
|
import static junit.framework.TestCase.*;
|
||||||
|
|
||||||
@ -11,13 +12,23 @@ import static junit.framework.TestCase.*;
|
|||||||
* @author Fuzzlemann
|
* @author Fuzzlemann
|
||||||
*/
|
*/
|
||||||
public class PageCacheHandlerTest {
|
public class PageCacheHandlerTest {
|
||||||
private final String IDENTIFIER = "test";
|
private final String IDENTIFIER = RandomData.randomString(10);
|
||||||
private final PageLoader LOADER = () -> new Response() {
|
private final String RESPONSE_STRING = RandomData.randomString(10);
|
||||||
|
private final Response RESPONSE = new Response() {
|
||||||
@Override
|
@Override
|
||||||
public String getResponse() {
|
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
|
@Test
|
||||||
public void testCache() {
|
public void testCache() {
|
||||||
|
Loading…
Reference in New Issue
Block a user