[ 
https://issues.apache.org/jira/browse/SCB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698455#comment-16698455
 ] 

ASF GitHub Bot commented on SCB-925:
------------------------------------

weichao666 commented on a change in pull request #1004: [SCB-925] Springmvc, 
when have defaultValue, required should be false, when param not exist, should 
check isRequired
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/1004#discussion_r236115540
 
 

 ##########
 File path: 
integration-tests/it-consumer/src/main/java/org/apache/servicecomb/it/testcase/TestDefaultValue.java
 ##########
 @@ -472,12 +524,21 @@ public void floatHeader_require_springmvc_rt() {
 
   @Test
   public void floatForm_require_springmvc_intf() {
-    assertEquals(defaultFloat, 
consumersSpringmvc.getIntf().floatFormRequire(null), 0.0f);
+    try {
+      consumersSpringmvc.getIntf().floatFormRequire(null);
+      assertEquals("required is true, throw exception", "but not throw 
exception");
+    } catch (Exception e) {
+      assertEquals(true, e.getMessage().contains("Parameter is not valid"));
+    }
   }
 
   @Test
   public void floatForm_require_springmvc_rt() {
-    assertEquals(defaultFloat,
-        
consumersSpringmvc.getSCBRestTemplate().postForObject("/floatFormRequire", 
null, float.class), 0.0f);
+    try {
+      
consumersSpringmvc.getSCBRestTemplate().postForObject("/floatFormRequire", 
null, float.class);
 
 Review comment:
   yes

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


> Springmvc, when have defaultValue, required should be false
> -----------------------------------------------------------
>
>                 Key: SCB-925
>                 URL: https://issues.apache.org/jira/browse/SCB-925
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Java-Chassis
>            Reporter: WeiChao
>            Assignee: WeiChao
>            Priority: Major
>             Fix For: java-chassis-1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to