0

for a function like this, how to proceed with JUnit testing?

        try {
          HttpPost httppost = new HttpPost("http://tbird2:80/uws/archive/QueryDicom");
          httppost.addHeader("content-type", "application/xml");
    
          String quoteRequestPayLoad = DMUtils.getQueryDicomXmlPayload(studyInstanceUUID);
    
          StringEntity userEntity = new StringEntity(quoteRequestPayLoad);
          httppost.setEntity(userEntity);
    
          HttpResponse httpresponse = httpClient.execute(httppost);
    
          HttpEntity entity = httpresponse.getEntity();
          String responseString = EntityUtils.toString(entity, "UTF-8");
    
          List<String> SOPInstanceUUIDs = DMUtils.parseSopIdFromQuteResponse(responseString);
    
          SOPInstanceUUIDs.forEach(
              SOPInstanceUUID -> {
                try {
                  // remove " first and last char as this is coming from xml &quote
                  SOPInstanceUUID = SOPInstanceUUID.substring(1, SOPInstanceUUID.length() - 1);
                  dicomObjectList.add(fetchDicomObjectFromSOPInstanceUUID(SOPInstanceUUID));
                } catch (Exception e) {
                  e.printStackTrace();
                }
              });
    
          return dicomObjectList;}

how to work with Apache? i could not get the idea for a kickstart.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
Neha Pal
  • 3
  • 2

0 Answers0