### Question:
SchemaResolver { static String getUnresolvedSchemaName(final Schema schema) { if (!isUnresolvedSchema(schema)) { throw new IllegalArgumentException("Not a unresolved schema: " + schema); } return schema.getProp(UR_SCHEMA_ATTR); } private  SchemaResolver();   }### Answer:
@Test(expected = IllegalArgumentException.class) public void testIsUnresolvedSchemaError1() { Schema s = SchemaBuilder.record("R").fields().endRecord(); SchemaResolver.getUnresolvedSchemaName(s); }
@Test(expected = IllegalArgumentException.class) public void testIsUnresolvedSchemaError2() { Schema s = SchemaBuilder.record("R").prop("org.apache.avro.compiler.idl.unresolved.name", "x").fields().endRecord(); SchemaResolver.getUnresolvedSchemaName(s); }
@Test(expected = IllegalArgumentException.class) public void testIsUnresolvedSchemaError3() { Schema s = SchemaBuilder.record("UnresolvedSchema").prop("org.apache.avro.compiler.idl.unresolved.name", "x") .fields().endRecord(); SchemaResolver.getUnresolvedSchemaName(s); }
@Test(expected = IllegalArgumentException.class) public void testGetUnresolvedSchemaNameError() { Schema s = SchemaBuilder.fixed("a").size(10); SchemaResolver.getUnresolvedSchemaName(s); }