Skip to content
GitLab
Explore
Sign in
IA2
GMS
Compare revisions
e60cd7fbff9fc1e327082685d51dfb507aa2172e to 6eef3264c5891520828c756661ce3da8d739a67f
Hide whitespace changes
Inline
Side-by-side
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/DeleteGroupCall.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse.BodyHandlers
;
public
class
DeleteGroupCall
extends
BaseCall
<
GmsClient
>
{
public
DeleteGroupCall
(
GmsClient
client
)
{
super
(
client
);
}
public
boolean
deleteGroup
(
String
completeGroupName
)
{
HttpRequest
groupsRequest
=
client
.
newRequest
(
"ws/jwt/"
+
completeGroupName
)
.
header
(
"Accept"
,
"text/plain"
)
.
DELETE
()
.
build
();
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
204
,
res
->
true
);
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/GetGroupPermissionsCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/GetGroupPermissionsCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
it.inaf.ia2.gms.client.model.GroupPermission
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
GetGroupPermissionsCall
extends
Base
Gms
Call
{
public
class
GetGroupPermissionsCall
extends
BaseCall
<
GmsClient
>
{
public
GetGroupPermissionsCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
GetGroupPermissionsCall
(
Gms
Client
client
)
{
super
(
client
);
}
public
List
<
GroupPermission
>
getGroupPermissions
(
String
groupId
)
{
List
<
GroupPermission
>
groupPermissions
=
new
ArrayList
<>();
String
endpoint
=
"permission"
;
String
endpoint
=
"
ws/jwt/
permission"
;
endpoint
+=
"/"
+
groupId
;
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to retrieve groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -48,6 +43,6 @@ public class GetGroupPermissionsCall extends BaseGmsCall {
}
}
return
groupPermissions
;
})
.
join
()
;
});
}
}
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/GetGroupStatusCall.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.util.List
;
public
class
GetGroupStatusCall
extends
BaseCall
<
GmsClient
>
{
public
GetGroupStatusCall
(
GmsClient
client
)
{
super
(
client
);
}
public
List
<
String
[]>
getStatus
(
String
groupCompleteName
)
{
String
uri
=
"group/status?groupName="
+
groupCompleteName
;
HttpRequest
request
=
client
.
newRequest
(
uri
)
.
header
(
"Accept"
,
"application/json"
)
.
GET
()
.
build
();
return
client
.
call
(
request
,
HttpResponse
.
BodyHandlers
.
ofInputStream
(),
200
,
in
->
parseJsonList
(
in
,
String
[].
class
));
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/GetMemberEmailAddresses.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/GetMemberEmailAddresses.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
GetMemberEmailAddresses
extends
Base
Gms
Call
{
public
class
GetMemberEmailAddresses
extends
BaseCall
<
GmsClient
>
{
public
GetMemberEmailAddresses
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
GetMemberEmailAddresses
(
Gms
Client
client
)
{
super
(
client
);
}
public
List
<
String
>
getMemberEmailAddresses
(
String
group
,
Permission
permission
)
{
...
...
@@ -22,21 +24,14 @@ public class GetMemberEmailAddresses extends BaseGmsCall {
endpoint
+=
"?permission="
+
permission
;
}
HttpRequest
request
=
newHttp
Request
(
endpoint
)
HttpRequest
request
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
request
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
request
,
response
);
throw
new
IllegalStateException
(
"Unable to retrieve groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
request
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -45,6 +40,6 @@ public class GetMemberEmailAddresses extends BaseGmsCall {
}
}
return
emailAddresses
;
})
.
join
()
;
});
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/GetUserGroupsCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/GetUserGroupsCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
GetUserGroupsCall
extends
Base
Gms
Call
{
public
class
GetUserGroupsCall
extends
BaseCall
<
GmsClient
>
{
public
GetUserGroupsCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
GetUserGroupsCall
(
Gms
Client
client
)
{
super
(
client
);
}
/**
...
...
@@ -20,21 +22,14 @@ public class GetUserGroupsCall extends BaseGmsCall {
List
<
String
>
groups
=
new
ArrayList
<>();
HttpRequest
groupsRequest
=
newHttp
Request
(
"search"
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
"
vo/
search"
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to retrieve groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -50,34 +45,27 @@ public class GetUserGroupsCall extends BaseGmsCall {
}
}
return
groups
;
})
.
join
()
;
});
}
public
List
<
String
>
getUserGroups
(
String
userId
,
String
prefix
)
{
List
<
String
>
groups
=
new
ArrayList
<>();
String
endpoint
=
"membership"
;
String
endpoint
=
"
ws/jwt/
membership"
;
if
(
prefix
!=
null
&&
!
prefix
.
isBlank
())
{
endpoint
+=
"/"
+
prefix
;
}
endpoint
+=
"?user_id="
+
userId
;
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to retrieve groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -86,6 +74,6 @@ public class GetUserGroupsCall extends BaseGmsCall {
}
}
return
groups
;
})
.
join
()
;
});
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/GetUserPermissionsCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/GetUserPermissionsCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
it.inaf.ia2.gms.client.model.UserPermission
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
GetUserPermissionsCall
extends
Base
Gms
Call
{
public
class
GetUserPermissionsCall
extends
BaseCall
<
GmsClient
>
{
public
GetUserPermissionsCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
GetUserPermissionsCall
(
Gms
Client
client
)
{
super
(
client
);
}
public
List
<
UserPermission
>
getUserPermissions
(
String
userId
)
{
List
<
UserPermission
>
userPermissions
=
new
ArrayList
<>();
String
endpoint
=
"permission"
;
String
endpoint
=
"
ws/jwt/
permission"
;
endpoint
+=
"?user_id="
+
userId
;
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to retrieve groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -48,6 +43,6 @@ public class GetUserPermissionsCall extends BaseGmsCall {
}
}
return
userPermissions
;
})
.
join
()
;
});
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/ListGroupsCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/ListGroupsCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
public
class
ListGroupsCall
extends
Base
Gms
Call
{
public
class
ListGroupsCall
extends
BaseCall
<
GmsClient
>
{
public
ListGroupsCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
ListGroupsCall
(
Gms
Client
client
)
{
super
(
client
);
}
/**
...
...
@@ -21,26 +23,19 @@ public class ListGroupsCall extends BaseGmsCall {
List
<
String
>
groups
=
new
ArrayList
<>();
String
uri
=
"list"
;
String
uri
=
"
ws/jwt/
list"
;
if
(
prefix
!=
null
&&
!
prefix
.
isBlank
())
{
uri
+=
"/"
+
prefix
;
}
HttpRequest
groupsRequest
=
newHttp
Request
(
uri
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
uri
)
.
header
(
"Accept"
,
"text/plain"
)
.
GET
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
response
.
body
();
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to list groups"
);
})
.
thenApply
(
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
200
,
inputStream
->
{
try
(
Scanner
scan
=
new
Scanner
(
inputStream
))
{
while
(
scan
.
hasNextLine
())
{
String
line
=
scan
.
nextLine
();
if
(!
line
.
isEmpty
())
{
...
...
@@ -49,6 +44,6 @@ public class ListGroupsCall extends BaseGmsCall {
}
}
return
groups
;
})
.
join
()
;
});
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/RemoveMemberCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/RemoveMemberCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
public
class
RemoveMemberCall
extends
Base
Gms
Call
{
public
class
RemoveMemberCall
extends
BaseCall
<
GmsClient
>
{
public
RemoveMemberCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
RemoveMemberCall
(
Gms
Client
client
)
{
super
(
client
);
}
public
boolean
removeMember
(
String
completeGroupName
,
String
userId
)
{
String
endpoint
=
"membership"
;
String
endpoint
=
"
ws/jwt/
membership"
;
if
(
completeGroupName
!=
null
&&
!
completeGroupName
.
isBlank
())
{
endpoint
+=
"/"
+
completeGroupName
;
}
endpoint
+=
"?user_id="
+
userId
;
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
DELETE
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
204
)
{
return
true
;
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to remove member from group"
);
}).
join
();
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
204
,
res
->
true
);
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/RemovePermissionCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/RemovePermissionCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
public
class
RemovePermissionCall
extends
Base
Gms
Call
{
public
class
RemovePermissionCall
extends
BaseCall
<
GmsClient
>
{
public
RemovePermissionCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
RemovePermissionCall
(
Gms
Client
client
)
{
super
(
client
);
}
public
boolean
removePermission
(
String
completeGroupName
,
String
userId
)
{
String
endpoint
=
"permission"
;
String
endpoint
=
"
ws/jwt/
permission"
;
if
(
completeGroupName
!=
null
&&
!
completeGroupName
.
isBlank
())
{
endpoint
+=
"/"
+
completeGroupName
;
}
endpoint
+=
"?user_id="
+
userId
;
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
DELETE
()
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
204
)
{
return
true
;
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to remove permission"
);
}).
join
();
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofInputStream
(),
204
,
res
->
true
);
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/call/SetPermissionCall.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/call/SetPermissionCall.java
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
static
it
.
inaf
.
ia2
.
gms
.
client
.
call
.
BaseGmsCall
.
logServerErrorInputStream
;
import
it.inaf.ia2.client.BaseCall
;
import
it.inaf.ia2.gms.client.GmsClient
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse
.BodyHandlers
;
public
class
SetPermissionCall
extends
Base
Gms
Call
{
public
class
SetPermissionCall
extends
BaseCall
<
GmsClient
>
{
public
SetPermissionCall
(
Http
Client
Wrapper
clientWrapper
)
{
super
(
client
Wrapper
);
public
SetPermissionCall
(
Gms
Client
client
)
{
super
(
client
);
}
public
boolean
setPermission
(
String
completeGroupName
,
String
userId
,
Permission
permission
)
{
public
String
setPermission
(
String
completeGroupName
,
String
userId
,
Permission
permission
)
{
String
endpoint
=
"permission"
;
String
endpoint
=
"
ws/jwt/
permission"
;
if
(
completeGroupName
!=
null
&&
!
completeGroupName
.
isBlank
())
{
endpoint
+=
"/"
+
completeGroupName
;
}
...
...
@@ -21,19 +22,12 @@ public class SetPermissionCall extends BaseGmsCall {
HttpRequest
.
BodyPublisher
requestBody
=
HttpRequest
.
BodyPublishers
.
ofString
(
"user_id="
+
userId
+
"&permission="
+
permission
);
HttpRequest
groupsRequest
=
newHttp
Request
(
endpoint
)
HttpRequest
groupsRequest
=
client
.
new
Request
(
endpoint
)
.
header
(
"Accept"
,
"text/plain"
)
.
header
(
"Content-Type"
,
"application/x-www-form-urlencoded"
)
.
PUT
(
requestBody
)
.
build
();
return
getClient
().
sendAsync
(
groupsRequest
,
HttpResponse
.
BodyHandlers
.
ofInputStream
())
.
thenApply
(
response
->
{
if
(
response
.
statusCode
()
==
200
)
{
return
true
;
}
logServerErrorInputStream
(
groupsRequest
,
response
);
throw
new
IllegalStateException
(
"Unable to set permission"
);
}).
join
();
return
client
.
call
(
groupsRequest
,
BodyHandlers
.
ofString
(),
200
,
res
->
res
);
}
}
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/model/GroupPermission.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/model/GroupPermission.java
View file @
6eef3264
File moved
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/model/Permission.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/model/Permission.java
View file @
6eef3264
File moved
gms-client/gms-client
-lib
/src/main/java/it/inaf/ia2/gms/client/model/UserPermission.java
→
gms-client/gms-client/src/main/java/it/inaf/ia2/gms/client/model/UserPermission.java
View file @
6eef3264
File moved
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/BaseGmsClientTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.UncheckedIOException
;
import
java.net.http.HttpClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.nio.charset.StandardCharsets
;
import
java.util.concurrent.CompletableFuture
;
import
org.mockito.ArgumentMatcher
;
import
org.mockito.ArgumentMatchers
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
org.mockito.MockedStatic
;
import
org.mockito.Mockito
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
when
;
public
class
BaseGmsClientTest
{
private
static
final
String
BASE_URL
=
"http://base-url"
;
protected
HttpClient
httpClient
;
protected
GmsClient
gmsClient
;
public
void
init
()
{
httpClient
=
mock
(
HttpClient
.
class
);
gmsClient
=
getMockedGmsClient
(
httpClient
);
}
protected
static
String
getResourceFileContent
(
String
fileName
)
{
try
(
InputStream
in
=
BaseGmsClientTest
.
class
.
getClassLoader
().
getResourceAsStream
(
fileName
))
{
return
new
String
(
in
.
readAllBytes
(),
StandardCharsets
.
UTF_8
);
}
catch
(
IOException
ex
)
{
throw
new
UncheckedIOException
(
ex
);
}
}
protected
static
GmsClient
getMockedGmsClient
(
HttpClient
mockedHttpClient
)
{
HttpClient
.
Builder
builder
=
mock
(
HttpClient
.
Builder
.
class
);
when
(
builder
.
followRedirects
(
any
())).
thenReturn
(
builder
);
when
(
builder
.
version
(
any
())).
thenReturn
(
builder
);
when
(
builder
.
build
()).
thenReturn
(
mockedHttpClient
);
try
(
MockedStatic
<
HttpClient
>
staticMock
=
Mockito
.
mockStatic
(
HttpClient
.
class
))
{
staticMock
.
when
(
HttpClient:
:
newBuilder
).
thenReturn
(
builder
);
return
new
GmsClient
(
BASE_URL
).
setAccessToken
(
"foo"
);
}
}
protected
static
CompletableFuture
<
HttpResponse
<
InputStream
>>
getMockedStreamResponseFuture
(
int
statusCode
,
String
body
)
{
return
CompletableFuture
.
completedFuture
(
getMockedStreamResponse
(
200
,
body
));
}
protected
static
CompletableFuture
<
HttpResponse
<
String
>>
getMockedStringResponseFuture
(
int
statusCode
,
String
body
)
{
return
CompletableFuture
.
completedFuture
(
getMockedStringResponse
(
200
,
body
));
}
protected
static
HttpResponse
<
InputStream
>
getMockedStreamResponse
(
int
statusCode
,
String
body
)
{
HttpResponse
response
=
getMockedResponse
(
statusCode
);
InputStream
in
=
new
ByteArrayInputStream
(
body
.
getBytes
(
StandardCharsets
.
UTF_8
));
when
(
response
.
body
()).
thenReturn
(
in
);
return
response
;
}
protected
static
HttpResponse
<
String
>
getMockedStringResponse
(
int
statusCode
,
String
body
)
{
HttpResponse
response
=
getMockedResponse
(
statusCode
);
when
(
response
.
body
()).
thenReturn
(
body
);
return
response
;
}
protected
static
HttpResponse
getMockedResponse
(
int
statusCode
)
{
HttpResponse
response
=
mock
(
HttpResponse
.
class
);
when
(
response
.
statusCode
()).
thenReturn
(
statusCode
);
return
response
;
}
protected
static
HttpRequest
endpointEq
(
String
expectedMethod
,
String
expectedEndpoint
)
{
return
ArgumentMatchers
.
argThat
(
endpointEqArgumentMatcher
(
expectedMethod
,
expectedEndpoint
));
}
protected
static
ArgumentMatcher
<
HttpRequest
>
endpointEqArgumentMatcher
(
String
expectedMethod
,
String
expectedEndpoint
)
{
return
new
ArgumentMatcher
<
HttpRequest
>()
{
private
final
String
expectedUri
=
BASE_URL
+
"/"
+
expectedEndpoint
;
@Override
public
boolean
matches
(
HttpRequest
request
)
{
return
expectedMethod
.
equals
(
request
.
method
())
&&
expectedUri
.
equals
(
request
.
uri
().
toString
());
}
@Override
public
String
toString
()
{
return
expectedMethod
+
" "
+
expectedUri
;
}
};
}
}
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/call/AddMemberTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
java.util.concurrent.CompletableFuture
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.jupiter.MockitoExtension
;
@ExtendWith
(
MockitoExtension
.
class
)
public
class
AddMemberTest
extends
BaseGmsClientTest
{
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
public
void
testAddMember
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
gmsClient
.
addMember
(
"LBT.INAF"
,
"user"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"ws/jwt/membership/LBT.INAF"
),
any
());
}
}
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/call/AddPermissionTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
java.util.concurrent.CompletableFuture
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.jupiter.MockitoExtension
;
@ExtendWith
(
MockitoExtension
.
class
)
public
class
AddPermissionTest
extends
BaseGmsClientTest
{
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
public
void
testAddPermission
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
gmsClient
.
addPermission
(
"LBT.INAF"
,
"user"
,
Permission
.
ADMIN
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"ws/jwt/permission/LBT.INAF"
),
any
());
}
}
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/call/CreateGroupTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
java.util.concurrent.CompletableFuture
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.jupiter.MockitoExtension
;
@ExtendWith
(
MockitoExtension
.
class
)
public
class
CreateGroupTest
extends
BaseGmsClientTest
{
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
public
void
testCreateGroup
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
201
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
gmsClient
.
createGroup
(
"LBT.INAF"
,
false
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"ws/jwt/LBT.INAF"
),
any
());
}
}
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/call/DeleteGroupTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
java.util.concurrent.CompletableFuture
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.jupiter.MockitoExtension
;
@ExtendWith
(
MockitoExtension
.
class
)
public
class
DeleteGroupTest
extends
BaseGmsClientTest
{
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
public
void
testDeleteGroup
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
204
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
gmsClient
.
deleteGroup
(
"LBT.INAF"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"DELETE"
,
"ws/jwt/LBT.INAF"
),
any
());
}
}
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/call/GetUserGroupsTest.java
0 → 100644
View file @
6eef3264
package
it.inaf.ia2.gms.client.call
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.jupiter.MockitoExtension
;
@ExtendWith
(
MockitoExtension
.
class
)
public
class
GetUserGroupsTest
extends
BaseGmsClientTest
{
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
public
void
testGetMyGroups
()
{
String
body
=
"LBT.INAF\n"
+
"LBT.AZ\n"
+
""
;
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedStreamResponse
(
200
,
body
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
List
<
String
>
groups
=
gmsClient
.
getMyGroups
(
"LBT."
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"GET"
,
"vo/search"
),
any
());
assertEquals
(
2
,
groups
.
size
());
assertEquals
(
"INAF"
,
groups
.
get
(
0
));
assertEquals
(
"AZ"
,
groups
.
get
(
1
));
}
@Test
public
void
testListGroups
()
{
String
body
=
"INAF\n"
+
"AZ"
;
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedStreamResponse
(
200
,
body
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
List
<
String
>
groups
=
gmsClient
.
listGroups
(
"LBT."
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"GET"
,
"ws/jwt/list/LBT."
),
any
());
assertEquals
(
2
,
groups
.
size
());
assertEquals
(
"INAF"
,
groups
.
get
(
0
));
assertEquals
(
"AZ"
,
groups
.
get
(
1
));
}
}
gms-client/gms-client
-lib
/src/test/java/it/inaf/ia2/gms/client/
GmsClient
Test.java
→
gms-client/gms-client/src/test/java/it/inaf/ia2/gms/client/
call/InvitedRegistration
Test.java
View file @
6eef3264
package
it.inaf.ia2.gms.client
;
package
it.inaf.ia2.gms.client
.call
;
import
it.inaf.ia2.gms.client.call.HttpClientWrapper
;
import
it.inaf.ia2.gms.client.call.MockedHttpClientWrapper
;
import
it.inaf.ia2.gms.client.BaseGmsClientTest
;
import
it.inaf.ia2.gms.client.model.Permission
;
import
java.io.ByteArrayInputStream
;
import
java.io.InputStream
;
import
java.net.http.HttpClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse.BodySubscriber
;
import
java.net.http.HttpResponse.BodySubscribers
;
import
java.nio.ByteBuffer
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
...
...
@@ -17,139 +10,24 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.Flow
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.extension.ExtendWith
;
import
org.mockito.AdditionalMatchers
;
import
org.mockito.ArgumentMatcher
;
import
org.mockito.ArgumentMatchers
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
org.mockito.junit.
MockitoJUnitRunner
;
import
org.mockito.junit.
jupiter.MockitoExtension
;
@
Run
With
(
Mockito
JUnitRunner
.
class
)
public
class
GmsClientTest
{
@
Extend
With
(
Mockito
Extension
.
class
)
public
class
InvitedRegistrationTest
extends
Base
GmsClientTest
{
private
static
final
String
BASE_URL
=
"http://base-url"
;
private
HttpClient
httpClient
;
private
GmsClient
client
;
@Before
public
void
setUp
()
{
httpClient
=
mock
(
HttpClient
.
class
);
HttpClientWrapper
clientWrapper
=
new
MockedHttpClientWrapper
(
BASE_URL
,
httpClient
);
clientWrapper
.
setAccessToken
(
"foo"
);
client
=
new
GmsClient
(
clientWrapper
);
}
@Test
public
void
testGetMyGroups
()
{
String
body
=
"LBT.INAF\n"
+
"LBT.AZ"
;
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
,
body
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
List
<
String
>
groups
=
client
.
getMyGroups
(
"LBT."
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"GET"
,
"search"
),
any
());
assertEquals
(
2
,
groups
.
size
());
assertEquals
(
"INAF"
,
groups
.
get
(
0
));
assertEquals
(
"AZ"
,
groups
.
get
(
1
));
}
@Test
public
void
testListGroups
()
{
String
body
=
"INAF\n"
+
"AZ"
;
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
,
body
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
List
<
String
>
groups
=
client
.
listGroups
(
"LBT."
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"GET"
,
"list/LBT."
),
any
());
assertEquals
(
2
,
groups
.
size
());
assertEquals
(
"INAF"
,
groups
.
get
(
0
));
assertEquals
(
"AZ"
,
groups
.
get
(
1
));
}
@Test
public
void
testCreateGroup
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
201
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
createGroup
(
"LBT.INAF"
,
false
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"LBT.INAF"
),
any
());
}
@Test
public
void
testDeleteGroup
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
204
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
deleteGroup
(
"LBT.INAF"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"DELETE"
,
"LBT.INAF"
),
any
());
}
@Test
public
void
testAddMember
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
addMember
(
"LBT.INAF"
,
"user"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"membership/LBT.INAF"
),
any
());
}
@Test
public
void
testRemoveMember
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
204
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
removeMember
(
"LBT.INAF"
,
"user"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"DELETE"
,
"membership/LBT.INAF?user_id=user"
),
any
());
}
@Test
public
void
testAddPermission
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
200
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
addPermission
(
"LBT.INAF"
,
"user"
,
Permission
.
ADMIN
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"POST"
,
"permission/LBT.INAF"
),
any
());
}
@Test
public
void
testRemovePermission
()
{
CompletableFuture
response
=
CompletableFuture
.
completedFuture
(
getMockedResponse
(
204
));
when
(
httpClient
.
sendAsync
(
any
(),
any
())).
thenReturn
(
response
);
client
.
removePermission
(
"LBT.INAF"
,
"user"
);
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
endpointEq
(
"DELETE"
,
"permission/LBT.INAF?user_id=user"
),
any
());
@BeforeEach
@Override
public
void
init
()
{
super
.
init
();
}
@Test
...
...
@@ -161,7 +39,7 @@ public class GmsClientTest {
Map
<
String
,
Permission
>
permissionsMap
=
new
HashMap
<>();
permissionsMap
.
put
(
"group1"
,
Permission
.
MANAGE_MEMBERS
);
permissionsMap
.
put
(
"group2"
,
Permission
.
MANAGE_MEMBERS
);
c
lient
.
addInvitedRegistration
(
"bvjsgqu423"
,
"email"
,
permissionsMap
);
gmsC
lient
.
addInvitedRegistration
(
"bvjsgqu423"
,
"email"
,
permissionsMap
);
// hash = AOyojiwaRR7BHPde6Tomg3+BMoQQggNM3wUHEarXuNQ=
verify
(
httpClient
,
times
(
1
)).
sendAsync
(
...
...
@@ -169,7 +47,7 @@ public class GmsClientTest {
endpointEq
(
"POST"
,
"invited-registration"
),
ArgumentMatchers
.
argThat
(
req
->
{
String
reqbody
=
req
.
bodyPublisher
().
map
(
p
->
{
var
bodySubscriber
=
BodySubscribers
.
ofString
(
StandardCharsets
.
UTF_8
);
var
bodySubscriber
=
HttpResponse
.
BodySubscribers
.
ofString
(
StandardCharsets
.
UTF_8
);
var
flowSubscriber
=
new
StringSubscriber
(
bodySubscriber
);
p
.
subscribe
(
flowSubscriber
);
return
bodySubscriber
.
getBody
().
toCompletableFuture
().
join
();
...
...
@@ -191,9 +69,9 @@ public class GmsClientTest {
*/
static
final
class
StringSubscriber
implements
Flow
.
Subscriber
<
ByteBuffer
>
{
final
BodySubscriber
<
String
>
wrapped
;
final
HttpResponse
.
BodySubscriber
<
String
>
wrapped
;
StringSubscriber
(
BodySubscriber
<
String
>
wrapped
)
{
StringSubscriber
(
HttpResponse
.
BodySubscriber
<
String
>
wrapped
)
{
this
.
wrapped
=
wrapped
;
}
...
...
@@ -217,39 +95,4 @@ public class GmsClientTest {
wrapped
.
onComplete
();
}
}
private
HttpResponse
getMockedResponse
(
int
statusCode
,
String
body
)
{
HttpResponse
response
=
getMockedResponse
(
statusCode
);
InputStream
in
=
new
ByteArrayInputStream
(
body
.
getBytes
(
StandardCharsets
.
UTF_8
));
when
(
response
.
body
()).
thenReturn
(
in
);
return
response
;
}
private
HttpResponse
getMockedResponse
(
int
statusCode
)
{
HttpResponse
response
=
mock
(
HttpResponse
.
class
);
when
(
response
.
statusCode
()).
thenReturn
(
statusCode
);
return
response
;
}
private
HttpRequest
endpointEq
(
String
expectedMethod
,
String
expectedEndpoint
)
{
return
ArgumentMatchers
.
argThat
(
endpointEqArgumentMatcher
(
expectedMethod
,
expectedEndpoint
));
}
private
ArgumentMatcher
<
HttpRequest
>
endpointEqArgumentMatcher
(
String
expectedMethod
,
String
expectedEndpoint
)
{
return
new
ArgumentMatcher
<
HttpRequest
>()
{
private
final
String
expectedUri
=
BASE_URL
+
"/"
+
expectedEndpoint
;
@Override
public
boolean
matches
(
HttpRequest
request
)
{
return
expectedMethod
.
equals
(
request
.
method
())
&&
expectedUri
.
equals
(
request
.
uri
().
toString
());
}
@Override
public
String
toString
()
{
return
expectedMethod
+
" "
+
expectedUri
;
}
};
}
}
Prev
1
2
3
4
5
Next