记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
ca585452
Commit
ca585452
authored
Oct 20, 2021
by
张国柄
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+pull url;
parent
ce62934b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
408 additions
and
0 deletions
+408
-0
AdamTest.java
...c/test/java/com/liquidnet/service/adam/test/AdamTest.java
+68
-0
CandyTest.java
.../src/test/java/com/liquidnet/service/candy/CandyTest.java
+68
-0
ChimeTest.java
...test/java/com/liquidnet/service/chime/test/ChimeTest.java
+68
-0
KylinTest.java
.../src/test/java/com/liquidnet/service/kylin/KylinTest.java
+68
-0
OrderTest.java
...test/java/com/liquidnet/service/order/test/OrderTest.java
+68
-0
SweetTest.java
.../src/test/java/com/liquidnet/service/sweet/SweetTest.java
+68
-0
No files found.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/test/java/com/liquidnet/service/adam/test/AdamTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
adam
.
test
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
AdamTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
AdamTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/adam"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
liquidnet-bus-service/liquidnet-service-candy/liquidnet-service-candy-impl/src/test/java/com/liquidnet/service/candy/CandyTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
candy
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
CandyTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
CandyTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/candy"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
liquidnet-bus-service/liquidnet-service-chime/liquidnet-service-chime-impl/src/test/java/com/liquidnet/service/chime/test/ChimeTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
chime
.
test
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
ChimeTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ChimeTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/chime"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/test/java/com/liquidnet/service/kylin/KylinTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
kylin
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
KylinTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
KylinTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/kylin"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/test/java/com/liquidnet/service/order/test/OrderTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
order
.
test
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
OrderTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
OrderTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/order"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/test/java/com/liquidnet/service/sweet/SweetTest.java
0 → 100644
View file @
ca585452
package
com
.
liquidnet
.
service
.
sweet
;
import
io.swagger.annotations.ApiOperation
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.web.context.WebApplicationContext
;
import
org.springframework.web.method.HandlerMethod
;
import
org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition
;
import
org.springframework.web.servlet.mvc.method.RequestMappingInfo
;
import
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
@ConfigurationProperties
(
prefix
=
"global-auth"
)
public
class
SweetTest
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
SweetTest
.
class
);
@Autowired
private
WebApplicationContext
webApplicationContext
;
private
final
static
AntPathMatcher
antPathMatcher
=
new
AntPathMatcher
();
private
final
static
String
CONTEXT
=
"/sweet"
;
private
List
<
String
>
excludeUrlPattern
;
public
List
<
String
>
getExcludeUrlPattern
()
{
return
excludeUrlPattern
;
}
public
void
setExcludeUrlPattern
(
List
<
String
>
excludeUrlPattern
)
{
this
.
excludeUrlPattern
=
excludeUrlPattern
;
}
@Test
public
void
pullUrl
()
{
//requestMappingHandlerMapping,swagger2ControllerMapping,controllerEndpointHandlerMapping
RequestMappingHandlerMapping
mapping
=
webApplicationContext
.
getBean
(
"requestMappingHandlerMapping"
,
RequestMappingHandlerMapping
.
class
);
Map
<
RequestMappingInfo
,
HandlerMethod
>
handlerMethodMap
=
mapping
.
getHandlerMethods
();
handlerMethodMap
.
forEach
((
c
,
m
)
->
{
RequestMethodsRequestCondition
methodsCondition
=
c
.
getMethodsCondition
();
ApiOperation
methodAnnotation
=
m
.
getMethodAnnotation
(
ApiOperation
.
class
);
Set
<
String
>
patterns
=
c
.
getPatternsCondition
().
getPatterns
();
patterns
.
forEach
(
r
->
{
String
url
=
CONTEXT
.
concat
(
r
);
boolean
hitflg
=
false
;
for
(
String
urlPattern
:
excludeUrlPattern
)
{
if
(
antPathMatcher
.
match
(
urlPattern
,
url
))
{
hitflg
=
true
;
}
}
log
.
info
(
"{}AUTH {} {} {}"
,
hitflg
?
"NO"
:
""
,
methodsCondition
.
isEmpty
()
?
"-"
:
methodsCondition
,
url
,
null
!=
methodAnnotation
?
methodAnnotation
.
value
()
:
"-"
);
});
});
}
}
张国柄
@zhangguobing
mentioned in commit
6fa6c983
·
Oct 20, 2021
mentioned in commit
6fa6c983
mentioned in commit 6fa6c983948615e3815913a28bd4dd204ace6cf1
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment