Skip to content

Commit 0f6319c

Browse files
committed
The 2 enum values EmailAddressParsingResultType DEPARTMENT and TECHNICAL have been merged into FUNCTIONAL. Also added test case.
1 parent 5b372cd commit 0f6319c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/main/java/org/nameapi/client/services/email/emailnameparser/EmailAddressParsingResultType.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,10 @@
77
public enum EmailAddressParsingResultType {
88

99
/**
10-
* The email address belongs to a department, such as [email protected].
10+
* The email address belongs to a department (eg [email protected]) or is
11+
* technical (eg [email protected]).
1112
*/
12-
DEPARTMENT,
13-
14-
/**
15-
* It is a technical email address for the domain, such as [email protected].
16-
*
17-
*/
18-
TECHNICAL,
13+
FUNCTIONAL,
1914

2015
/**
2116
* The email address contains a person's initials such as [email protected].

src/test/functional/java/org/nameapi/client/services/email/emailnameparser/EmailNameParserCommandTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ public class EmailNameParserCommandTest {
1515
private final CommandExecutor executor = NameApiRemoteExecutors.get();
1616

1717
@Test
18-
public void testCall() throws Exception {
18+
public void testParse_John_Doe() throws Exception {
1919
EmailNameParserCommand command = new EmailNameParserCommand();
2020
Mode mode = FunctionalTestsNameApiModeFactory.functionalTest();
2121
EmailNameParserResult result = executor.execute(command, mode, "[email protected]").get();
2222
assertEquals(result.getResultType(), EmailAddressParsingResultType.PERSON_NAME);
2323
assertEquals(result.getBestNameMatch().get().getGivenNames().get(0).getName(), "john");
2424
assertEquals(result.getBestNameMatch().get().getSurnames().get(0).getName(), "doe");
2525
}
26+
27+
@Test
28+
public void testParse_webmaster() throws Exception {
29+
EmailNameParserCommand command = new EmailNameParserCommand();
30+
Mode mode = FunctionalTestsNameApiModeFactory.functionalTest();
31+
EmailNameParserResult result = executor.execute(command, mode, "[email protected]").get();
32+
assertEquals(result.getResultType(), EmailAddressParsingResultType.FUNCTIONAL);
33+
}
34+
2635
}

0 commit comments

Comments
 (0)