|
29 | 29 | import com.rabbitmq.stream.ConfirmationHandler;
|
30 | 30 | import com.rabbitmq.stream.Constants;
|
31 | 31 | import com.rabbitmq.stream.Consumer;
|
| 32 | +import com.rabbitmq.stream.ConsumerBuilder; |
32 | 33 | import com.rabbitmq.stream.Environment;
|
33 | 34 | import com.rabbitmq.stream.EnvironmentBuilder;
|
34 | 35 | import com.rabbitmq.stream.Host;
|
35 | 36 | import com.rabbitmq.stream.Message;
|
36 | 37 | import com.rabbitmq.stream.OffsetSpecification;
|
37 | 38 | import com.rabbitmq.stream.Producer;
|
| 39 | +import com.rabbitmq.stream.ProducerBuilder; |
| 40 | +import com.rabbitmq.stream.StreamCreator; |
38 | 41 | import com.rabbitmq.stream.StreamException;
|
39 | 42 | import com.rabbitmq.stream.impl.Client.StreamMetadata;
|
40 | 43 | import com.rabbitmq.stream.impl.MonitoringTestUtils.EnvironmentInfo;
|
@@ -456,18 +459,15 @@ void instanciationShouldSucceedWhenLazyInitIsEnabledAndHostIsNotKnown() {
|
456 | 459 | .lazyInitialization(true)
|
457 | 460 | .build()) {
|
458 | 461 |
|
459 |
| - assertThatThrownBy(() -> env.streamCreator().stream("should not have been created").create()) |
460 |
| - .isInstanceOf(StreamException.class); |
| 462 | + StreamCreator streamCreator = env.streamCreator().stream("should not have been created"); |
| 463 | + assertThatThrownBy(() -> streamCreator.create()).isInstanceOf(StreamException.class); |
461 | 464 | assertThatThrownBy(() -> env.deleteStream("should not exist"))
|
462 | 465 | .isInstanceOf(StreamException.class);
|
463 |
| - assertThatThrownBy(() -> env.producerBuilder().stream(stream).build()) |
464 |
| - .isInstanceOf(StreamException.class); |
465 |
| - assertThatThrownBy( |
466 |
| - () -> |
467 |
| - env.consumerBuilder().stream(stream) |
468 |
| - .messageHandler((context, message) -> {}) |
469 |
| - .build()) |
470 |
| - .isInstanceOf(StreamException.class); |
| 466 | + ProducerBuilder producerBuilder = env.producerBuilder().stream(this.stream); |
| 467 | + assertThatThrownBy(() -> producerBuilder.build()).isInstanceOf(StreamException.class); |
| 468 | + ConsumerBuilder consumerBuilder = |
| 469 | + env.consumerBuilder().stream(this.stream).messageHandler((context, message) -> {}); |
| 470 | + assertThatThrownBy(() -> consumerBuilder.build()).isInstanceOf(StreamException.class); |
471 | 471 | }
|
472 | 472 | }
|
473 | 473 |
|
|
0 commit comments