/// <summary> /// Uses Jackson's object mapper directly /// </summary> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testProcessInstanceQuery() public virtual void testProcessInstanceQuery() { WebResource resource = client.resource(APP_BASE_PATH + PROCESS_INSTANCE_PATH); ClientResponse response = resource.queryParam("variables", "invoiceNumber_eq_GPFE-23232323").accept(MediaType.APPLICATION_JSON).get(typeof(ClientResponse)); JSONArray instancesJson = response.getEntity(typeof(JSONArray)); response.close(); assertEquals(200, response.Status); // invoice example instance assertEquals(2, instancesJson.length()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void assertJodaTimePresent() public virtual void assertJodaTimePresent() { log.info("Checking " + APP_BASE_PATH + TASK_PATH); WebResource resource = client.resource(APP_BASE_PATH + TASK_PATH); resource.queryParam("dueAfter", "2000-01-01T00-00-00"); ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(typeof(ClientResponse)); assertEquals(200, response.Status); JSONArray definitionsJson = response.getEntity(typeof(JSONArray)); assertEquals(6, definitionsJson.length()); response.close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testComplexObjectJacksonSerialization() throws org.codehaus.jettison.json.JSONException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testComplexObjectJacksonSerialization() { WebResource resource = client.resource(APP_BASE_PATH + PROCESS_DEFINITION_PATH + "/statistics"); ClientResponse response = resource.queryParam("incidents", "true").accept(MediaType.APPLICATION_JSON).get(typeof(ClientResponse)); JSONArray definitionStatistics = response.getEntity(typeof(JSONArray)); response.close(); assertEquals(200, response.Status); // invoice example instance assertEquals(2, definitionStatistics.length()); // check that definition is also serialized for (int i = 0; i < definitionStatistics.length(); i++) { JSONObject definitionStatistic = definitionStatistics.getJSONObject(i); assertEquals("org.camunda.bpm.engine.rest.dto.repository.ProcessDefinitionStatisticsResultDto", definitionStatistic.getString("@class")); assertEquals(0, definitionStatistic.getJSONArray("incidents").length()); JSONObject definition = definitionStatistic.getJSONObject("definition"); assertEquals("Invoice Receipt", definition.getString("name")); assertFalse(definition.getBoolean("suspended")); } }