Skip to content
GitLab
Explore
Sign in
Sonia Zorba
vollt-private-rows-demo
Compare revisions
60d481f41a7089d551172b0c500fa6d48e24ace7 to a5e4c7388825d0104cd5bfe69888676902a3e51d
Commits on Source (2)
Fixed issue with long groups list
· 470b1f41
Sonia Zorba
authored
Dec 01, 2021
470b1f41
Set specific gradle version
· a5e4c738
Sonia Zorba
authored
Dec 01, 2021
a5e4c738
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
a5e4c738
...
...
@@ -44,7 +44,7 @@ build_vollt_base_war:
stage
:
build_base_war
tags
:
-
docker
image
:
gradle:jdk8
image
:
gradle:
6-
jdk8
only
:
refs
:
-
master
...
...
private-rows-extension/Dockerfile-build-env
View file @
a5e4c738
FROM gradle:jdk8
FROM gradle:
6-
jdk8
RUN apt-get update && apt install -y openjdk-14-jdk maven
private-rows-extension/src/main/java/it/inaf/ia2/vollt/PrivateRowsQueryExecutor.java
View file @
a5e4c738
...
...
@@ -14,11 +14,11 @@ public class PrivateRowsQueryExecutor extends QueryExecutor {
if
(
jobOwner
instanceof
CustomJobOwner
)
{
CustomJobOwner
user
=
(
CustomJobOwner
)
jobOwner
;
statement
.
execute
(
"SET my.tap_groups =
\"
{"
statement
.
execute
(
"SET my.tap_groups =
'
{"
+
String
.
join
(
","
,
user
.
getGroups
().
stream
()
.
map
(
g
->
g
.
replace
(
"'"
,
"''"
))
.
collect
(
Collectors
.
toList
()))
+
"}
\"
"
);
+
"}
'
"
);
}
return
super
.
executeQuery
(
statement
,
sql
,
jobOwner
);
...
...
private-rows-extension/src/test/java/it/inaf/ia2/vollt/PrivateRowsQueryExecutorTest.java
View file @
a5e4c738
...
...
@@ -19,11 +19,11 @@ public class PrivateRowsQueryExecutorTest {
Statement
mockedStatement
=
mock
(
Statement
.
class
);
queryExecutor
.
executeQuery
(
mockedStatement
,
""
,
user
);
verify
(
mockedStatement
).
execute
(
eq
(
"SET my.tap_groups =
\"
{group1,group2}
\"
"
));
verify
(
mockedStatement
).
execute
(
eq
(
"SET my.tap_groups =
'
{group1,group2}
'
"
));
user
=
new
CustomJobOwner
(
"anonymous"
,
Arrays
.
asList
());
queryExecutor
.
executeQuery
(
mockedStatement
,
""
,
user
);
verify
(
mockedStatement
).
execute
(
eq
(
"SET my.tap_groups =
\"{}\"
"
));
verify
(
mockedStatement
).
execute
(
eq
(
"SET my.tap_groups =
'{}'
"
));
}
}