Skip to content

Commit

Permalink
feature: #586 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-lcapellino committed May 3, 2024
1 parent e398a20 commit 41c7d39
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void givenAlertsForAsset_whenCallAssetById_thenReturnProperCount() throws JoseEx
@Test
void givenInvestigationsForAsset_whenCallAssetById_thenReturnProperCount() throws JoseException {
// Given

assetsSupport.defaultAssetsStored();
AssetAsBuiltEntity assetAsBuilt = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").orElseThrow();
investigationsSupport.storeInvestigationWithStatusAndAssets(CREATED, List.of(assetAsBuilt));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class AssetAsBuiltRepositoryIT extends IntegrationTestSpecification {
@Autowired
JpaAssetAsBuiltRepository jpaAssetAsBuiltRepository;

@Autowired
BpnSupport bpnSupport;

@ParameterizedTest
@MethodSource("fieldNameTestProvider")
void givenIdField_whenGetFieldValues_thenSorted(
Expand All @@ -61,7 +58,6 @@ void givenIdField_whenGetFieldValues_thenSorted(
Integer expectedSize
) {
// given
bpnSupport.providesBpdmLookup();
assetsSupport.defaultAssetsStored();

// when
Expand All @@ -76,7 +72,6 @@ void givenIdField_whenGetFieldValues_thenSorted(
@Test
void givenAssets_whenGetByImportStateIn_thenReturnProperAssets() {
// given
bpnSupport.providesBpdmLookup();
assetsSupport.defaultAssetsStored();
AssetAsBuiltEntity entityInSyncState = jpaAssetAsBuiltRepository.findById("urn:uuid:d387fa8e-603c-42bd-98c3-4d87fef8d2bb").get();
entityInSyncState.setImportState(ImportState.IN_SYNCHRONIZATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ void givenNoAssets_whenCallbackReceived_thenSaveThem_withoutManufacturerName() t
// given

bpnSupport.returnsBpdmLookup401Unauthorized();
oAuth2ApiSupport.oauth2ApiReturnsTechnicalUserToken();
irsApiSupport.irsApiReturnsJobDetails();
String jobId = "ebb79c45-7bba-4169-bf17-3e719989ab54";
String jobState = "COMPLETED";
Expand All @@ -312,7 +311,7 @@ void givenNoAssets_whenCallbackReceived_thenSaveThem_withoutManufacturerName() t
// then
assetsSupport.assertAssetAsBuiltSize(16);
assetsSupport.assertAssetAsPlannedSize(0);
String contractAgreementId = given()
String manufacturerName = given()
.header(oAuth2Support.jwtAuthorization(JwtRole.ADMIN))
.contentType(ContentType.JSON)
.log().all()
Expand All @@ -322,8 +321,8 @@ void givenNoAssets_whenCallbackReceived_thenSaveThem_withoutManufacturerName() t
.then()
.log().all()
.statusCode(200)
.extract().path("contractAgreementId");
assertThat(contractAgreementId).isNotEmpty();
.extract().path("manufacturerName");
assertThat(manufacturerName).isNull();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase;
import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.IRSResponse;
import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.factory.AssetMapperFactory;
Expand All @@ -38,7 +37,6 @@
import java.util.List;

@Component
@Slf4j
public class AssetTestData {

@Autowired
Expand All @@ -55,7 +53,6 @@ List<AssetBase> readAndConvertAssetsForTests() {
IRSResponse response = mapper.readValue(file, IRSResponse.class);
return assetMapperFactory.mapToAssetBaseList(response);
} catch (IOException e) {
log.error("unable to read and convert assets", e);
return Collections.emptyList();
}
}
Expand Down

0 comments on commit 41c7d39

Please sign in to comment.