Java Code Examples for reactor.test.StepVerifier

The following examples show how to use reactor.test.StepVerifier. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: reactor-core   Source File: MonoDelayElementTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void cancelBeforeNext() {
	VirtualTimeScheduler vts = VirtualTimeScheduler.create();
	AtomicBoolean emitted = new AtomicBoolean();
	AtomicBoolean cancelled = new AtomicBoolean();

	Mono<Long> source = Mono.delay(Duration.ofMillis(1000), vts);

	StepVerifier.withVirtualTime(
			() -> new MonoDelayElement<>(source, 2, TimeUnit.SECONDS, vts)
					.doOnCancel(() -> cancelled.set(true))
					.doOnNext(n -> emitted.set(true)),
			() -> vts, Long.MAX_VALUE)
	            .expectSubscription()
	            .expectNoEvent(Duration.ofMillis(500))
	            .thenCancel()
	            .verify();

	vts.advanceTimeBy(Duration.ofHours(1));
	assertThat(emitted.get()).isFalse();
	assertThat(cancelled.get()).isTrue();
}
 
Example 2
@Test
void should_not_convert_unknown_endpoint() {
	InstanceExchangeFilterFunction filter = InstanceExchangeFilterFunctions.convertLegacyEndpoints(
			singletonList(new LegacyEndpointConverter("test", (from) -> Flux.just(this.converted)) {
			}));

	ClientRequest request = ClientRequest.create(HttpMethod.GET, URI.create("/test")).build();
	ClientResponse response = ClientResponse.create(HttpStatus.OK).header(CONTENT_TYPE, APPLICATION_JSON_VALUE)
			.header(CONTENT_LENGTH, Integer.toString(this.original.readableByteCount()))
			.body(Flux.just(this.original)).build();

	Mono<ClientResponse> convertedResponse = filter.filter(INSTANCE, request, (r) -> Mono.just(response));

	StepVerifier.create(convertedResponse).assertNext((r) -> {
		assertThat(r.headers().contentType()).hasValue(MediaType.APPLICATION_JSON);
		assertThat(r.headers().contentLength()).hasValue(this.original.readableByteCount());
		StepVerifier.create(r.body(BodyExtractors.toDataBuffers())).expectNext(this.original).verifyComplete();
	}).verifyComplete();
}
 
Example 3
Source Project: reactor-core   Source File: FluxExpandTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test(timeout = 5000)
public void breadthFirst() {
	Node root = createTest();

	StepVerifier.create(Flux.just(root)
	                        .expand(v -> Flux.fromIterable(v.children))
	                        .map(v -> v.name))
	            .expectNext(
			            "root",
			            "1", "2", "3", "4",
			            "11", "21", "22", "31", "32", "33", "41", "42", "43", "44",
			            "221", "321", "331", "332", "421", "431", "432", "441", "442", "443",
			            "3321", "4321", "4421", "4431", "4432"
	            )
	            .verifyComplete();
}
 
Example 4
Source Project: reactor-core   Source File: FluxDoFinallyTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void asyncFusedThreadBarrierConditional() {
	FluxIdentityProcessor<Object> up = Processors.unicast();
	up.onNext(1);
	up.onNext(2);
	up.onNext(3);
	up.onNext(4);
	up.onNext(5);
	up.onComplete();

	StepVerifier.create(up.doFinally(this)
	                      .filter(i -> true))
	            .expectFusion(ASYNC | THREAD_BARRIER, NONE)
	            .expectNext(1, 2, 3, 4, 5)
	            .expectComplete()
	            .verify();

	assertEquals(1, calls);
	assertEquals(SignalType.ON_COMPLETE, signalType);
}
 
Example 5
@Test
public void bodyToMonoVoid() {

	this.server.enqueue(new MockResponse()
			.setResponseCode(201)
			.setHeader("Content-Type", "application/json")
			.setChunkedBody("{\"foo\" : {\"bar\" : \"123\", \"baz\" : \"456\"}}", 5));

	Mono<Void> mono = this.webClient.get()
			.uri("/json").accept(MediaType.APPLICATION_JSON)
			.retrieve()
			.bodyToMono(Void.class);

	StepVerifier.create(mono).expectComplete().verify(Duration.ofSeconds(3));
	assertEquals(1, this.server.getRequestCount());
}
 
