### Question:
AnalyziedResult { public TsdbHttpStatus getHttpStatus() { return httpStatus; } AnalyziedResult(Builder builder); TsdbHttpStatus getHttpStatus(); int getStatusCode(); String getContent(); HttpResponse getHttpResponse(); @Override String toString();  }### Answer:
@Test public void testHttpStatus() throws InterruptedException, ExecutionException, ParseException, IllegalArgumentException, IOException, ErrorValueTypeException { HttpGet request = new HttpGet("http: try { response = httpAsyncClient.execute(request, null); analyziedResult = new AnalyziedResult.Builder().httpResponse(response).statusCode() .httpStatus().content().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_COMPLETED_SUCCESS); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } Long ts = System.currentTimeMillis(); HashMap<String, String> tags = new HashMap<>(); tags.put("tagk1", "tagv1"); tags.put("tagk2", "tagv2"); DataPoint dataPoint = new DataPoint.Builder().setMetric("metric").setTimestamp(ts) .setTags(tags).setValue(12333).build(); String requestJson = JSON.toJSONString(dataPoint, SerializerFeature.DisableCircularReferenceDetect); HttpEntityEnclosingRequestBase requestTmp = null; requestTmp = new HttpPost("http: requestTmp.addHeader("Content-Type", "application/json"); requestTmp.setEntity(new StringEntity(requestJson)); response = httpAsyncClient.execute(requestTmp, null); analyziedResult = new AnalyziedResult.Builder().httpResponse(response).statusCode() .httpStatus().content().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_COMPLETED_SUCCESS); requestTmp = new HttpPost("http: response = httpAsyncClient.execute(requestTmp, null); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_COMPLETED_SUCCESS); }
@Test public void testHttpStatusAbnormal() { TsdbHttpStatus status = null; analyziedResult = new AnalyziedResult.Builder().statusCode(202).httpStatus().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_SUCCESS_ACCEPT_UNDONE); analyziedResult = new AnalyziedResult.Builder().statusCode(204).httpStatus().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_SUCCESS_NOCONTENT); analyziedResult = new AnalyziedResult.Builder().statusCode(205).httpStatus().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_SUCCESS_RESET_CONTENT); analyziedResult = new AnalyziedResult.Builder().statusCode(206).httpStatus().build(); assertTrue( analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_SUCCESS_PARTIAL_CONTENT); analyziedResult = new AnalyziedResult.Builder().statusCode(301).httpStatus().build(); assertTrue( analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_MORE_PROCESS_TO_SUCCESS); analyziedResult = new AnalyziedResult.Builder().statusCode(401).httpStatus().build(); assertTrue(analyziedResult .getHttpStatus() == TsdbHttpStatus.REQUEST_ERROR_USERDEFINED_CLIENTERROR); analyziedResult = new AnalyziedResult.Builder().statusCode(501).httpStatus().build(); assertTrue(analyziedResult .getHttpStatus() == TsdbHttpStatus.REQUEST_ERROR_USERDEFINED_SERVERERROR); analyziedResult = new AnalyziedResult.Builder().statusCode(601).httpStatus().build(); assertTrue(analyziedResult.getHttpStatus() == TsdbHttpStatus.REQUEST_OTHER_ERROR); }