You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/06/22 15:43:15 UTC

[GitHub] [inlong] leosanqing opened a new pull request, #4744: [INLONG-4684][Manager] Add enums validation for controller

leosanqing opened a new pull request, #4744:
URL: https://github.com/apache/inlong/pull/4744

   ### Prepare a Pull Request
   
   - Fixes #4684
   
   ### Motivation
   - The controller does not use @Validation for validation
   - We can define our own validators to validate enumeration types
   ### Modifications
   - AnnoController Use Spring's existing Validator
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [x] This change is already covered by existing tests, such as:
      - AnnoControllerTest
   
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #4744: [INLONG-4684][Manager] Add enums validation for controller

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4744:
URL: https://github.com/apache/inlong/pull/4744#discussion_r904464104


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/UserTypeEnum.java:
##########
@@ -39,11 +47,20 @@ public enum UserTypeEnum {
         this.code = code;
     }
 
+    public static final List<Integer> ARRAYS = Arrays.stream(values())

Review Comment:
   Did this field need `public`?



##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/IntArrayValuable.java:
##########
@@ -0,0 +1,25 @@
+/*
+ * 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.inlong.manager.common.enums;

Review Comment:
   Please add some Java docs for classes, interface, and their public methods, thanks.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow merged pull request #4744: [INLONG-4684][Manager] Add enums validation for controller

Posted by GitBox <gi...@apache.org>.
healchow merged PR #4744:
URL: https://github.com/apache/inlong/pull/4744


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang commented on a diff in pull request #4744: [INLONG-4684][Manager] Add enums validation for controller

Posted by GitBox <gi...@apache.org>.
dockerzhang commented on code in PR #4744:
URL: https://github.com/apache/inlong/pull/4744#discussion_r905746395


##########
inlong-manager/manager-web/src/test/java/org/apache/inlong/manager/web/controller/AnnoControllerTest.java:
##########
@@ -118,4 +118,27 @@ void testLogout() throws Exception {
         Assertions.assertFalse(SecurityUtils.getSubject().isAuthenticated());
     }
 
+    @Test
+    void testRegisterFailByInvalidType() throws Exception {
+        UserInfo userInfo = UserInfo.builder()
+                .username("admin11")
+                .password("22222")

Review Comment:
   it's better to make the password meaningful. like 'test_username', 'test_password'.
   '22222', '88888' is so casual.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org