Example 6
@Test
void restageApplications() {
	given(appDeployer.getServiceInstance(any(GetServiceInstanceRequest.class)))
		.willReturn(Mono.just(GetServiceInstanceResponse.builder()
			.name("foo-service")
			.plan("plan1")
			.service("service1")
			.build()));

	given(targetService.addToBackingApplications(eq(backingApps), any(), eq("foo-service-id")))
		.willReturn(Mono.just(backingApps));

	doReturn(Mono.empty()).when(managementClient).restage(backingApps.get(0));
	doReturn(Mono.empty()).when(managementClient).restage(backingApps.get(1));

	StepVerifier.create(backingAppManagementService.restage("foo-service-id"))
		.expectNext()
		.expectNext()
		.verifyComplete();

	verify(appDeployer).getServiceInstance(any(GetServiceInstanceRequest.class));
	verify(targetService).addToBackingApplications(eq(backingApps), any(), eq("foo-service-id"));
	verify(managementClient, times(2)).restage(any(BackingApplication.class));
	verifyNoMoreInteractions(appDeployer, targetService, managementClient);
}
 
Example 7
Source Project: reactor-core   Source File: ContextTests.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void contextGet() throws InterruptedException {

	StepVerifier.create(Flux.range(1, 1000)
	                        .log()
	                        .handle((d, c) -> c.next(c.currentContext().get("test") + "" + d))
	                        .skip(3)
	                        .take(3)
	                        .handle((d, c) -> c.next(c.currentContext().get("test2") + "" + d))
	                        .subscriberContext(ctx -> ctx.put("test", "foo"))
	                        .subscriberContext(ctx -> ctx.put("test2", "bar"))
	                        .log())
	            .expectNext("barfoo4")
	            .expectNext("barfoo5")
	            .expectNext("barfoo6")
	            .verifyComplete();
}
 
Example 8
Source Project: java-technology-stack   Source File: WebClientIntegrationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void shouldReceiveResponseHeaders() {
	prepareResponse(response -> response
			.setHeader("Content-Type", "text/plain")
			.setBody("Hello Spring!"));

	Mono<HttpHeaders> result = this.webClient.get()
			.uri("/greeting?name=Spring")
			.exchange()
			.map(response -> response.headers().asHttpHeaders());

	StepVerifier.create(result)
			.consumeNextWith(
					httpHeaders -> {
						assertEquals(MediaType.TEXT_PLAIN, httpHeaders.getContentType());
						assertEquals(13L, httpHeaders.getContentLength());
					})
			.expectComplete().verify(Duration.ofSeconds(3));

	expectRequestCount(1);
	expectRequest(request -> {
		assertEquals("*/*", request.getHeader(HttpHeaders.ACCEPT));
		assertEquals("/greeting?name=Spring", request.getPath());
	});
}
 
Example 9
Source Project: cloud-spanner-r2dbc   Source File: SpannerResultTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void mapTest() {

  String columnName = this.resultSetMetadata
      .getRowType()
      .getFields(0)
      .getName();

  Flux<String> result =
      new SpannerResult(this.resultSet, Mono.just(0))
          .map((row, metadata) ->
              row.get(0, String.class)
                  + "-"
                  + metadata.getColumnMetadata(0).getName());

  StepVerifier.create(result)
      .expectNext("key1-" + columnName, "key2-" + columnName)
      .verifyComplete();
}
 
Example 10
Source Project: r2dbc-spi   Source File: TestKit.java    License: Apache License 2.0 6 votes vote down vote up
@Test
default void bindFails() {
    Mono.from(getConnectionFactory().create())
        .flatMap(connection -> {

            Statement statement = connection.createStatement(String.format("INSERT INTO test VALUES(%s)", getPlaceholder(0)));
            assertThrows(IllegalArgumentException.class, () -> statement.bind(0, null), "bind(0, null) should fail");
            assertThrows(IndexOutOfBoundsException.class, () -> statement.bind(99, ""), "bind(nonexistent-index, null) should fail");
            assertThrows(IllegalArgumentException.class, () -> bind(statement, getIdentifier(0), null), "bind(identifier, null) should fail");
            assertThrows(IllegalArgumentException.class, () -> bind(statement, getIdentifier(0), Class.class), "bind(identifier, Class.class) should fail");
            assertThrows(IllegalArgumentException.class, () -> statement.bind("unknown", ""), "bind(unknown-placeholder, \"\") should fail");
            return close(connection);
        })
        .as(StepVerifier::create)
        .verifyComplete();
}
 
