+ FTSRestResponse response;
+
+ request.setResponseSize(100);
+ request.setFieldToSearchBy("");
+ request.setWantedFields(wantedFields);
+ // check 404 behaviour
+ request.setSearchTerm("P00000.json");
+
+ try
+ {
+ response = TDBeaconsFTSRestClient.getInstance()
+ .executeRequest(request);
+
+ assertNull(response);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ Assert.fail("Unexpected failure during mock 3DBeacons 404 test");
+ }
+
+ // check 200 behaviour
+ request.setSearchTerm("P38398.json");
+ System.out.println("request : " + request.getFieldToSearchBy());
+ // System.out.println(request.toString());
+
+ try
+ {
+ response = TDBeaconsFTSRestClient.getInstance()
+ .executeRequest(request);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ Assert.fail("Couldn't execute webservice call!");
+ return;
+ }
+ assertTrue(response.getSearchSummary() != null);
+ assertTrue(response.getNumberOfItemsFound() > 3); // 4 atm
+ System.out.println("Search summary : \n" + response.getSearchSummary());
+
+ // System.out.println(response.getSearchSummary().size());
+ }
+
+ @Test(groups = { "External", "Network" })
+ public void executeRequestTest()
+ {
+ List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
+ try
+ {
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("Model Id"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("model_url"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("provider"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("model_category"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("confidence_avg_local_score"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("uniprot_start"));
+ wantedFields.add(TDBeaconsFTSRestClient.getInstance()
+ .getDataColumnByNameOrCode("uniprot_end"));
+ } catch (Exception e1)
+ {
+ e1.printStackTrace();
+ }
+ System.out.println("wantedFields >>" + wantedFields);
+
+ FTSRestRequest request = new FTSRestRequest();