Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Partition
Commits
750e0211
Commit
750e0211
authored
Jan 08, 2021
by
Alok Joshi
Committed by
ethiraj krishnamanaidu
Jan 08, 2021
Browse files
fix list api cache not updating upon creation and deletion
parent
70835dc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
partition-core/src/main/java/org/opengroup/osdu/partition/service/CachedPartitionServiceImpl.java
View file @
750e0211
...
...
@@ -50,6 +50,7 @@ public class CachedPartitionServiceImpl implements IPartitionService {
if
(
pi
!=
null
)
{
partitionServiceCache
.
put
(
partitionId
,
partitionInfo
);
partitionListCache
.
clearAll
();
}
return
pi
;
...
...
@@ -86,6 +87,7 @@ public class CachedPartitionServiceImpl implements IPartitionService {
if
(
partitionService
.
deletePartition
(
partitionId
))
{
if
(
partitionServiceCache
.
get
(
partitionId
)
!=
null
)
{
partitionServiceCache
.
delete
(
partitionId
);
partitionListCache
.
clearAll
();
}
return
true
;
...
...
partition-core/src/test/java/org/opengroup/osdu/partition/service/CachedPartitionServiceImplTest.java
View file @
750e0211
...
...
@@ -52,11 +52,11 @@ public class CachedPartitionServiceImplTest {
PartitionInfo
retPi
=
PartitionInfo
.
builder
().
build
();
when
(
partitionServiceImpl
.
createPartition
(
partId
,
newPi
)).
thenReturn
(
retPi
);
cachedPartitionServiceImpl
.
createPartition
(
partId
,
newPi
);
verify
(
partitionServiceImpl
,
times
(
1
)).
createPartition
(
partId
,
newPi
);
verify
(
partitionServiceCache
,
times
(
1
)).
put
(
partId
,
retPi
);
verify
(
partitionListCache
,
times
(
1
)).
clearAll
();
}
@Test
...
...
@@ -71,6 +71,7 @@ public class CachedPartitionServiceImplTest {
verify
(
partitionServiceImpl
,
times
(
1
)).
createPartition
(
partId
,
newPi
);
verify
(
partitionServiceCache
,
times
(
0
)).
put
(
any
(),
any
());
verify
(
partitionListCache
,
times
(
0
)).
clearAll
();
verify
(
partitionServiceCache
,
times
(
1
)).
get
(
any
());
}
...
...
@@ -131,6 +132,7 @@ public class CachedPartitionServiceImplTest {
verify
(
partitionServiceImpl
,
times
(
1
)).
deletePartition
(
partId
);
verify
(
partitionServiceCache
,
times
(
1
)).
delete
(
partId
);
verify
(
partitionServiceCache
,
times
(
1
)).
get
(
partId
);
verify
(
partitionListCache
,
times
(
1
)).
clearAll
();
}
@Test
...
...
Write
Preview
Supports
Markdown
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