public void testDelete() throws Exception {

    try {

      FloatPrimitiveKey searchObject = new FloatPrimitiveKey();
      Collection results =
          getApplicationService()
              .search(
                  "gov.nih.nci.cacoresdk.domain.other.primarykey.FloatPrimitiveKey", searchObject);
      String id = "";

      if (results != null && results.size() > 0) {
        FloatPrimitiveKey obj = (FloatPrimitiveKey) ((List) results).get(0);

        float idVal = obj.getId();

        id = new Float(idVal).toString();

      } else return;

      if (id.equals("")) return;

      String url = baseURL + "/rest/FloatPrimitiveKey/" + id;
      WebClient client = WebClient.create(url);

      Response response = client.delete();

      if (response.getStatus() == Status.NOT_ACCEPTABLE.getStatusCode()) {
        InputStream is = (InputStream) response.getEntity();
        org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder(false);
        org.jdom.Document jDoc = builder.build(is);
        assertEquals(jDoc.getRootElement().getName(), "response");
      } else if (response.getStatus() == Status.NOT_FOUND.getStatusCode()) {
        InputStream is = (InputStream) response.getEntity();
        org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder(false);
        org.jdom.Document jDoc = builder.build(is);
        assertEquals(jDoc.getRootElement().getName(), "response");
      } else if (response.getStatus() != 200) {
        throw new RuntimeException("Failed : HTTP error code : " + response.getStatus());
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw e;
    }
  }
  /**
   * Uses Nested Search Criteria for search Verifies that the results are returned Verifies size of
   * the result set Verifies that none of the attributes are null
   *
   * @throws Exception
   */
  public void testGet() throws Exception {

    try {

      FloatPrimitiveKey searchObject = new FloatPrimitiveKey();
      Collection results =
          getApplicationService()
              .search(
                  "gov.nih.nci.cacoresdk.domain.other.primarykey.FloatPrimitiveKey", searchObject);
      String id = "";

      if (results != null && results.size() > 0) {
        FloatPrimitiveKey obj = (FloatPrimitiveKey) ((List) results).get(0);

        float idVal = obj.getId();

        id = new Float(idVal).toString();

      } else return;

      if (id.equals("")) return;

      String url = baseURL + "/rest/FloatPrimitiveKey/" + id;

      WebClient client = WebClient.create(url);
      client.type("application/xml").accept("application/xml");
      Response response = client.get();

      if (response.getStatus() == Status.NOT_ACCEPTABLE.getStatusCode()) {
        InputStream is = (InputStream) response.getEntity();
        org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder(false);
        org.jdom.Document jDoc = builder.build(is);
        assertEquals(jDoc.getRootElement().getName(), "response");
      } else if (response.getStatus() == Status.NOT_FOUND.getStatusCode()) {
        InputStream is = (InputStream) response.getEntity();
        org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder(false);
        org.jdom.Document jDoc = builder.build(is);
        assertEquals(jDoc.getRootElement().getName(), "response");
      } else if (response.getStatus() != 200) {
        throw new RuntimeException("Failed : HTTP error code : " + response.getStatus());
      }

      File myFile = new File("FloatPrimitiveKey" + "XML.xml");

      System.out.println("writing data to file " + myFile.getAbsolutePath());
      FileWriter myWriter = new FileWriter(myFile);

      BufferedReader br =
          new BufferedReader(new InputStreamReader(((InputStream) response.getEntity())));

      String output;
      System.out.println("Output from Server .... \n");
      while ((output = br.readLine()) != null) {
        myWriter.write(output);
        System.out.println(output);
      }

      myWriter.flush();
      myWriter.close();
    } catch (Exception e) {
      e.printStackTrace();
      throw e;
    }
  }