Fix NPE issues in RSQLUtility (#959)

* Fix Sonar NPE issues in RSQLUtility
* Fix RSQL test to not result in null path

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com>
This commit is contained in:
Alexander Dobler
2020-04-16 13:51:12 +02:00
committed by GitHub
parent 21a36a8bce
commit bff2c97e1f
2 changed files with 15 additions and 15 deletions

View File

@@ -239,7 +239,9 @@ public class RSQLUtilityTest {
when(baseSoftwareModuleRootMock.get(anyString())).thenReturn(baseSoftwareModuleRootMock);
when(baseSoftwareModuleRootMock.getJavaType()).thenReturn((Class) SoftwareModule.class);
when(subqueryRootMock.get(anyString())).thenReturn(mock(Path.class));
final Path pathMock = mock(Path.class);
when(pathMock.get(anyString())).thenReturn(pathMock);
when(subqueryRootMock.get(anyString())).thenReturn(pathMock);
when(criteriaBuilderMock.and(any(), any())).thenReturn(mock(Predicate.class));