@@ -0,0 +1,1036 @@
+package org.lodder.subtools.multisubdownloader.lib.control.subtitles.sorting.replacers;%0A%0Aimport java.util.HashMap;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.lodder.subtools.sublibrary.model.Release;%0A%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class GroupReplacerTest %7B%0A%0A  protected GroupReplacer replacer;%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    replacer = new GroupReplacer();%0A  %7D%0A%0A  @Test%0A  public void test_it_replaces_the_keyword_group_to_a_releasename() throws Exception %7B%0A    Release release = mock(Release.class);%0A    when(release.getReleasegroup()).thenReturn(%22Acme%22);%0A%0A    HashMap%3CString, Integer%3E definedWeights = new HashMap%3C%3E();%0A    definedWeights.put(%22%25GROUP%25%22,5);%0A%0A    replacer.replace(release, definedWeights);%0A%0A    /* check if the weight there is only one weight */%0A    assertEquals(1, definedWeights.size());%0A%0A    /* check if the weight is acme */%0A    assertTrue(definedWeights.containsKey(%22acme%22));%0A  %7D%0A%7D%0A

Test GroupReplacer