package cz.encircled.macl;

import org.junit.Test;

/**
 * @author Vlad on 17-Nov-17.
 */
public class ConfigurationTest extends AbstractTest {

    @Test
    public void testMergeRequestValidation() {
        assertException(() -> base().setMergeRequestReplacement("wrong").valid(),
                "mergeRequestReplacement must contain token MR#");

        assertException(() -> base().setMergeRequestReplacement(null).valid(),
                "mergeRequestReplacement must contain token MR#");
    }

    private ChangelogConfiguration base() {
        return new ChangelogConfiguration().setLastTag("1.0");
    }

}

@@ -21,16 +21,41 @@
 .macl;%0A%0A
+import org.junit.Assert;%0A
 import o
@@ -523,16 +523,283 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testEmptyPatterns() %7B%0A        ChangelogConfiguration conf = base().setMergeRequestReplacePattern(null).setLastTagPattern(%22%22);%0A        Assert.assertNull(conf.mergeRequestReplacePattern);%0A        Assert.assertNull(conf.lastTagPattern);%0A    %7D%0A%0A
     priv

Add unit test