DevfileSchemaProvider { public String getSchemaContent(String version) throws IOException { if (schemas.containsKey(version)) { String schema = schemas.get(version).get(); if (schema != null) { return schema; } else { return loadAndPut(version); } } else { return loadAndPut(version); } }  String getSchemaContent(String version); StringReader getAsReader(String version);  }
@Test public void shouldGetProperDevfileSchemaContent() throws IOException { String content = devfileSchemaProvider.getSchemaContent(CURRENT_API_VERSION); assertNotNull(content); assertTrue(content.contains("This schema describes the structure of the devfile object")); }
@Test(expectedExceptions = IOException.class) public void shouldThrowExceptionWhenInvalidVersionRequested() throws IOException { devfileSchemaProvider.getSchemaContent("this_is_clearly_not_a_valid_schema_version"); }