// Path: src/main/java/com/github/jasminb/jsonapi/exceptions/InvalidJsonApiResourceException.java
// public class InvalidJsonApiResourceException extends RuntimeException {
// 
//     /**
//      * Creates a new InvalidJsonApiResourceException.
//      */
//     public InvalidJsonApiResourceException() {
//         super("Resource must contain at least one of 'data', 'error' or 'meta' nodes.");
//     }
// 
//     /**
//      * Creates a new InvalidJsonApiResourceException.
//      *
//      * @param errorMessage detail message containing spec for resource that was invalid.
//      */
//     public InvalidJsonApiResourceException(String errorMessage) {
//         super(errorMessage);
//     }
// }
// 
// Path: src/main/java/com/github/jasminb/jsonapi/exceptions/ResourceParseException.java
// public class ResourceParseException extends RuntimeException {
// 	private final Errors errors;
// 
// 	public ResourceParseException(Errors errors) {
// 		super(errors.toString());
// 		this.errors = errors;
// 	}
// 
// 	/**
// 	 * Returns Errors or <code>null</code>
// 	 * @return {@link Errors}
// 	 */
// 	public Errors getErrors() {
// 		return errors;
// 	}
// }


import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.NullNode;
import com.github.jasminb.jsonapi.exceptions.InvalidJsonApiResourceException;
import com.github.jasminb.jsonapi.exceptions.ResourceParseException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.io.IOException;
package com.github.jasminb.jsonapi;



/**
 * Covering cases for validation utility class.
 *
 * @author jbegic
 */
public class ValidationUtilsTest {
	private ObjectMapper mapper;

	@Rule
	public ExpectedException thrown = ExpectedException.none();

	@Before
	public void setup() {
		mapper = new ObjectMapper();
	}

	//ensureValidDocument

	@Test(expected = InvalidJsonApiResourceException.class)
	public void testExpectData() throws IOException {
		JsonNode node = mapper.readTree("{}");
		ValidationUtils.ensureValidDocument(mapper, node);
	}

// Path: src/main/java/com/github/jasminb/jsonapi/exceptions/InvalidJsonApiResourceException.java
// public class InvalidJsonApiResourceException extends RuntimeException {
// 
//     /**
//      * Creates a new InvalidJsonApiResourceException.
//      */
//     public InvalidJsonApiResourceException() {
//         super("Resource must contain at least one of 'data', 'error' or 'meta' nodes.");
//     }
// 
//     /**
//      * Creates a new InvalidJsonApiResourceException.
//      *
//      * @param errorMessage detail message containing spec for resource that was invalid.
//      */
//     public InvalidJsonApiResourceException(String errorMessage) {
//         super(errorMessage);
//     }
// }
// 
// Path: src/main/java/com/github/jasminb/jsonapi/exceptions/ResourceParseException.java
// public class ResourceParseException extends RuntimeException {
// 	private final Errors errors;
// 
// 	public ResourceParseException(Errors errors) {
// 		super(errors.toString());
// 		this.errors = errors;
// 	}
// 
// 	/**
// 	 * Returns Errors or <code>null</code>
// 	 * @return {@link Errors}
// 	 */
// 	public Errors getErrors() {
// 		return errors;
// 	}
// }


// Path: src/test/java/com/github/jasminb/jsonapi/ValidationUtilsTest.java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.NullNode;
import com.github.jasminb.jsonapi.exceptions.InvalidJsonApiResourceException;
import com.github.jasminb.jsonapi.exceptions.ResourceParseException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.io.IOException;

package com.github.jasminb.jsonapi;



/**
 * Covering cases for validation utility class.
 *
 * @author jbegic
 */
public class ValidationUtilsTest {
	private ObjectMapper mapper;

	@Rule
	public ExpectedException thrown = ExpectedException.none();

	@Before
	public void setup() {
		mapper = new ObjectMapper();
	}

	//ensureValidDocument

	@Test(expected = InvalidJsonApiResourceException.class)
	public void testExpectData() throws IOException {
		JsonNode node = mapper.readTree("{}");
		ValidationUtils.ensureValidDocument(mapper, node);
	}

	@Test(expected = ResourceParseException.class)