Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): 1252 - Updated test data of irs response. #1329

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
## [UNRELEASED - DD.MM.YYYY]

### Changed
- #1252 adapt IRS example response for integration tests to reflect current state
- #1122 Fixed editing notification sendTo attribute
- #1328 Fixed semanticDataModel translation and part name within notification detail / edit view.

Expand Down
5 changes: 3 additions & 2 deletions docs/src/docs/arc42/introduction-goals/requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
* List, view and publish planned parts based on BoM AsPlanned
* Filter and search functionality on part views
* Show detailed information on manufactured parts from AAS description assets and aspects
* Uses submodels SerialPart, AssemblyPartRelationship and Batch
* List and view supplier parts (AssemblyPartRelationship) based on BoM AsBuild lifecycle
* Uses submodels SerialPart, Batch, JustInSequence and PartAsPlanned
* List and view supplier parts (SingleLevelBomAsBuilt) based on BoM AsBuilt lifecycle
* List and view customer parts (SingleLevelUsageAsBuilt) based on BoM AsBuilt lifecycle
* View parts and parts relations in a visualized parts tree
* Send and receive top-down notifications (quality investigations) along the supply chain
* Compliance with Catena-X guidelines
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import assets.importpoc.ImportResponse;
import io.restassured.http.ContentType;
import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase;
import org.eclipse.tractusx.traceability.common.security.JwtRole;
import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification;
import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport;
Expand All @@ -33,6 +34,7 @@
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;
import java.util.List;

import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -55,7 +57,6 @@ class IrsCallbackControllerIT extends IntegrationTestSpecification {
AssetAsBuiltSupportRepository assetAsBuiltSupportRepository;



@Test
void givenAssets_whenCallbackReceived_thenSaveThemAndStoreContractAgreementId() throws JoseException {
// given
Expand All @@ -80,7 +81,7 @@ void givenAssets_whenCallbackReceived_thenSaveThemAndStoreContractAgreementId()

// then
assertThat(bpnSupportRepository.findAll()).hasSize(1);
assetsSupport.assertAssetAsBuiltSize(16);
assetsSupport.assertAssetAsBuiltSize(2);
assetsSupport.assertAssetAsPlannedSize(0);

// Make the API call and store the response
Expand Down Expand Up @@ -171,12 +172,13 @@ void givenAssetExist_whenCallbackReceived_thenUpdateIt() {
.log().all()
.statusCode(200);


// then
assertThat(bpnSupportRepository.findAll()).hasSize(1);
assetsSupport.assertAssetAsBuiltSize(16);
assetsSupport.assertAssetAsBuiltSize(14);
assetsSupport.assertAssetAsPlannedSize(0);
String updatedIdShort = assetsSupport.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").getIdShort();
assertThat(updatedIdShort).isEqualTo("vehicle_hybrid_v2.asm");
String updatedIdShort = assetsSupport.findById("urn:uuid:6dafbcec-2fce-4cbb-a5a9-b3b32aa5cffc").getIdShort();
assertThat(updatedIdShort).isEqualTo("ecu.asm");
//urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb
//vehicle_hybrid_v2.asm
}
Expand Down Expand Up @@ -221,7 +223,7 @@ void givenSuccessImportJob_whenCallbackReceivedWithTombsones_thenUpdateAsBuiltAs
.contentType(ContentType.JSON)
.log().all()
.when()
.pathParam("assetId", "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a")
.pathParam("assetId", "urn:uuid:b978ad2d-be06-47ea-a578-580d9b2eca77")
.get("/api/assets/as-built/{assetId}")
.then()
.log().all()
Expand Down Expand Up @@ -304,7 +306,7 @@ void givenNoAssets_whenCallbackReceived_thenSaveThem_withoutManufacturerName() t
.statusCode(200);

// then
assetsSupport.assertAssetAsBuiltSize(16);
assetsSupport.assertAssetAsBuiltSize(2);
assetsSupport.assertAssetAsPlannedSize(0);
String manufacturerName = given()
.header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public void irsJobDetailsApiFailed() {
)
.then(
status(HttpStatus.INTERNAL_SERVER_ERROR_500),
header("Content-Type", "application/json"),
restitoProvider.jsonResponseFromFile("./stubs/irs/get/jobs/id/response_200.json")
header("Content-Type", "application/json")
);
}

Expand Down
Loading
Loading