use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-Docker by UnionVMS.
the class AssetJMSIT method testGetAssetByIRCS.
@Test
public void testGetAssetByIRCS() throws Exception {
Asset asset = AssetTestHelper.createTestAsset();
Asset assetById = AssetJMSHelper.getAssetById(asset.getIrcs(), AssetIdType.IRCS);
setDecimalScaleAndNullNotes(assetById);
assertEquals(asset, assetById);
}
use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-Docker by UnionVMS.
the class AssetJMSIT method getAssetGroupByAssetGuidTest.
@Test
public void getAssetGroupByAssetGuidTest() throws Exception {
AssetGroup assetGroup = AssetTestHelper.createBasicAssetGroup();
Asset asset1 = AssetTestHelper.createTestAsset();
// Add asset to group
AssetGroupSearchField assetGroupSearchField1 = new AssetGroupSearchField();
assetGroupSearchField1.setKey(ConfigSearchField.GUID);
assetGroupSearchField1.setValue(asset1.getAssetId().getGuid());
assetGroup.getSearchFields().add(assetGroupSearchField1);
// Create Group
assetGroup = AssetTestHelper.createAssetGroup(assetGroup);
List<AssetGroup> assetGroups = AssetJMSHelper.getAssetGroupListByAssetGuid(asset1.getAssetId().getGuid());
assertTrue(assetGroups.contains(assetGroup));
}
use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-Docker by UnionVMS.
the class AssetRestIT method getAssetListTest.
/**
* Gets the asset list test.
*
* @return the asset list test
* @throws Exception
* the exception
*/
@Test
public void getAssetListTest() throws Exception {
Asset asset = AssetTestHelper.createTestAsset();
AssetListQuery assetListQuery = AssetTestHelper.getBasicAssetQuery();
AssetListCriteriaPair assetListCriteriaPair = new AssetListCriteriaPair();
assetListCriteriaPair.setKey(ConfigSearchField.FLAG_STATE);
assetListCriteriaPair.setValue(asset.getCountryCode());
assetListQuery.getAssetSearchCriteria().getCriterias().add(assetListCriteriaPair);
ListAssetResponse assetListResponse = AssetTestHelper.assetListQuery(assetListQuery);
List<Asset> assets = assetListResponse.getAsset();
assertTrue(assets.contains(asset));
}
use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-Docker by UnionVMS.
the class AssetRestIT method createAssetAuditLogCreatedTest.
@Test
public void createAssetAuditLogCreatedTest() throws Exception {
Date fromDate = DateUtils.getNowDateUTC();
Asset asset = AssetTestHelper.createTestAsset();
AssetTestHelper.assertAssetAuditLogCreated(asset.getAssetId().getGuid(), AuditOperationEnum.CREATE, fromDate);
}
use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-Docker by UnionVMS.
the class AssetRestIT method getAssetListWithLikeSearchValue_CHANGE_KEY_AND_FAIL.
@Test
public void getAssetListWithLikeSearchValue_CHANGE_KEY_AND_FAIL() throws Exception {
Asset asset = AssetTestHelper.createTestAsset();
String guid = asset.getAssetId().getGuid();
String theValue = UUID.randomUUID().toString();
String newName = asset.getName() + "Changed";
asset.setName(newName);
asset.setIccat(theValue);
AssetTestHelper.updateAsset(asset);
AssetListQuery assetListQuery = AssetTestHelper.getBasicAssetQuery();
AssetListCriteriaPair assetListCriteriaPair_ICCAT = new AssetListCriteriaPair();
assetListCriteriaPair_ICCAT.setKey(ConfigSearchField.ICCAT);
assetListCriteriaPair_ICCAT.setValue(theValue);
AssetListCriteriaPair assetListCriteriaPair_UUID = new AssetListCriteriaPair();
assetListCriteriaPair_UUID.setKey(ConfigSearchField.GUID);
assetListCriteriaPair_UUID.setValue(guid);
assetListQuery.getAssetSearchCriteria().getCriterias().add(assetListCriteriaPair_ICCAT);
assetListQuery.getAssetSearchCriteria().getCriterias().add(assetListCriteriaPair_UUID);
ListAssetResponse listAssetResponse = AssetTestHelper.assetListQuery(assetListQuery);
List<Asset> fetchedAsssets = listAssetResponse.getAsset();
assertFalse(fetchedAsssets.contains(asset));
}
Aggregations