Getting null pointer exception on peakHourServingRadiusOf3KmsAt7Pm() test

14:12:20.433 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
14:12:20.433 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :qeatsbackend:test FAILED
14:12:21.100 [DEBUG] [TestEventLogger] 
14:12:21.100 [DEBUG] [TestEventLogger] com.crio.qeats.services.RestaurantServiceTest > normalHourServingRadiusIs5Kms() STARTED
14:12:21.110 [DEBUG] [TestEventLogger] 
14:12:21.110 [DEBUG] [TestEventLogger] com.crio.qeats.services.RestaurantServiceTest > normalHourServingRadiusIs5Kms() PASSED
14:12:21.114 [DEBUG] [TestEventLogger] 
14:12:21.114 [DEBUG] [TestEventLogger] com.crio.qeats.services.RestaurantServiceTest > peakHourServingRadiusOf3KmsAt7Pm() STARTED
14:12:21.221 [DEBUG] [TestEventLogger] 
14:12:21.221 [DEBUG] [TestEventLogger] com.crio.qeats.services.RestaurantServiceTest > peakHourServingRadiusOf3KmsAt7Pm() FAILED
14:12:21.221 [DEBUG] [TestEventLogger]     java.lang.NullPointerException
14:12:21.221 [DEBUG] [TestEventLogger]         at com.crio.qeats.services.RestaurantServiceImpl.findAllRestaurantsCloseBy(RestaurantServiceImpl.java:57)
14:12:21.221 [DEBUG] [TestEventLogger]         at com.crio.qeats.services.RestaurantServiceTest.getServingRadius(RestaurantServiceTest.java:72)
14:12:21.221 [DEBUG] [TestEventLogger]         at com.crio.qeats.services.RestaurantServiceTest.peakHourServingRadiusOf3KmsAt7Pm(RestaurantServiceTest.java:89)
14:12:21.222 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:12:21.222 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:12:21.222 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:12:21.222 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:498)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:532)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:171)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:167)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:114)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:59)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:108)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
14:12:21.222 [DEBUG] [TestEventLogger]         at java.util.ArrayList.forEach(ArrayList.java:1257)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
14:12:21.222 [DEBUG] [TestEventLogger]         at java.util.ArrayList.forEach(ArrayList.java:1257)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
14:12:21.222 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
14:12:21.222 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:12:21.223 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:12:21.223 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:12:21.223 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:498)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
14:12:21.223 [DEBUG] [TestEventLogger]         at com.sun.proxy.$Proxy2.stop(Unknown Source)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
14:12:21.223 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:12:21.223 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:12:21.223 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:12:21.223 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:498)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
14:12:21.223 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
14:12:21.223 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
14:12:21.223 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
14:12:21.223 [DEBUG] [TestEventLogger]         at java.lang.Thread.run(Thread.java:748)
14:12:21.225 [DEBUG] [TestEventLogger] 
14:12:21.225 [DEBUG] [TestEventLogger] com.crio.qeats.services.RestaurantServiceTest FAILED
14:12:21.226 [DEBUG] [TestEventLogger] 
14:12:21.226 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest STARTED
14:12:21.229 [DEBUG] [TestEventLogger] 
14:12:21.229 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest > samePositionIsZeroMetersApart() STARTED
14:12:21.233 [DEBUG] [TestEventLogger] 
14:12:21.234 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest > samePositionIsZeroMetersApart() PASSED
14:12:21.235 [DEBUG] [TestEventLogger] 
14:12:21.235 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest > test() STARTED
14:12:21.236 [DEBUG] [TestEventLogger] 
14:12:21.236 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest > test() PASSED
14:12:21.237 [DEBUG] [TestEventLogger] 
14:12:21.237 [DEBUG] [TestEventLogger] com.crio.qeats.utils.GeoUtilsTest PASSED
14:12:21.238 [DEBUG] [TestEventLogger] 
14:12:21.238 [DEBUG] [TestEventLogger] com.crio.qeats.dto.RestaurantTest STARTED
14:12:21.240 [DEBUG] [TestEventLogger] 
14:12:21.240 [DEBUG] [TestEventLogger] com.crio.qeats.dto.RestaurantTest > serializeAndDeserializeRestaurantJson() STARTED
14:12:21.273 [DEBUG] [TestEventLogger] 
14:12:21.274 [DEBUG] [TestEventLogger] com.crio.qeats.dto.RestaurantTest > serializeAndDeserializeRestaurantJson() PASSED
14:12:21.275 [DEBUG] [TestEventLogger] 
14:12:21.275 [DEBUG] [TestEventLogger] com.crio.qeats.dto.RestaurantTest PASSED
14:12:21.278 [DEBUG] [TestEventLogger] 
14:12:21.278 [DEBUG] [TestEventLogger] Gradle Test Executor 2 FAILED
14:12:21.596 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
14:12:21.596 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle Test Executor 2' finished with exit value 0 (state: SUCCEEDED)
14:12:21.597 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.12.189 completed (1 worker(s) in use)
14:12:21.597 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Dispatch org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor@73f4ad63: released lock on root.1.12.189
14:12:21.598 [QUIET] [system.out] 
14:12:21.598 [QUIET] [system.out] TEST RESULT: FAILURE
14:12:21.598 [QUIET] [system.out] TEST SUMMARY: RAN 12 TESTS, 6 SUCCEEDED, 6 FAILED, 0 SKIPPED

Hi, can you try setting a breakpoint at line 57 in the service layer implementation & see what’s happening by debugging?

Closing this topic as there is no response since last 12 hours. Please feel free to create a new topic and post this question as a reference link in the description of the new topic.