Skip to content

Unit Tests fail when Schema Registry is configured and the registry is not running #2641

Description

@dmfrey

Describe the issue
GIVEN: trying to run SCSt-based unit tests
WHEN: the schema registry client has been configured
AND: the content type is an avro content type
THEN: unit tests fail due to not being able to connect to a schema registry

Unit tests in a CI pipeline will fail because of this.

To Reproduce
Steps to reproduce the behavior:

application.yml

spring:
    stream:
      bindings:
        orderplaced-in-0:
          content-type: application/*+avro
          destination: order-placed-topic
          group: ${spring.application.name}
      schema-registry-client:
        endpoint: http://localhost:8990
      schema:
        avro:
          schema-locations: classpath:avro/order-placed-event.avsc

Simple event listener

    @Bean
    Consumer<OrderPlaced> orderplaced() {

        return event -> {
            log.info( "New Order Placed Event Received [{}]", event );
        };

    }

My tests are based on Spring Cloud Contracts integration, but a simple test to trigger a message should suffice here.

Version of the framework
Spring Framework 6.0.x
Spring Boot 3.0.x
Spring Cloud: 2023.0.x

Expected behavior
Unit tests are not blocked by attempting to connect to a schema registry that is not running.

Additional context
Add any other context about the problem here.
@sobychacko and I discussed this and he's aware of the context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions