@Override
  public Schema getSchema(SchemaPath schemaPath) throws IOException {
    GetSchemaRequest request = GetSchemaRequest.newBuilder().setName(schemaPath.getPath()).build();
    return fromPubsubSchema(schemaServiceStub().getSchema(request));
  }
@Test
  public void getAvroSchema() throws IOException {
    String schemaDefinition =
        "{"
            + " \"type\" : \"record\","
            + " \"name\" : \"Avro\","
            + " \"fields\" : ["
            + "   {"
            + "     \"name\" : \"StringField\","
            + "     \"type\" : \"string\""
            + "   },"
            + "   {"
            + "     \"name\" : \"FloatField\","
            + "     \"type\" : \"float\""
            + "   },"
            + "   {"
            + "     \"name\" : \"BooleanField\","
            + "     \"type\" : \"boolean\""
            + "   }"
            + " ]"
            + "}";
    initializeClient(null, null);
    final Schema schema =
        com.google.pubsub.v1.Schema.newBuilder()
            .setName(SCHEMA.getPath())
            .setType(Schema.Type.AVRO)
            .setDefinition(schemaDefinition)
            .build();
    SchemaServiceImplBase schemaImplBase =
        new SchemaServiceImplBase() {
          @Override
          public void getSchema(GetSchemaRequest request, StreamObserver<Schema> responseObserver) {
            if (request.getName().equals(SCHEMA.getPath())) {
              responseObserver.onNext(schema);
              responseObserver.onCompleted();
            }
          }
        };
    Server server =
        InProcessServerBuilder.forName(channelName).addService(schemaImplBase).build().start();
    try {
      assertEquals(
          org.apache.beam.sdk.schemas.Schema.of(
              Field.of("StringField", FieldType.STRING),
              Field.of("FloatField", FieldType.FLOAT),
              Field.of("BooleanField", FieldType.BOOLEAN)),
          client.getSchema(SCHEMA));
    } finally {
      server.shutdownNow();
    }
  }