/**
 * @fileOverview Test initialization of the KafkaAvro lib, SR related.
 */
var chai = require('chai');
var expect = chai.expect;

var KafkaAvro = require('../..');

var srUrl = 'http://schema-registry-confluent.internal.dev.waldo.photos';

describe('Initialization of RS', function() {
  it('should initialize properly', function() {
    var kafkaAvro = new KafkaAvro({
      schemaRegistry: srUrl,
    });

    return kafkaAvro.init()
      .map((res) => {
        expect(res).to.have.keys([
          'schemaType',
          'topic',
          'schemaRaw',
          'schemaTopicRaw',
          'type',
        ]);
      })
      .then((all) => {
        expect(all).to.have.length.of.at.least(1);
      });
  });
});

@@ -162,16 +162,19 @@
 /..');%0A%0A
+// 
 var srUr
@@ -238,16 +238,53 @@
 photos';
+%0Avar srUrl = 'http://localhost:8081';
 %0A%0Adescri
@@ -309,10 +309,10 @@
  of 
-R
 S
+R
 ', f
@@ -530,16 +530,41 @@
 .keys(%5B%0A
+          'responseRaw',%0A
         
@@ -683,106 +683,1012 @@
 %5D);%0A
-      %7D)%0A      .then((all) =%3E %7B%0A        expect(all).to.have.length.of.at.least(1);%0A      %7D);%0A  %7D);
+%0A        expect(res.responseRaw).to.have.keys(%5B%0A          'subject',%0A          'version',%0A          'id',%0A          'schema',%0A        %5D);%0A      %7D)%0A      .then((all) =%3E %7B%0A        expect(all).to.have.length.of.at.least(1);%0A      %7D);%0A  %7D);%0A  it('kafkaAvro instance should contain expected values after init', function() %7B%0A    var kafkaAvro = new KafkaAvro(%7B%0A      schemaRegistry: srUrl,%0A    %7D);%0A%0A    return kafkaAvro.init()%0A      .map((res) =%3E %7B%0A        if (res.schemaType.toLowerCase() === 'value') %7B%0A          expect(kafkaAvro.valueSchemas%5Bres.topic%5D).to.be.an('object');%0A          expect(kafkaAvro.schemaMeta%5Bres.topic%5D).to.be.an('object');%0A%0A          expect(kafkaAvro.schemaMeta%5Bres.topic%5D).to.have.keys(%5B%0A            'subject',%0A            'version',%0A            'id',%0A            'schema',%0A          %5D);%0A%0A        %7D else %7B%0A          expect(kafkaAvro.keySchemas%5Bres.topic%5D).to.be.an('object');%0A        %7D%0A      %7D)%0A      .then((all) =%3E %7B%0A        expect(all).to.have.length.of.at.least(1);%0A      %7D);%0A  %7D);%0A
 %0A%7D);

tweak SR tests and add one more for ids