@Test public void testParseSchemaShouldNotReturnNullWhenSchemaCanBeParsed() throws SAXException { given(schemaFactoryBuilder.buildSchemaFactory()).willReturn(schemaFactory); given(schemaFactory.newSchema(url)).willReturn(schema); Schema result = underTest.parseSchema(); assertNotNull(result); }
public Schema parseSchema() { Schema result; try { URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation); SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory(); result = schemaFactory.newSchema(schemaFile); } catch (SAXException e) { throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e); } return result; }
StubConfigSchemaParser { public Schema parseSchema() { Schema result; try { URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation); SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory(); result = schemaFactory.newSchema(schemaFile); } catch (SAXException e) { throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e); } return result; } }
StubConfigSchemaParser { public Schema parseSchema() { Schema result; try { URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation); SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory(); result = schemaFactory.newSchema(schemaFile); } catch (SAXException e) { throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e); } return result; }  }
StubConfigSchemaParser { public Schema parseSchema() { Schema result; try { URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation); SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory(); result = schemaFactory.newSchema(schemaFile); } catch (SAXException e) { throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e); } return result; }  Schema parseSchema(); }
StubConfigSchemaParser { public Schema parseSchema() { Schema result; try { URL schemaFile = resourceLoader.loadResource(stubConfigSchemaLocation); SchemaFactory schemaFactory = schemaFactoryBuilder.buildSchemaFactory(); result = schemaFactory.newSchema(schemaFile); } catch (SAXException e) { throw new DescriptorValidationFailedException("Parsing of stub config XSD failed.", e); } return result; }  Schema parseSchema();  }