summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/config/DmiPluginConfig.java4
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java9
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java4
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java7
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java4
5 files changed, 15 insertions, 13 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/config/DmiPluginConfig.java b/src/main/java/org/onap/cps/ncmp/dmi/config/DmiPluginConfig.java
index 6106c6af..fb22b358 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/config/DmiPluginConfig.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/config/DmiPluginConfig.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
package org.onap.cps.ncmp.dmi.config;
import lombok.Getter;
-import org.springdoc.core.GroupedOpenApi;
+import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java b/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java
index 1eb9523d..11d2ae53 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/config/WebSecurityConfig.java
@@ -20,6 +20,8 @@
package org.onap.cps.ncmp.dmi.config;
+import static org.springframework.security.config.Customizer.withDefaults;
+
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@@ -77,13 +79,12 @@ public class WebSecurityConfig {
@SuppressWarnings("squid:S4502")
public SecurityFilterChain filterChain(final HttpSecurity http) throws Exception {
http
- .httpBasic()
- .and()
+ .httpBasic(withDefaults())
.authorizeRequests()
- .antMatchers(permitUris).permitAll()
+ .requestMatchers(permitUris).permitAll()
.anyRequest().authenticated()
.and()
- .csrf().disable();
+ .csrf((csrf) -> csrf.disable());
return http.build();
}
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java
index e5b08d9a..f0826a81 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,8 @@
package org.onap.cps.ncmp.dmi.service;
+import jakarta.validation.constraints.NotNull;
import java.util.List;
-import javax.validation.constraints.NotNull;
import org.onap.cps.ncmp.dmi.exception.DmiException;
import org.onap.cps.ncmp.dmi.model.DataAccessRequest;
import org.onap.cps.ncmp.dmi.model.ModuleSet;
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
index a9a13a38..6acbe09b 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2021-2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -106,7 +106,7 @@ public class DmiServiceImpl implements DmiService {
} else {
log.error("Error occurred when getting module resources from SDNC for the given cmHandle {}", cmHandle);
throw new HttpClientRequestException(
- cmHandle, responseEntity.getBody(), responseEntity.getStatusCode());
+ cmHandle, responseEntity.getBody(), (HttpStatus) responseEntity.getStatusCode());
}
}
return yangResources;
@@ -171,7 +171,8 @@ public class DmiServiceImpl implements DmiService {
if (responseEntity.getStatusCode().is2xxSuccessful()) {
return responseEntity.getBody();
} else {
- throw new HttpClientRequestException(cmHandle, responseEntity.getBody(), responseEntity.getStatusCode());
+ throw new HttpClientRequestException(cmHandle, responseEntity.getBody(),
+ (HttpStatus) responseEntity.getStatusCode());
}
}
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java b/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java
index c2a4a7ed..fd94e634 100644
--- a/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java
+++ b/src/main/java/org/onap/cps/ncmp/dmi/service/operation/SdncOperations.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2021-2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -115,7 +115,7 @@ public class SdncOperations {
}
throw new SdncException(
String.format("SDNC failed to get Modules Schema for node %s", nodeId),
- modulesResponseEntity.getStatusCode(), modulesResponseEntity.getBody());
+ (HttpStatus) modulesResponseEntity.getStatusCode(), modulesResponseEntity.getBody());
}
/**