Example 11
Source Project: reactor-core   Source File: MonoUsingTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void smokeTestMapReduceGuardedByCleanup_fusedNotEager() {
	AtomicBoolean cleaned = new AtomicBoolean();
	Mono.using(() -> cleaned,
			ab -> Flux.just("foo", "bar", "baz")
			          .delayElements(Duration.ofMillis(100))
			          .count()
			          .map(i -> "" + i + ab.get()),
			ab -> ab.set(true),
			false)
	    .as(StepVerifier::create)
	    .expectFusion()
	    .expectNext("3false")
	    .expectComplete()
	    .verify();

	//since the handler is executed after onComplete, we allow some delay
	await().atMost(100, TimeUnit.MILLISECONDS)
	       .with().pollInterval(10, TimeUnit.MILLISECONDS)
	       .untilAsserted(assertThat(cleaned)::isTrue);
}
 
Example 12
Source Project: feign-reactive   Source File: SmokeTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testMakeOrder_success() throws JsonProcessingException {

  IceCreamOrder order = new OrderGenerator().generate(20);
  Bill billExpected = Bill.makeBill(order);

  wireMockRule.stubFor(post(urlEqualTo("/icecream/orders"))
      .withRequestBody(equalTo(TestUtils.MAPPER.writeValueAsString(order)))
      .willReturn(aResponse().withStatus(200)
          .withHeader("Content-Type", "application/json")
          .withBody(TestUtils.MAPPER.writeValueAsString(billExpected))));

  Mono<Bill> bill = client.makeOrder(order);
  StepVerifier.create(bill)
      .expectNextMatches(equalsComparingFieldByFieldRecursively(billExpected))
      .verifyComplete();
}
 
Example 13
Source Project: reactor-core   Source File: ParallelSchedulerTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void smokeTestInterval() {
	Scheduler s = scheduler();

	try {
		StepVerifier.create(Flux.interval(Duration.ofMillis(100), Duration.ofMillis(200), s))
		            .expectSubscription()
		            .expectNoEvent(Duration.ofMillis(100))
		            .expectNext(0L)
		            .expectNoEvent(Duration.ofMillis(200))
		            .expectNext(1L)
		            .expectNoEvent(Duration.ofMillis(200))
		            .expectNext(2L)
		            .thenCancel();
	}
	finally {
		s.dispose();
	}
}
 
Example 14
@Before
public void setupServer() throws Exception {
    StepVerifier.setDefaultTimeout(Duration.ofSeconds(3));

    server = ServerBuilder
            .forPort(0)
            .addService(service)
            .executor(Executors.newSingleThreadExecutor(
                    new ThreadFactoryBuilder().setNameFormat("TheGrpcServer").build()))
            .build()
            .start();
    channel = ManagedChannelBuilder
            .forAddress("localhost", server.getPort())
            .usePlaintext()
            .executor(Executors.newSingleThreadExecutor(
                    new ThreadFactoryBuilder().setNameFormat("TheGrpcClient").build()))
            .build();
}
 
Example 15
Source Project: spring-cloud-gcp   Source File: FirestoreTemplateTests.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void existsByIdTest() {
	GetDocumentRequest request = GetDocumentRequest.newBuilder()
			.setName(this.parent + "/testEntities/" + "e1")
			.setMask(DocumentMask.newBuilder().addFieldPaths("__name__").build())
			.build();

	doAnswer(invocation -> {
		StreamObserver<com.google.firestore.v1.Document> streamObserver = invocation.getArgument(1);
		streamObserver.onNext(buildDocument("e1", 100L));

		streamObserver.onCompleted();
		return null;
	}).when(this.firestoreStub).getDocument(eq(request), any());

	StepVerifier.create(this.firestoreTemplate.existsById(Mono.just("e1"), TestEntity.class))
			.expectNext(Boolean.TRUE).verifyComplete();

	verify(this.firestoreStub, times(1)).getDocument(eq(request), any());
	verify(this.firestoreStub, times(1)).getDocument(any(), any());
}
 
