You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/06/28 08:53:03 UTC

[GitHub] [servicecomb-java-chassis] wuliuqi666 commented on a change in pull request #1235: [SCB-1291]supportApiOperationMethodOverride

wuliuqi666 commented on a change in pull request #1235:  [SCB-1291]supportApiOperationMethodOverride
URL: https://github.com/apache/servicecomb-java-chassis/pull/1235#discussion_r298509471
 
 

 ##########
 File path: integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestApiOperationOverRead.java
 ##########
 @@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.it.testcase;
+
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
+import org.apache.servicecomb.it.Consumers;
+import org.junit.Assert;
+import org.junit.Test;
+
+import io.swagger.annotations.ApiOperation;
+
+public class TestApiOperationOverRead {
+  interface OptionalIntf {
+
+    @ApiOperation(value = "", nickname = "sayHi")
+    String sayHello();
+
+    @ApiOperation(value = "", nickname = "sayHello")
+    String sayHello(String name);
+
+    @ApiOperation(value = "", nickname = "sayHello")
+    CompletableFuture<String> sayHelloAsyne(String name);
+
+    @ApiOperation(value = "", nickname = "sayHi")
+    CompletableFuture<String> sayHelloAsyne();
+  }
+
+  private static Consumers<OptionalIntf> consumersPojo = new Consumers<>("apiOpertionPojoSchema", OptionalIntf.class);
+
+  //private static Consumers<OptionalIntf> consumersJaxrs = new Consumers<>("apiOperationJaxrsSchema", OptionalIntf.class);
+
+  private static Consumers<OptionalIntf> consumersSpringmvc = new Consumers<>("apiOperationSpringmvcSchema", OptionalIntf.class);
+
+  @Test
+  public void consumersPojo_A_intf() {
+    Assert.assertEquals("ApiOpertionPojoSchema#sayHello", consumersPojo.getIntf().sayHello());
+  }
+
+  @Test
+  public void consumersPojo_B_intf() {
+    Assert.assertEquals("value", consumersPojo.getIntf().sayHello("value"));
+  }
+
+  @Test
+  public void consumersPojo_C_intf() throws ExecutionException, InterruptedException {
+    Assert.assertEquals("value", consumersPojo.getIntf().sayHelloAsyne("value").get());
+  }
+
+  @Test
+  public void consumersPojo_D_intf() throws ExecutionException, InterruptedException {
+    Assert.assertEquals("ApiOpertionPojoSchema#sayHello", consumersPojo.getIntf().sayHelloAsyne().get());
+  }
+
+//  @Test
+//  public void consumersJaxrs_A_intf() {
 
 Review comment:
   ok

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services