Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjbaxter committed Nov 13, 2024
1 parent 3285998 commit bd25555
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ public boolean createReleaseBundle(String json) throws IOException {
log.info("Creating release bundle with JSON [{}]", json);

ArtifactoryRequest aqlRequest = new ArtifactoryRequestImpl().method(ArtifactoryRequest.Method.POST)
.apiUrl("lifecycle/api/v2/release_bundle").addQueryParam("project", "spring").addQueryParam("async", "false")
.addHeader("X-JFrog-Signing-Key-Name", "packagesKey").requestType(ArtifactoryRequest.ContentType.JSON)
.responseType(ArtifactoryRequest.ContentType.JSON).requestBody(json);
.apiUrl("lifecycle/api/v2/release_bundle").addQueryParam("project", "spring")
.addQueryParam("async", "false").addHeader("X-JFrog-Signing-Key-Name", "packagesKey")
.requestType(ArtifactoryRequest.ContentType.JSON).responseType(ArtifactoryRequest.ContentType.JSON)
.requestBody(json);
return makeArtifactoryRequest(aqlRequest);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,16 @@ private String newReferenceUrl(ProjectVersion version) {
if (version.isSnapshot()) {
antoraVersions += "-SNAPSHOT";
}
//TODO uncomment the below line and remove the logic above once Contentful "Antora Version" checkbox
// bug is fixed. Currently the checkbox is not being saved and is always unchecked when using the REST API
// and this results in the version now being computed propertly by Contentful. Therefore we compute the version
// in the documentation URL ourselves instead of using the {version} placeholder and letting Contentful compute the
// version. NOTE: Tests in {@link SaganUpdaterTests} will need to be updated as well once the fix is in place.
// TODO uncomment the below line and remove the logic above once Contentful
// "Antora Version" checkbox
// bug is fixed. Currently the checkbox is not being saved and is always unchecked
// when using the REST API
// and this results in the version now being computed propertly by Contentful.
// Therefore we compute the version
// in the documentation URL ourselves instead of using the {version} placeholder
// and letting Contentful compute the
// version. NOTE: Tests in {@link SaganUpdaterTests} will need to be updated as
// well once the fix is in place.
// return "https://docs.spring.io/" + version.projectName +
// "/reference/{version}/";
return "https://docs.spring.io/" + version.projectName + "/reference/" + antoraVersions + "/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id" : "0b389dc6-1b73-487d-8122-41f1c974647f",
"name" : "create_project_release_bundle_mapping",
"request" : {
"url" : "/lifecycle/api/v2/release_bundle?project=spring",
"url" : "/lifecycle/api/v2/release_bundle?async=false&project=spring",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"release_bundle_version\":\"4.0.7\",\"release_bundle_name\":\"TNZ-spring-cloud-build-commercial\",\"source_type\":\"aql\",\"source\":{\"aql\":\"items.find({\\\"repo\\\":{\\\"$eq\\\":\\\"spring-enterprise-maven-prod-local\\\"},\\\"$or\\\":[{\\\"path\\\":{\\\"$match\\\":\\\"org/springframework/cloud/spring-cloud-build*/4.0.7\\\"}},{\\\"path\\\":{\\\"$match\\\":\\\"org/springframework/cloud/spring-cloud-starter-build*/4.0.7\\\"}},{\\\"path\\\":{\\\"$match\\\":\\\"org/springframework/cloud/spring-cloud-dependencies-parent*/4.0.7\\\"}}]}).sort({\\\"$asc\\\":[\\\"path\\\",\\\"name\\\"]})\"}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id" : "0b389dc6-1b73-487d-8122-41f1c974647f",
"name" : "create_release_train_source_bundle_mapping",
"request" : {
"url" : "/lifecycle/api/v2/release_bundle?project=spring",
"url" : "/lifecycle/api/v2/release_bundle?async=false&project=spring",
"method" : "POST",
"bodyPatterns" : [ {
"equalToJson" : "{\"release_bundle_name\": \"TNZ-spring-cloud-commercial-release\",\"release_bundle_version\": \"2022.0.7\",\"skip_docker_manifest_resolution\": false,\"source_type\": \"release_bundles\",\"source\": {\"release_bundles\": [{\"project_key\": \"spring\",\"repository_key\": \"spring-release-bundles-v2\",\"release_bundle_name\": \"TNZ-spring-cloud-build-commercial\",\"release_bundle_version\": \"4.0.8\"},{\"project_key\": \"spring\",\"repository_key\": \"spring-release-bundles-v2\",\"release_bundle_name\": \"TNZ-spring-cloud-config-commercial\",\"release_bundle_version\": \"4.0.7\"},{\"project_key\": \"spring\",\"repository_key\": \"spring-release-bundles-v2\",\"release_bundle_name\": \"TNZ-spring-cloud-starter-commercial\",\"release_bundle_version\": \"2022.0.7\"},{\"project_key\": \"spring\",\"repository_key\": \"spring-release-bundles-v2\",\"release_bundle_name\": \"TNZ-spring-cloud-vault-commercial\",\"release_bundle_version\": \"4.0.7\"}]}}",
Expand Down

0 comments on commit bd25555

Please sign in to comment.