### Question:
SchemaGuesser { public static PropertyGuessResults requestProbabilitiesObject(Object[] objects) { String probabilitiesJsonString = requestProbabilitiesString(objects); PropertyGuessResults res = GsonSerializer.getGsonWithIds().fromJson(probabilitiesJsonString, PropertyGuessResults.class); return res; }  static GuessSchema guessSchma(EventSchema eventSchema, List<Map<String, Object>> nElements); static PropertyGuessResults requestProbabilitiesObject(Object[] objects); static String requestProbabilitiesString(Object[] objects); static DomainPropertyProbabilityList getDomainPropertyProbability(Object[] sampleData); static int port; }### Answer:
@Test public void requestProbabilitiesObjectTest() { String payload = "{\n" + " \"result\": [\n" + " {\n" + " \"class\": \"one\", \n" + " \"probability\": 1\n" + " }]}"; stubFor(post(urlEqualTo("/predict")) .willReturn(aResponse() .withStatus(200) .withBody(payload) )); SchemaGuesser schemaGuesser = new SchemaGuesser(); Double[] data = {1.1}; PropertyGuessResults result = schemaGuesser.requestProbabilitiesObject(data); assertNotNull(result.getResult()); assertEquals(1, result.getResult().length); assertEquals("one", result.getResult()[0].getClazz()); assertEquals(1, result.getResult()[0].getProbability(), 0.0); }