diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-09-02 12:42:56 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-09-02 13:38:09 +0200 |
commit | 3cbc92527ad55c2c6a42748b72e7acfb9d55b3b4 (patch) | |
tree | d6af62814762d607d98ad61a7bad17b7b605acd9 /so-cnf-adapter-application/src/main/java/org/onap | |
parent | 5730a1a4542805b9891cab4626a8196db842e411 (diff) |
Fixes after pairwise-test with bpmn-infra
Reduced scope of security bean creation
Changes in callback to make it comatible with bpmn-infra
Issue-ID: SO-3747
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I87b30b230c96115a9f84852ac731ab2ab0db50eb
Diffstat (limited to 'so-cnf-adapter-application/src/main/java/org/onap')
3 files changed, 18 insertions, 13 deletions
diff --git a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java index a569e9d..f60aa94 100644 --- a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java +++ b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/MSOCnfApplication.java @@ -20,6 +20,7 @@ package org.onap.so.adapters.cnf; +import org.onap.so.security.SoUserCredentialConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,10 +32,14 @@ import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfi import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; import org.springframework.web.client.RestTemplate; @SpringBootApplication -@ComponentScan(basePackages = {"org.onap.so.adapters.cnf", "org.onap.so.security"}) +@ComponentScan(basePackages = {"org.onap.so.adapters.cnf", "org.onap.so.security"}, + includeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, + classes = SoUserCredentialConfiguration.class), @ComponentScan.Filter(type = FilterType.REGEX, + pattern="org.onap.so.adapters.cnf")}) @EnableAutoConfiguration(exclude = {LiquibaseAutoConfiguration.class, HibernateJpaAutoConfiguration.class, DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, SecurityAutoConfiguration.class}) diff --git a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/client/SoCallbackClient.java b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/client/SoCallbackClient.java index 1deacad..2ae0532 100644 --- a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/client/SoCallbackClient.java +++ b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/client/SoCallbackClient.java @@ -43,9 +43,9 @@ public class SoCallbackClient { private HttpEntity<?> httpEntity(Object body) { HttpHeaders headers = new HttpHeaders(); List<MediaType> acceptableMediaTypes = new ArrayList<>(); - acceptableMediaTypes.add(MediaType.APPLICATION_JSON); + acceptableMediaTypes.add(MediaType.TEXT_PLAIN); headers.setAccept(acceptableMediaTypes); - headers.setContentType(MediaType.APPLICATION_JSON); + headers.setContentType(MediaType.TEXT_PLAIN); headers.setBasicAuth(credentials.getUsername(), credentials.getPassword()); return new HttpEntity<>(gson.toJson(body), headers); diff --git a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/aai/AaiCallbackResponse.java b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/aai/AaiCallbackResponse.java index 65e79ac..b6ebbb3 100644 --- a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/aai/AaiCallbackResponse.java +++ b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/model/aai/AaiCallbackResponse.java @@ -9,32 +9,32 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class AaiCallbackResponse { @JsonProperty("status") - private CompletionStatus completionStatus; + private CompletionStatus status; @JsonProperty("statusMessage") - private String message; + private String statusMessage = ""; public CompletionStatus getCompletionStatus() { - return completionStatus; + return status; } - public void setCompletionStatus(CompletionStatus completionStatus) { - this.completionStatus = completionStatus; + public void setCompletionStatus(CompletionStatus status) { + this.status = status; } public String getMessage() { - return message; + return statusMessage; } - public void setMessage(String message) { - this.message = message; + public void setMessage(String statusMessage) { + this.statusMessage = statusMessage; } @Override public String toString() { return "AaiCallbackResponse{" + - "completionStatus=" + completionStatus + - ", message='" + message + '\'' + + "status=" + status + + ", statusMessage='" + statusMessage + '\'' + '}'; } |