import static org.awaitility.Awaitility.await;
import static org.hamcrest.CoreMatchers.equalTo;
-@TestMethodOrder(MethodOrderer.MethodName.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = { //
"server.ssl.key-store=./config/keystore.jks", //
"app.vardata-directory=./target", //
"app.config-file-schema-path=/application_configuration_schema.json" //
})
-class ConfigurationControllerTestV3 {
+class ConfigurationControllerV3Test {
@Autowired
ApplicationContext context;
"app.filepath=", //
"app.s3.bucket=" // If this is set, S3 will be used to store data.
})
-public class PolicyControllerTestV3 {
+class PolicyControllerV3Test {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@Autowired
Mono<ResponseEntity<String>> responseMono = testHelper.restClientV3().postForEntity(url, policyBody);
testHelper.testSuccessResponse(responseMono, HttpStatus.CREATED, responseBody ->
responseBody.contains("{\"scope\":{\"ueId\":\"ue5100\",\"qosId\":\"qos5100\"},\"qosObjectives\":{\"priorityLevel\":5100.0}}"));
- testHelper.testSuccessHeader(responseMono, "location", headerValue -> headerValue.contains("https://localhost:" + port + "/a1policymanagement/v1/policies/"));
+ testHelper.testSuccessHeader(responseMono, "location", headerValue -> headerValue.contains("https://localhost:" + port + "/a1-policy-management/v1/policies/"));
}
@Test
testHelper.addPolicyType(policyTypeName, nonRtRicId);
String policyBody = testHelper.postPolicyBody(nonRtRicId, policyTypeName, "1");
Mono<ResponseEntity<String>> responseMono = testHelper.restClientV3().postForEntity(url, policyBody);
- testHelper.testSuccessHeader(responseMono, "location", headerValue -> headerValue.contains("https://localhost:" + port + "/a1policymanagement/v1/policies/1"));
+ testHelper.testSuccessHeader(responseMono, "location", headerValue -> headerValue.contains("https://localhost:" + port + "/a1-policy-management/v1/policies/1"));
}
@Test
- @DisplayName("test Create Policy with exisitng policy id")
+ @DisplayName("test Create Policy with existing policy id")
void testPostPolicyWithExistingPolicyID() throws Exception {
String nonRtRicId = "ric.1";
String policyTypeName = "type1_1.2.3";
String policyTypeName = "type1_1.2.3";
String nonRtRicId = "ricOne";
testHelper.addPolicyType(policyTypeName, nonRtRicId);
- Mono<ResponseEntity<String>> responseMono = testHelper.restClientV3().getForEntity("/policytypes" + "?nearRtRicId=\"noRic\"");
+ Mono<ResponseEntity<String>> responseMono = testHelper.restClientV3().getForEntity("/policy-types" + "?nearRtRicId=\"noRic\"");
testHelper.testErrorCode(responseMono, HttpStatus.NOT_FOUND, "Near-RT RIC not Found using ID:");
}
"app.webclient.trust-store=./config/truststore.jks", //
"app.webclient.trust-store-used=true", //
"app.vardata-directory=/tmp/pmstestv3", //a
- "app.filepath=", //
"app.s3.bucket=" // If this is set, S3 will be used to store data.
})
-public class RicRepositoryControllerTestV3 {
+class RicRepositoryControllerV3Test {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@BeforeEach
void init() {
testHelper.port = port;
+ rics.clear();
this.applicationConfig.setAuthProviderUrl(testHelper.baseUrl() + OpenPolicyAgentSimulatorController.ACCESS_CONTROL_URL);
}
testHelper.addPolicyType("2", "ricAddedTwo");
Mono<ResponseEntity<String>> responseEntityMono = testHelper.restClientV3().getForEntity("/rics");
testHelper.testSuccessResponse(responseEntityMono, HttpStatus.OK, responseBody -> responseBody
- .contains("{\"rics\":[{\"ricId\":\"ricAddedTwo\",\"managedElementIds\":[],\"state\":\"AVAILABLE\"," +
+ .contains("{\"ricId\":\"ricAddedTwo\",\"managedElementIds\":[],\"state\":\"AVAILABLE\"," +
"\"policyTypeIds\":[\"2\"]},{\"ricId\":\"ricAddedOne\",\"managedElementIds\":[]," +
- "\"state\":\"AVAILABLE\",\"policyTypeIds\":[\"1\"]}]}"));
+ "\"state\":\"AVAILABLE\",\"policyTypeIds\":[\"1\"]"));
}
}
+