Example 16
Source Project: reactor-core   Source File: FluxExpandTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test(timeout = 5000)
public void depthFirst() {
	Node root = createTest();

	StepVerifier.create(Flux.just(root)
	                        .expandDeep(v -> Flux.fromIterable(v.children))
	                        .map(v -> v.name))
	            .expectNext(
			            "root",
			            "1", "11",
			            "2", "21", "22", "221",
			            "3", "31", "32", "321", "33", "331", "332", "3321",
			            "4", "41", "42", "421", "43", "431", "432", "4321",
			            "44", "441", "442", "4421", "443", "4431", "4432"
	            )
	            .verifyComplete();
}
 
Example 17
@Test
void startTimeEquals() {
    Mono<TopicMessage> topicMessage = domainBuilder.topicMessage(t -> t.consensusTimestamp(future));
    TopicMessageFilter filter = TopicMessageFilter.builder()
            .startTime(future)
            .build();

    getTopicListener().listen(filter)
            .map(TopicMessage::getSequenceNumber)
            .as(StepVerifier::create)
            .thenAwait(Duration.ofMillis(50))
            .then(() -> topicMessage.block())
            .expectNext(1L)
            .thenCancel()
            .verify(Duration.ofMillis(500));
}
 
Example 18
@Test
public void emitFieldNameOnly() throws Exception {
    final HttpResponse response = doConvert(
            Flux.just(ServerSentEvent.ofComment(""),// Won't be emitted. An empty HttpData would be sent.
                      ServerSentEvent.ofId(""),
                      ServerSentEvent.ofEvent(""),
                      ServerSentEvent.ofData("")));
    StepVerifier.create(response)
                .expectNext(EVENT_STREAM_HEADER)
                .expectNext(HttpData.empty())
                .expectNext(HttpData.ofUtf8("id\n\n"))
                .expectNext(HttpData.ofUtf8("event\n\n"))
                .expectNext(HttpData.ofUtf8("data\n\n"))
                .expectComplete()
                .verify();
}
 
Example 19
Source Project: reactor-core   Source File: FluxBufferPredicateTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
@SuppressWarnings("unchecked")
public void predicateErrorUntil() {
	FluxIdentityProcessor<Integer> sp1 = Processors.more().multicastNoBackpressure();
	FluxBufferPredicate<Integer, List<Integer>> bufferUntil = new FluxBufferPredicate<>(
			sp1,
			i -> {
				if (i == 5) throw new IllegalStateException("predicate failure");
				return i % 3 == 0;
			}, Flux.listSupplier(), FluxBufferPredicate.Mode.UNTIL);

	StepVerifier.create(bufferUntil)
				.expectSubscription()
				.then(() -> sp1.onNext(1))
				.then(() -> sp1.onNext(2))
				.then(() -> sp1.onNext(3))
				.expectNext(Arrays.asList(1, 2, 3))
				.then(() -> sp1.onNext(4))
				.then(() -> sp1.onNext(5))
				.expectErrorMessage("predicate failure")
				.verify();
	assertFalse(sp1.hasDownstreams());
}
 
Example 20
Source Project: java-technology-stack   Source File: WebClientIntegrationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void shouldReceiveNotFoundEntity() {
	prepareResponse(response -> response.setResponseCode(404)
			.setHeader("Content-Type", "text/plain").setBody("Not Found"));

	Mono<ResponseEntity<String>> result = this.webClient.get()
			.uri("/greeting?name=Spring")
			.exchange()
			.flatMap(response -> response.toEntity(String.class));

	StepVerifier.create(result)
			.consumeNextWith(response -> assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()))
			.expectComplete()
			.verify(Duration.ofSeconds(3));

	expectRequestCount(1);
	expectRequest(request -> {
		assertEquals("*/*", request.getHeader(HttpHeaders.ACCEPT));
		assertEquals("/greeting?name=Spring", request.getPath());
	});
}
 
