title: Spring boot embedded Kafka integration throws NoClassDefFoundError
body: <p>Spring Boot: 2.0.3.RELEASE</p>
  
  <p>org.apache.kafka.kafka-streams: 1.0.0</p>
  
  <p>org.apache.kafka.kafka-clients: 1.0.0</p>
  
  <p>org.springframwork.kafka:spring-kafka-test:2.1.7.RELEASE</p>
  
  <p>I have a working Spring boot application with Kafka. I am trying to follow <a href="https://blog.mimacom.com/testing-apache-kafka-with-spring-boot/" rel="nofollow noreferrer">https://blog.mimacom.com/testing-apache-kafka-with-spring-boot/</a> to create an integration test. </p>
  
  <p>When I add the @EmbeddedKafka annotation I get the error when I run </p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kafkaEmbedded': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/kafka/common/record/RecordFormat
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-5.0.8.RELEASE.jar:5.0.8.RELEASE]
  </code></pre>
  
  <p>There are a few google results on this error however they are all on old kafka-client versions and they should be fixed in the version I use. </p>
  
  <p>This looks like a version mismatch but it is not clear to me what I am supposed to me. </p>