Search in sources :

Example 1 with AssetIdType

use of eu.europa.ec.fisheries.wsdl.asset.types.AssetIdType in project UVMS-Docker by UnionVMS.

the class AssetHistoryRestIT method getAssetFromAssetIdAndDate.

@Test
public void getAssetFromAssetIdAndDate() throws Exception {
    try {
        Date eventDate = null;
        AssetHistoryId history = null;
        // Create asset
        Asset asset = AssetTestHelper.createCfrTestAsset();
        history = asset.getEventHistory();
        eventDate = history.getEventDate();
        Thread.sleep(1000);
        AssetIdType assetIdType = AssetIdType.CFR;
        String value = asset.getCfr();
        String type = assetIdType.value();
        Asset fetchedAsset = AssetTestHelper.getAssetFromAssetIdAndDate(type, value, eventDate);
        Assert.assertEquals(asset.getCfr(), fetchedAsset.getCfr());
    } catch (RuntimeException e) {
        System.out.println(e.toString());
    }
}
Also used : AssetIdType(eu.europa.ec.fisheries.wsdl.asset.types.AssetIdType) AssetHistoryId(eu.europa.ec.fisheries.wsdl.asset.types.AssetHistoryId) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) Date(java.util.Date) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Aggregations

AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)1 Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)1 AssetHistoryId (eu.europa.ec.fisheries.wsdl.asset.types.AssetHistoryId)1 AssetIdType (eu.europa.ec.fisheries.wsdl.asset.types.AssetIdType)1 Date (java.util.Date)1 Test (org.junit.Test)1