Changeset 17523 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2021-02-22T12:27:24+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #20519 - NPE in Upload Dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java

    r17275 r17523  
    2020import org.junit.jupiter.api.extension.RegisterExtension;
    2121import org.openstreetmap.josm.TestUtils;
     22import org.openstreetmap.josm.data.osm.DataSet;
    2223import org.openstreetmap.josm.gui.io.UploadDialog.UploadAction;
    2324import org.openstreetmap.josm.io.UploadStrategySpecification;
     
    195196        doTestValidateUploadTag("upload.source");
    196197    }
     198
     199    @Test
     200    void testGetCommentWithDataSetHashTag() {
     201        assertEquals("", UploadDialog.getCommentWithDataSetHashTag(null, null));
     202        DataSet ds = new DataSet();
     203        assertEquals("foo", UploadDialog.getCommentWithDataSetHashTag("foo", ds));
     204        ds.getChangeSetTags().put("hashtags", "bar");
     205        assertEquals("foo #bar", UploadDialog.getCommentWithDataSetHashTag("foo", ds));
     206        ds.getChangeSetTags().put("hashtags", "bar;baz;#bar");
     207        assertEquals("foo #bar #baz", UploadDialog.getCommentWithDataSetHashTag("foo", ds));
     208    }
    197209}
Note: See TracChangeset for help on using the changeset viewer.