From 80a8297a4b84eb33a0f77e9a56283e3c8fb5f929 Mon Sep 17 00:00:00 2001 From: Michal Banka Date: Mon, 14 Sep 2020 23:04:37 +0200 Subject: Fix bug throwing exception when first event is collected - Problem: When running app from jar (e.g. in docker env) ClassLoader badly interprete classpath as root of app jar, while resources are located in jar under BOOT-INF/classes/ in Spring Boot apps. - Solution: Moved file from resources to etc directory so ClassLoader isn't needed. Filepath of api_version_description.json which previously was badly resolved now is configured in collector.properties. Change-Id: I690394cc59e16c95f5902045efc3fdaf13bf9112 Signed-off-by: Michal Banka Issue-ID: DCAEGEN2-2426 --- src/test/java/org/onap/dcae/restapi/VesRestControllerTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/test/java/org/onap/dcae/restapi') diff --git a/src/test/java/org/onap/dcae/restapi/VesRestControllerTest.java b/src/test/java/org/onap/dcae/restapi/VesRestControllerTest.java index 0a03c1a4..ce7e09d3 100644 --- a/src/test/java/org/onap/dcae/restapi/VesRestControllerTest.java +++ b/src/test/java/org/onap/dcae/restapi/VesRestControllerTest.java @@ -315,9 +315,7 @@ public class VesRestControllerTest { private void configureHeadersForEventListener() { when(headerUtils.getRestApiIdentify(anyString())).thenReturn("eventListener"); - when(headerUtils.getApiVerFilePath(anyString())).thenReturn( - this.getClass().getResource("/api_version_config.json").getPath() - ); + when(applicationSettings.getApiVersionDescriptionFilepath()).thenReturn("etc/api_version_description.json"); } private void verifyThatTransformedEventWasSend(DMaaPEventPublisher eventPublisher, String eventBeforeTransformation) { -- cgit 1.2.3-korg