Search in sources :

Example 1 with IllegalArgumentException

use of fi.livi.digitraffic.tie.service.IllegalArgumentException in project digitraffic-road by tmfg.

the class LocationMetadataUpdaterTest method findAndUpdateException.

@Test
public void findAndUpdateException() throws IOException {
    try {
        when(metadataFileFetcherSpy.getLatestVersions()).thenThrow(new IllegalArgumentException("TEST"));
        locationMetadataUpdater.findAndUpdate();
        fail();
    } catch (final IllegalArgumentException iae) {
        assertEquals(iae.getMessage(), "TEST");
    }
    verify(metadataFileFetcherSpy, never()).getFilePaths(any(MetadataVersions.class));
}
Also used : IllegalArgumentException(fi.livi.digitraffic.tie.service.IllegalArgumentException) Test(org.junit.jupiter.api.Test) AbstractServiceTest(fi.livi.digitraffic.tie.AbstractServiceTest)

Aggregations

AbstractServiceTest (fi.livi.digitraffic.tie.AbstractServiceTest)1 IllegalArgumentException (fi.livi.digitraffic.tie.service.IllegalArgumentException)1 Test (org.junit.jupiter.api.Test)1