Ignore:
Timestamp:
2021-12-20T17:33:27+01:00 (3 years ago)
Author:
Don-vip
Message:

see #21655 - update unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java

    r18037 r18344  
    1414import javax.swing.JDialog;
    1515
     16import org.junit.jupiter.api.Test;
    1617import org.openstreetmap.josm.TestUtils;
    1718import org.openstreetmap.josm.data.osm.Changeset;
     
    3334import mockit.Mock;
    3435import mockit.MockUp;
    35 import org.junit.jupiter.api.Test;
    3636
    3737/**
     
    137137        }
    138138
    139         DownloadSelectedChangesetContentAction action = new DownloadSelectedChangesetContentAction(ChangesetCacheManager.buildModel());
     139        DownloadSelectedChangesetContentAction action = new DownloadSelectedChangesetContentAction(buildModel());
    140140        action.valueChanged(null);
    141141        action.actionPerformed(new ActionEvent(new JDialog().getComponent(0), ActionEvent.ACTION_PERFORMED, "foo"));
     
    153153        }
    154154
    155         DownloadSelectedChangesetsAction action = new DownloadSelectedChangesetsAction(ChangesetCacheManager.buildModel());
     155        DownloadSelectedChangesetsAction action = new DownloadSelectedChangesetsAction(buildModel());
    156156        action.valueChanged(null);
    157157        action.actionPerformed(new ActionEvent(new JDialog().getComponent(0), ActionEvent.ACTION_PERFORMED, "foo"));
     
    208208    @Test
    209209    void testRemoveFromCacheAction() {
    210         RemoveFromCacheAction action = new RemoveFromCacheAction(ChangesetCacheManager.buildModel());
     210        RemoveFromCacheAction action = new RemoveFromCacheAction(buildModel());
    211211        action.valueChanged(null);
    212212        action.actionPerformed(null);
     
    218218    @Test
    219219    void testShowDetailAction() {
    220         new ShowDetailAction(ChangesetCacheManager.buildModel()).actionPerformed(null);
     220        new ShowDetailAction(buildModel()).actionPerformed(null);
     221    }
     222
     223    private static ChangesetCacheManagerModel buildModel() {
     224        ChangesetCacheManagerModel model = ChangesetCacheManager.buildModel();
     225        model.setChangesetCacheTableRowSorter(new ChangesetCacheTableRowSorter(model));
     226        return model;
    221227    }
    222228}
Note: See TracChangeset for help on using the changeset viewer.