Skip to content

Commit 74da26f

Browse files
author
Jorrit Poelen
committed
refactor test; related to #182
1 parent 062efd6 commit 74da26f

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
package org.eol.globi.taxon;
22

3-
import org.apache.commons.lang.StringUtils;
3+
import org.apache.commons.lang3.StringUtils;
44
import org.junit.Ignore;
55
import org.junit.Test;
66

77
import static org.hamcrest.MatcherAssert.assertThat;
88
import static org.hamcrest.core.Is.is;
99

10-
public class CapitalizeFirstWordTest {
10+
public class CapitalizerTest {
1111

1212
@Test
1313
public void undoLowerCase() {
14-
String corrected = new CapitalizeFirstWord().suggest("homo sapiens");
14+
String corrected = Capitalizer.capitalize("homo sapiens");
1515
assertThat(corrected, is("Homo sapiens"));
1616
}
1717

1818
@Test
1919
public void undoLowerCase2() {
20-
String corrected = new CapitalizeFirstWord().suggest("io");
20+
String corrected = Capitalizer.capitalize("io");
2121
assertThat(corrected, is("Io"));
2222
}
2323

2424
@Test
2525
public void doNothing() {
26-
String corrected = new CapitalizeFirstWord().suggest("Homo Sapiens");
26+
String corrected = Capitalizer.capitalize("Homo Sapiens");
2727
assertThat(corrected, is("Homo Sapiens"));
2828
}
2929

3030
@Test(timeout = 10)
3131
public void longName() {
3232
String aLongName = "7 small acorns or other seed found in cheek pouches during preparation. Seeds are brown, pointed at one end and flattened on the other, 0.75 x 0.6cm.";
33-
String corrected = new CapitalizeFirstWord().suggest(aLongName);
33+
String corrected = Capitalizer.capitalize(aLongName);
3434
assertThat(corrected, is(aLongName));
3535
}
3636

@@ -42,23 +42,21 @@ public void capitalizeLongName() {
4242
assertThat(corrected, is(aLongName));
4343
}
4444

45-
4645
@Test(timeout = 10)
4746
public void anotherLongName() {
4847
String anotherLongName = "Acorns or found cheek pouches during preparation are brown pointed at end flattened the x cm";
4948
String corrected
50-
= new CapitalizeFirstWord()
51-
.suggest(anotherLongName);
49+
= Capitalizer.capitalize(anotherLongName);
5250
assertThat(corrected, is(anotherLongName));
5351
}
5452

5553
@Test(timeout = 10)
5654
public void yetAnotherLongName() {
5755
String anotherLongName = "Acorns or found cheek pouches during preparation are brown pointed at end flattened the x cm";
5856
String corrected
59-
= new CapitalizeFirstWord()
60-
.suggest(anotherLongName);
57+
= Capitalizer.capitalize(anotherLongName);
6158
assertThat(corrected, is(anotherLongName));
6259
}
6360

61+
6462
}

nomer/src/main/java/org/globalbioticinteractions/nomer/util/HeaderRowHandler.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.globalbioticinteractions.nomer.util;
22

3-
import org.apache.commons.lang.StringUtils;
43
import org.eol.globi.service.PropertyEnricherException;
54
import org.eol.globi.taxon.Capitalizer;
65
import org.eol.globi.taxon.RowHandler;

0 commit comments

Comments
 (0)