// Path: step10_simple_app_with_cxf-spring-boot-starter/src/test/java/de/jonashackt/tutorial/SimpleBootCxfSystemTestApplication.java
// @Configuration
// @Import({
//         SimpleBootCxfSystemTestConfiguration.class,
//         SimpleBootCxfApplication.class
// })
// public class SimpleBootCxfSystemTestApplication {
// 
// }
// 
// Path: step10_simple_app_with_cxf-spring-boot-starter/src/main/java/de/jonashackt/tutorial/common/CustomIds.java
// public enum CustomIds {
// 
// 	EVERYTHING_FINE("01", "The Weather-Call was successfully processed by the backend."),
// 	NON_XML_COMPLIANT("71", "XML-Scheme-validiation failed."),
// 	COMPLETE_USELESS_XML("72", "Syntactically incorrect XML."),
// 	SOMETHING_ELSE_WENT_TERRIBLY_WRONG("99", "Backend processing failed.");
// 
// 	private String id;
// 	private String message;
// 
// 	private CustomIds(String id, String text) {
// 		this.id = id;
// 		this.message = text;
// 	}
// 	
// 	public String getMessage() {
// 		return message;
// 	}
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	
// }


import de.codecentric.cxf.common.BootStarterCxfException;
import de.codecentric.cxf.common.FaultType;
import de.codecentric.cxf.soaprawclient.SoapRawClient;
import de.codecentric.cxf.soaprawclient.SoapRawClientResponse;
import de.jonashackt.tutorial.SimpleBootCxfSystemTestApplication;
import de.jonashackt.tutorial.common.CustomIds;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.Resource;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
	private Resource xmlErrorSoapEnvelopeTagMissingBracketTestXml;
	
	@Value(value="classpath:requests/xmlerrors/xmlErrorXMLHeaderDefinitionMissingBracket.xml")
	private Resource xmlErrorXMLHeaderDefinitionMissingBracketXml;
	
	@Value(value="classpath:requests/xmlerrors/xmlErrorXMLTagNotClosedInsideBodyTest.xml")
	private Resource xmlErrorXMLTagNotClosedInsideBodyTestXml;
	
	
	
	/*
	 * Non-Scheme-compliant Errors
	 */
	
	@Test
	public void xmlErrorNotXmlSchemeCompliantUnderRootElementTest() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorNotXmlSchemeCompliantUnderRootElementTestXml);
	}
	
	@Test
	public void xmlErrorNotXmlSchemeCompliantRootElementTest() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorNotXmlSchemeCompliantRootElementTestXml);
	}
	
	@Test
	public void xmlErrorSoapHeaderMissingSlash() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorSoapHeaderMissingSlashXml);
	}
	
	private void checkXMLErrorNotSchemeCompliant(Resource testFile) throws BootStarterCxfException, IOException {
// Path: step10_simple_app_with_cxf-spring-boot-starter/src/test/java/de/jonashackt/tutorial/SimpleBootCxfSystemTestApplication.java
// @Configuration
// @Import({
//         SimpleBootCxfSystemTestConfiguration.class,
//         SimpleBootCxfApplication.class
// })
// public class SimpleBootCxfSystemTestApplication {
// 
// }
// 
// Path: step10_simple_app_with_cxf-spring-boot-starter/src/main/java/de/jonashackt/tutorial/common/CustomIds.java
// public enum CustomIds {
// 
// 	EVERYTHING_FINE("01", "The Weather-Call was successfully processed by the backend."),
// 	NON_XML_COMPLIANT("71", "XML-Scheme-validiation failed."),
// 	COMPLETE_USELESS_XML("72", "Syntactically incorrect XML."),
// 	SOMETHING_ELSE_WENT_TERRIBLY_WRONG("99", "Backend processing failed.");
// 
// 	private String id;
// 	private String message;
// 
// 	private CustomIds(String id, String text) {
// 		this.id = id;
// 		this.message = text;
// 	}
// 	
// 	public String getMessage() {
// 		return message;
// 	}
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	
// }


// Path: step10_simple_app_with_cxf-spring-boot-starter/src/test/java/de/jonashackt/tutorial/xmlvalidation/WeatherServiceXmlErrorSystemTest.java
import de.codecentric.cxf.common.BootStarterCxfException;
import de.codecentric.cxf.common.FaultType;
import de.codecentric.cxf.soaprawclient.SoapRawClient;
import de.codecentric.cxf.soaprawclient.SoapRawClientResponse;
import de.jonashackt.tutorial.SimpleBootCxfSystemTestApplication;
import de.jonashackt.tutorial.common.CustomIds;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.Resource;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

	private Resource xmlErrorSoapEnvelopeTagMissingBracketTestXml;
	
	@Value(value="classpath:requests/xmlerrors/xmlErrorXMLHeaderDefinitionMissingBracket.xml")
	private Resource xmlErrorXMLHeaderDefinitionMissingBracketXml;
	
	@Value(value="classpath:requests/xmlerrors/xmlErrorXMLTagNotClosedInsideBodyTest.xml")
	private Resource xmlErrorXMLTagNotClosedInsideBodyTestXml;
	
	
	
	/*
	 * Non-Scheme-compliant Errors
	 */
	
	@Test
	public void xmlErrorNotXmlSchemeCompliantUnderRootElementTest() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorNotXmlSchemeCompliantUnderRootElementTestXml);
	}
	
	@Test
	public void xmlErrorNotXmlSchemeCompliantRootElementTest() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorNotXmlSchemeCompliantRootElementTestXml);
	}
	
	@Test
	public void xmlErrorSoapHeaderMissingSlash() throws BootStarterCxfException, IOException {
		checkXMLErrorNotSchemeCompliant(xmlErrorSoapHeaderMissingSlashXml);
	}
	
	private void checkXMLErrorNotSchemeCompliant(Resource testFile) throws BootStarterCxfException, IOException {
		checkXMLError(testFile, CustomIds.NON_XML_COMPLIANT);