@Test public void get() { String userId = UUID.randomUUID().toString(); String key = service.create(CreateShortener.builder() .url("www.tes.com") .userId(userId) .build()) .block().key(); webTestClient.get().uri("/shorteners/map/{key}", key).accept(MediaType.APPLICATION_JSON).exchange() .expectStatus() .is3xxRedirection() .expectBody(); }
Mono<ServerResponse> create(ServerRequest request) { log.info("execute() -> "); return request.bodyToMono(CreateShortener.class) .flatMap(shortenerService::create) .flatMap(this::mapToResponse); }
ShortenerHandler implements HttpHandler { Mono<ServerResponse> create(ServerRequest request) { log.info("execute() -> "); return request.bodyToMono(CreateShortener.class) .flatMap(shortenerService::create) .flatMap(this::mapToResponse); } }
ShortenerHandler implements HttpHandler { Mono<ServerResponse> create(ServerRequest request) { log.info("execute() -> "); return request.bodyToMono(CreateShortener.class) .flatMap(shortenerService::create) .flatMap(this::mapToResponse); } ShortenerHandler(ShortenerService shortenerService, ShortenerQuery shortenerQuery); }
ShortenerHandler implements HttpHandler { Mono<ServerResponse> create(ServerRequest request) { log.info("execute() -> "); return request.bodyToMono(CreateShortener.class) .flatMap(shortenerService::create) .flatMap(this::mapToResponse); } ShortenerHandler(ShortenerService shortenerService, ShortenerQuery shortenerQuery); @Override RouterFunction<ServerResponse> route(); }
ShortenerHandler implements HttpHandler { Mono<ServerResponse> create(ServerRequest request) { log.info("execute() -> "); return request.bodyToMono(CreateShortener.class) .flatMap(shortenerService::create) .flatMap(this::mapToResponse); } ShortenerHandler(ShortenerService shortenerService, ShortenerQuery shortenerQuery); @Override RouterFunction<ServerResponse> route();  }