From 862ab86b786e5aa8cdc5bcccc097cb0799a1549a Mon Sep 17 00:00:00 2001 From: Andrea Tabone Date: Mon, 10 Feb 2025 18:14:57 +0100 Subject: [PATCH] fix sonar Signed-off-by: Andrea Tabone --- .../controllers/api/ApiCatalogControllerTests.java | 8 ++++---- api-catalog-ui/frontend/src/actions/user-actions.jsx | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api-catalog-services/src/test/java/org/zowe/apiml/apicatalog/controllers/api/ApiCatalogControllerTests.java b/api-catalog-services/src/test/java/org/zowe/apiml/apicatalog/controllers/api/ApiCatalogControllerTests.java index 21df93eb92..b008329481 100644 --- a/api-catalog-services/src/test/java/org/zowe/apiml/apicatalog/controllers/api/ApiCatalogControllerTests.java +++ b/api-catalog-services/src/test/java/org/zowe/apiml/apicatalog/controllers/api/ApiCatalogControllerTests.java @@ -226,10 +226,10 @@ void thenReturnOk() throws ContainerStatusRetrievalThrowable { given(cachedApiDocService.getDefaultApiDocForService(serviceId)).willReturn("mockApiDoc"); ResponseEntity apiServicesById = underTest.getAPIServicesById(serviceId); - assertEquals(apiServicesById.getStatusCode(), HttpStatus.OK); + assertEquals(HttpStatus.OK, apiServicesById.getStatusCode()); assertNotNull(apiServicesById.getBody()); - assertEquals(apiServicesById.getBody().getApiDoc(), "mockApiDoc"); - assertEquals(apiServicesById.getBody().getDefaultApiVersion(), "v1"); + assertEquals( "mockApiDoc", apiServicesById.getBody().getApiDoc()); + assertEquals("v1", apiServicesById.getBody().getDefaultApiVersion()); } @Test @@ -244,7 +244,7 @@ void thenReturnOkWithApiDocNull() throws ContainerStatusRetrievalThrowable { given(cachedApiDocService.getDefaultApiDocForService(serviceId)).willReturn(null); ResponseEntity apiServicesById = underTest.getAPIServicesById(serviceId); - assertEquals(apiServicesById.getStatusCode(), HttpStatus.OK); + assertEquals(HttpStatus.OK, apiServicesById.getStatusCode()); assertNotNull(apiServicesById.getBody()); assertNull(apiServicesById.getBody().getApiDoc()); } diff --git a/api-catalog-ui/frontend/src/actions/user-actions.jsx b/api-catalog-ui/frontend/src/actions/user-actions.jsx index 513f95332b..0f885c2602 100644 --- a/api-catalog-ui/frontend/src/actions/user-actions.jsx +++ b/api-catalog-ui/frontend/src/actions/user-actions.jsx @@ -40,7 +40,6 @@ function login(credentials) { if (credentials.newPassword) { showUpdatePassSuccess = true; } - const dashBoardPath = '/dashboard'; localStorage.setItem('username', credentials.username); dispatch(success(token, showUpdatePassSuccess)); },