Example 21
Source Project: reactor-core   Source File: PublisherProbeTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void emptyProbeFlowB() {
	PublisherProbe<Void> a = PublisherProbe.empty();
	PublisherProbe<String> b = PublisherProbe.empty();

	TestControlFlow t = new TestControlFlow(a.mono(), b.mono());

	StepVerifier.create(t.toTest(Mono.just("principal")))
	            .verifyComplete();

	a.assertWasNotSubscribed();
	b.assertWasSubscribed();

	assertThat(a.wasSubscribed()).isFalse();
	assertThat(b.wasSubscribed()).isTrue();
}
 
Example 22
Source Project: r2dbc-mysql   Source File: CodecTestSupport.java    License: Apache License 2.0 6 votes vote down vote up
@Test
default void stringify() {
    Codec<T> codec = getCodec(UnpooledByteBufAllocator.DEFAULT);
    T[] origin = originParameters();
    Object[] strings = stringifyParameters();

    assertEquals(origin.length, strings.length);

    for (int i = 0; i < origin.length; ++i) {
        ParameterWriter writer = ParameterWriterHelper.get(1);
        codec.encode(origin[i], context())
            .publishText(writer)
            .as(StepVerifier::create)
            .verifyComplete();
        assertEquals(ParameterWriterHelper.toSql(writer), strings[i].toString());
    }
}
 
Example 23
@Test
public void options() {
	MockServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.options("http://localhost"));
	MockServerHttpResponse mockResponse = exchange.getResponse();

	ServerRequest request = new DefaultServerRequest(exchange, HandlerStrategies.withDefaults().messageReaders());

	Mono<ServerResponse> responseMono = this.handlerFunction.handle(request);
	Mono<Void> result = responseMono.flatMap(response -> {
		assertEquals(HttpStatus.OK, response.statusCode());
		assertEquals(EnumSet.of(HttpMethod.GET, HttpMethod.HEAD, HttpMethod.OPTIONS),
				response.headers().getAllow());
		return response.writeTo(exchange, context);
	});


	StepVerifier.create(result)
			.expectComplete()
			.verify();
	assertEquals(HttpStatus.OK, mockResponse.getStatusCode());
	assertEquals(EnumSet.of(HttpMethod.GET, HttpMethod.HEAD, HttpMethod.OPTIONS),
			mockResponse.getHeaders().getAllow());

	StepVerifier.create(mockResponse.getBody()).expectComplete().verify();
}
 
Example 24
Source Project: spring-analysis-note   Source File: ProtobufIntegrationTests.java    License: MIT License 6 votes vote down vote up
@Test
public void value() {
	Mono<Msg> result = this.webClient.get()
			.uri("/message")
			.exchange()
			.doOnNext(response -> {
				Assert.assertFalse(response.headers().contentType().get().getParameters().containsKey("delimited"));
				Assert.assertEquals("sample.proto", response.headers().header("X-Protobuf-Schema").get(0));
				Assert.assertEquals("Msg", response.headers().header("X-Protobuf-Message").get(0));
			})
			.flatMap(response -> response.bodyToMono(Msg.class));

	StepVerifier.create(result)
			.expectNext(TEST_MSG)
			.verifyComplete();
}
 
Example 25
Source Project: reactor-netty   Source File: HttpClientTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testIssue303() {
	disposableServer =
			HttpServer.create()
			          .port(0)
			          .handle((req, resp) -> resp.sendString(Mono.just("OK")))
			          .wiretap(true)
			          .bindNow();

	Mono<String> content =
			createHttpClientForContextWithPort()
			        .request(HttpMethod.GET)
			        .uri("/")
			        .send(ByteBufFlux.fromInbound(Mono.defer(() -> Mono.just("Hello".getBytes(Charset.defaultCharset())))))
			        .responseContent()
			        .aggregate()
			        .asString();

	StepVerifier.create(content)
	            .expectNextMatches("OK"::equals)
	            .expectComplete()
	            .verify(Duration.ofSeconds(30));
}
 
