APISonar


com.dotcms.repackage.javax.ws.rs.client.Entity.json

> com > dotcms > repackage > javax > ws > rs > client > Entity > json
com APIs dotcms APIs repackage APIs javax APIs ws APIs rs APIs client APIs Entity APIs json APIs

Example 1
public void saveActionMissingMandatoryAttribute() throws JSONException{
    	//Setup
    	JSONObject actionJSON = new JSONObject();
    	actionJSON.put("name", "Test Action Rest");
    	actionJSON.put("actionlet", "something");

    	//create
    	Response response = target.path(actionletEndpointUrl)
				.request(MediaType.APPLICATION_JSON_TYPE)
    			.post(Entity.json(actionJSON.toString()));

    	assertTrue(response.getStatus() == HttpStatus.SC_BAD_REQUEST);
    }