<java.version.target>17</java.version.target>
<gson.version>2.10.1</gson.version>
<json.version>20220924</json.version>
- <formatter-maven-plugin.version>2.13.0</formatter-maven-plugin.version>
+ <formatter-maven-plugin.version>2.13.0</formatter-maven-plugin.version>
<spotless-maven-plugin.version>1.24.3</spotless-maven-plugin.version>
<commons-io.version>2.11.0</commons-io.version>
<guava.version>31.0.1-jre</guava.version>
<springdoc.version>2.0.2</springdoc.version>
<docker-maven-plugin>0.30.0</docker-maven-plugin>
- <surefire-maven-plugin.version>3.0.0-M5</surefire-maven-plugin.version>
+ <surefire-maven-plugin.version>3.0.0-M8</surefire-maven-plugin.version>
<surefire-report-plugin.version>3.0.0-M8</surefire-report-plugin.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<ccsdk.project.version>${project.version}</ccsdk.project.version>
<configuration>
<skipTests>${allowskiptests}</skipTests>
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
- <disable>false</disable>
- <version>3.0</version>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
</statelessTestsetReporter>
<consoleOutputReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5ConsoleOutputReporter">
- <disable>false</disable>
- <encoding>UTF-8</encoding>
<usePhrasedFileName>false</usePhrasedFileName>
</consoleOutputReporter>
<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoReporter">
- <disable>false</disable>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedClassNameInRunning>true</usePhrasedClassNameInRunning>
<usePhrasedClassNameInTestCaseSummary>true</usePhrasedClassNameInTestCaseSummary>
import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
@Schema(name = "service_callback_info_v2",
description = "Information transferred as in Service callbacks (callback_url)")
AVAILABLE
}
- @Schema(name = "ric_id", description = "identity of a Near-RT RIC", required = true)
+ @Schema(name = "ric_id", description = "identity of a Near-RT RIC", requiredMode = RequiredMode.REQUIRED)
@SerializedName("ric_id")
@JsonProperty(value = "ric_id", required = true)
public String ricId;
- @Schema(name = "event_type", description = EVENT_TYPE_DESCRIPTION, required = true)
+ @Schema(name = "event_type", description = EVENT_TYPE_DESCRIPTION, requiredMode = RequiredMode.REQUIRED)
@SerializedName("event_type")
@JsonProperty(value = "event_type", required = true)
public EventType eventType;
import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
@Schema(name = "policy_info_v2", description = "Information for one A1-P Policy")
public class PolicyInfo {
- @Schema(name = "policy_id", description = "identity of the policy", required = true)
+ @Schema(name = "policy_id", description = "identity of the policy", requiredMode = RequiredMode.REQUIRED)
@JsonProperty(value = "policy_id", required = true)
@SerializedName("policy_id")
public String policyId;
- @Schema(name = "policytype_id", description = "identity of the policy type", required = true)
+ @Schema(name = "policytype_id", description = "identity of the policy type", requiredMode = RequiredMode.REQUIRED)
@JsonProperty(value = "policytype_id", required = true)
@SerializedName("policytype_id")
public String policyTypeId;
- @Schema(name = "ric_id", description = "identity of the target Near-RT RIC", required = true)
+ @Schema(name = "ric_id", description = "identity of the target Near-RT RIC", requiredMode = RequiredMode.REQUIRED)
@JsonProperty(value = "ric_id", required = true)
@SerializedName("ric_id")
public String ricId;
- @Schema(name = "policy_data", description = "the configuration of the policy", required = true)
+ @Schema(name = "policy_data", description = "the configuration of the policy", requiredMode = RequiredMode.REQUIRED)
@JsonProperty(value = "policy_data", required = true)
@SerializedName("policy_data")
public Object policyData;
private static final String SERVICE_ID_DESCRIPTION = "the identity of the service owning the policy."
+ " This can be used to group the policies (it is possible to get all policies associated to a service)."
- + " Note that the service does not need to be registerred.";
+ + " Note that the service does not need to be registered.";
- @Schema(name = "service_id", description = SERVICE_ID_DESCRIPTION, required = false, defaultValue = "")
+ @Schema(name = "service_id", description = SERVICE_ID_DESCRIPTION, requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "")
@JsonProperty(value = "service_id", required = false)
@SerializedName("service_id")
public String serviceId = "";
@Schema(name = "transient",
description = "if true, the policy is deleted at RIC restart. If false, its value is maintained by this service until explicitly deleted. Default false.",
- required = false, defaultValue = "false", example = "false")
+ requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "false", example = "false")
@JsonProperty(value = "transient", required = false, defaultValue = "false")
@SerializedName("transient")
public boolean isTransient = false;
- @Schema(name = "status_notification_uri", description = "Callback URI for policy status updates", required = false,
+ @Schema(name = "status_notification_uri", description = "Callback URI for policy status updates", requiredMode = RequiredMode.NOT_REQUIRED,
defaultValue = "")
@JsonProperty(value = "status_notification_uri", required = false)
@SerializedName("status_notification_uri")
UNAVAILABLE, AVAILABLE, SYNCHRONIZING, CONSISTENCY_CHECK
}
- private static final String STATE_DESCRIPTION = "State for the Near-RT RIC, values: \n"
- + "UNAVAILABLE: The Near-RT RIC is not avialable, information may be inconsistent \n"
- + "AVAILABLE: The normal state. Policies can be configured. +\n"
- + "SYNCHRONIZING: The Policy Management Service is synchronizing the view of the Near-RT RIC. Policies cannot be configured. \n"
- + "CONSISTENCY_CHECK: A consistency check between the Policy Management Service and the Near-RT RIC. Policies cannot be configured.";
+ private static final String STATE_DESCRIPTION = """
+ State for the Near-RT RIC, values:
+ UNAVAILABLE: The Near-RT RIC is not available, information may be inconsistent
+ AVAILABLE: The normal state. Policies can be configured.
+ SYNCHRONIZING: The Policy Management Service is synchronizing the view of the Near-RT RIC. Policies cannot be configured.
+ CONSISTENCY_CHECK: A consistency check between the Policy Management Service and the Near-RT RIC. Policies cannot be configured.""";
@Schema(description = "identity of the Near-RT RIC")
@SerializedName("ric_id")
import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
+
@Schema(name = "service_registration_info_v2", description = "Information for one service")
public class ServiceRegistrationInfo {
- @Schema(description = "identity of the service", required = true)
+ @Schema(description = "identity of the service", requiredMode = RequiredMode.REQUIRED)
@SerializedName("service_id")
@JsonProperty("service_id")
public String serviceId = "";
@JsonProperty("keep_alive_interval_seconds")
public long keepAliveIntervalSeconds = 0;
- @Schema(description = "callback for notifying of Near-RT RIC state changes", required = false, defaultValue = "")
+ @Schema(description = "callback for notifying of Near-RT RIC state changes", requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "")
@SerializedName("callback_url")
@JsonProperty("callback_url")
public String callbackUrl = "";
@ControllerAdvice(annotations = RestController.class)
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
- private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ private static final Logger loggerx = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@ExceptionHandler(ServiceException.class)
public final ResponseEntity<Object> handleServiceException(ServiceException ex) {
@ExceptionHandler(RuntimeException.class)
public final ResponseEntity<Object> handleRuntimeException(RuntimeException ex) {
- logger.error("Runtime exception {}", ex.getMessage());
+ loggerx.error("Runtime exception {}", ex.getMessage());
return ErrorResponse.create(ex, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics;
@ExtendWith(MockitoExtension.class)
-public class MetersTest {
+class MetersTest {
private static final String POLICY_TYPE_1_NAME = "type1";
private static final PolicyType POLICY_TYPE_1 = PolicyType.builder().id(POLICY_TYPE_1_NAME).schema("").build();
verify(refreshTaskUnderTest.rics, times(2)).put(any(Ric.class));
java.util.Collection<RicConfig> ricConfigs = appConfig.getRicConfigs();
- assertThat(ricConfigs).isNotNull();
- assertThat(ricConfigs).hasSize(2);
+ assertThat(ricConfigs)
+ .isNotNull()
+ .hasSize(2);
}
@Test