File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
main/java/com/flow/platform/api/service/node
test/java/com/flow/platform/api/test/service Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ private Boolean checkFlowName(String flowName) {
287287 return false ;
288288 }
289289
290- if (!Pattern .compile ("^[^_^-] [\\ w-]{4,20}$" ).matcher (flowName ).matches ()) {
290+ if (!Pattern .compile ("^(?!_)(?!-) [\\ w-]{4,20}$" ).matcher (flowName ).matches ()) {
291291 return false ;
292292 }
293293
Original file line number Diff line number Diff line change @@ -282,9 +282,11 @@ public void should_create_flow_success() {
282282 Assert .assertNotNull (nodeService .createEmptyFlow ("flow-test" ));
283283 Assert .assertNotNull (nodeService .createEmptyFlow ("flow_test" ));
284284 Assert .assertNotNull (nodeService .createEmptyFlow ("flow_12est" ));
285+ Assert .assertNotNull (nodeService .createEmptyFlow ("flow12est" ));
286+ Assert .assertNotNull (nodeService .createEmptyFlow ("flow" ));
285287 }
286288
287- @ Test ( expected = IllegalParameterException . class )
289+ @ Test
288290 public void should_create_flow_error () {
289291 // not start with _
290292 nodeService .createEmptyFlow ("_flow-test" );
@@ -294,5 +296,8 @@ public void should_create_flow_error() {
294296
295297 // not include .
296298 nodeService .createEmptyFlow ("flow.test" );
299+
300+ // not include 3 keys
301+ nodeService .createEmptyFlow ("flw" );
297302 }
298303}
You can’t perform that action at this time.
0 commit comments