Example 26
Source Project: sdn-rx   Source File: ReactiveDynamicLabelsIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
void shouldUpdateDynamicLabels(@Autowired ReactiveNeo4jTemplate template) {

	template
		.findById(existingEntityId, InheritedSimpleDynamicLabels.class)
		.flatMap(entity -> {
			entity.moreLabels.remove("Foo");
			entity.moreLabels.add("Fizz");
			return template.save(entity);
		})
		.thenMany(getLabels(existingEntityId))
		.sort()
		.as(StepVerifier::create)
		.expectNext("Bar", "Baz", "Fizz", "Foobar", "InheritedSimpleDynamicLabels")
		.verifyComplete();
}
 
Example 27
@Test
public void should_return_outdated_instance_not_present_in_cache() {
	this.repository.stop();
	// given
	StepVerifier.create(this.repository.save(this.instance)).expectNext(this.instance).verifyComplete();
	StepVerifier.create(this.repository.save(this.instance)).verifyError(OptimisticLockingException.class);
	// when
	StepVerifier.create(this.repository.find(this.instance.getId())).expectNext(this.instance).verifyComplete();
}
 
Example 28
@Test
public void transformNoLinks() {
	MockServerWebExchange exchange = MockServerWebExchange.from(get("/static/foo.css"));
	Resource expected = getResource("foo.css");

	StepVerifier.create(this.transformerChain.transform(exchange, expected))
			.consumeNextWith(resource -> assertSame(expected, resource))
			.expectComplete().verify();
}
 
Example 29
Source Project: reactor-core   Source File: FluxLimitRequestTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void errorAtCapNotPropagated() {
	TestPublisher<Integer> tp = TestPublisher.create();

	StepVerifier.create(tp.flux().limitRequest(3))
	            .then(() -> tp.next(1, 2, 3).error(new IllegalStateException("boom")))
	            .expectNext(1, 2, 3)
	            .verifyComplete();
}
 
Example 30
@Test
public void writeCredential() {
	AtomicReference<CredentialDetails<ValueCredential>> written = new AtomicReference<>();

	StepVerifier
			.create(this.credentials
					.write(ValueCredentialRequest.builder().name(CREDENTIAL_NAME).value(CREDENTIAL_VALUE).build()))
			.assertNext((response) -> {
				assertThat(response.getName().getName()).isEqualTo(CREDENTIAL_NAME.getName());
				assertThat(response.getValue().getValue()).isEqualTo(CREDENTIAL_VALUE);
				assertThat(response.getCredentialType()).isEqualTo(CredentialType.VALUE);
				assertThat(response.getId()).isNotNull();

				written.set(response);
			}).verifyComplete();

	StepVerifier.create(this.credentials.getById(written.get().getId(), ValueCredential.class))
			.assertNext((response) -> {
				assertThat(response.getName().getName()).isEqualTo(CREDENTIAL_NAME.getName());
				assertThat(response.getValue().getValue()).isEqualTo(CREDENTIAL_VALUE);
				assertThat(response.getCredentialType()).isEqualTo(CredentialType.VALUE);
			}).verifyComplete();

	StepVerifier.create(this.credentials.getByName(CREDENTIAL_NAME, ValueCredential.class))
			.assertNext((response) -> {
				assertThat(response.getName().getName()).isEqualTo(CREDENTIAL_NAME.getName());
				assertThat(response.getValue().getValue()).isEqualTo(CREDENTIAL_VALUE);
				assertThat(response.getCredentialType()).isEqualTo(CredentialType.VALUE);
			}).verifyComplete();

	StepVerifier.create(this.credentials.findByName(new SimpleCredentialName("/test")))
			.assertNext((response) -> assertThat(response).extracting("name").extracting("name")
					.containsExactly(CREDENTIAL_NAME.getName()))
			.verifyComplete();

	StepVerifier.create(this.credentials.findByPath("/spring-credhub/integration-test"))
			.assertNext((response) -> assertThat(response).extracting("name").extracting("name")
					.containsExactly(CREDENTIAL_NAME.getName()))
			.verifyComplete();
}