import jalview.fts.api.FTSDataColumnI;
import jalview.fts.api.FTSDataColumnI.FTSDataColumnGroupI;
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
+import jalview.fts.service.threedbeacons.TDBeaconsFTSRestClient;
import jalview.fts.api.FTSRestClientI;
/**
private int defaultResponsePageSize = 100;
+ protected String mockQuery = null;
+
+ protected String mockResponse = null;
+
protected FTSRestClient()
{
"Couldn't find data column with name : " + nameOrCode);
}
+ public static void createMockFTSRestClient(FTSRestClient instance,String workingQuery,
+ String jsonResponse)
+ {
+ instance.setMock(workingQuery,jsonResponse);
+ }
+
@Override
public FTSDataColumnGroupI getDataColumnGroupById(String id)
throws Exception
return String.valueOf(code) + " " + message;
}
+ public static void unMock(FTSRestClient instance)
+ {
+ instance.mockQuery =null;
+ instance.mockResponse =null;
+ }
+
protected String getResourceFile(String fileName)
{
String result = "";
return defaultResponsePageSize;
}
+ protected void setMock(String workingQuery, String jsonResponse)
+ {
+ mockQuery=workingQuery;
+ mockResponse = jsonResponse;
+ }
+
+ protected boolean isMocked()
+ {
+ return mockQuery != null && mockResponse!=null;
+ }
+
@Override
public String[] getPreferencesColumnsFor(PreferenceSource source)
{