|
| 1 | +/* |
| 2 | + * Copyright 2013-2015 the original author or authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package reactivefeign.testcase; |
| 18 | + |
| 19 | +import java.util.Collection; |
| 20 | + |
| 21 | +import reactivefeign.ReactiveDelegatingContract; |
| 22 | +import reactivefeign.testcase.domain.Bill; |
| 23 | +import reactivefeign.testcase.domain.Flavor; |
| 24 | +import reactivefeign.testcase.domain.IceCreamOrder; |
| 25 | +import reactivefeign.testcase.domain.Mixin; |
| 26 | + |
| 27 | +import feign.Headers; |
| 28 | +import feign.Param; |
| 29 | +import feign.RequestLine; |
| 30 | +import reactor.core.publisher.Flux; |
| 31 | +import reactor.core.publisher.Mono; |
| 32 | + |
| 33 | +/** |
| 34 | + * API of an iceream web service with one method that doesn't returns {@link Mono} or |
| 35 | + * {@link Flux} and violates {@link ReactiveDelegatingContract}s rules. |
| 36 | + * |
| 37 | + * @author Sergii Karpenko |
| 38 | + */ |
| 39 | +public interface IcecreamServiceApiBroken { |
| 40 | + |
| 41 | + @RequestLine("GET /icecream/flavors") |
| 42 | + Mono<Collection<Flavor>> getAvailableFlavors(); |
| 43 | + |
| 44 | + @RequestLine("GET /icecream/mixins") |
| 45 | + Mono<Collection<Mixin>> getAvailableMixins(); |
| 46 | + |
| 47 | + @RequestLine("POST /icecream/orders") |
| 48 | + @Headers("Content-Type: application/json") |
| 49 | + Mono<Bill> makeOrder(IceCreamOrder order); |
| 50 | + |
| 51 | + /** |
| 52 | + * Method that doesn't respects contract. |
| 53 | + */ |
| 54 | + @RequestLine("GET /icecream/orders/{orderId}") |
| 55 | + IceCreamOrder findOrder(@Param("orderId") int orderId); |
| 56 | +} |
0 commit comments