Skip to content

Commit

Permalink
chore: TRACEFOSS-617 refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mwesener committed Apr 21, 2023
1 parent cff1552 commit e91fc08
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 167 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AssetFacadeTest {
private AssetFacade assetFacade;

@Mock
AssetService assetService;
private AssetService assetService;

@Mock
private AssetRepository assetRepository;
Expand All @@ -70,15 +70,6 @@ void testGetAssetsCountryMap() {
newAsset("FRA")
);


Map<String, Long> assetMap = new HashMap<>();


for (Asset asset : assets) {
assetMap.put(asset.getManufacturingCountry(), 0L);
}


when(assetService.getAssetsCountryMap()).thenReturn(getCountryCodesWithCountOfOccurrence(assets));

// when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ private List<Asset.Descriptions> provideParentDescriptions() {
}

private Asset provideTestAsset(List<Asset.Descriptions> childDescriptions, List<Asset.Descriptions> parentDescriptions) {


String id = "urn:uuid:ceb6b964-5779-49c1-b5e9-0ee70528fcbd";
String idShort = "--";
String nameAtManufacturer = "1";
String nameAtManufacturer2 = "2";
String manufacturerPartId = "33740332-54";
String partInstanceId = "NO-297452866581906730261974";
String manufacturerId = "BPNL00000003CSGV";
Expand All @@ -135,7 +132,6 @@ private Asset provideTestAsset(List<Asset.Descriptions> childDescriptions, List<
Owner owner = Owner.CUSTOMER;
QualityType qualityType = QualityType.OK;
String van = "--";

return new Asset(id, idShort, nameAtManufacturer, manufacturerPartId, partInstanceId, manufacturerId, batchId, manufacturerName, nameAtCustomer, customerPartId, manufacturingDate, manufacturingCountry, owner, childDescriptions, parentDescriptions, false, qualityType, van);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/********************************************************************************
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

package org.eclipse.tractusx.traceability.assets.infrastructure.adapters.feign.irs;

import org.eclipse.tractusx.traceability.assets.domain.model.Asset;
Expand Down Expand Up @@ -100,7 +119,7 @@ void testFindAssetsDownward_uncompletedJob_returnsEmptyListOfAssets(Direction di

}

/* @Test
@Test
void testFindAssetsUpward_completedJob_returnsConvertedAssets() {

// Given
Expand All @@ -118,7 +137,7 @@ void testFindAssetsUpward_completedJob_returnsConvertedAssets() {
when(assetsConverter.convertAssets(jobResponse)).thenReturn(expectedAssets);

// When
List<Asset> result = irsService.findAssets("1", Direction.UPWARD);
List<Asset> result = irsService.findAssets("1", Direction.UPWARD, Aspect.upwardAspects());

// Then
assertThat(result).isEqualTo(expectedAssets);
Expand All @@ -140,13 +159,13 @@ void testFindAssetsUpward_uncompletedJob_returnsEmptyListOfAssets() {
when(jobResponse.isCompleted()).thenReturn(false);

// When
List<Asset> result = irsService.findAssets("1", Direction.UPWARD);
List<Asset> result = irsService.findAssets("1", Direction.UPWARD, Aspect.upwardAspects());

// Then
assertThat(result).isEqualTo(Collections.EMPTY_LIST);
Mockito.verify(assetsConverter, never()).convertAssets(any(JobResponse.class));

}
*/


}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
@ExtendWith(MockitoExtension.class)
class AssetEntityTest {



@Test
void testAssetIsNotUnderInvestigationWhenThereIsNoInvestigations() {
// given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/********************************************************************************
* Copyright (c) 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

package org.eclipse.tractusx.traceability.assets.infrastructure.adapters.jpa.asset;

import org.eclipse.tractusx.traceability.assets.domain.model.Asset;
Expand Down

0 comments on commit e91fc08

Please sign in to comment.