Skip to content

Commit 3d56b6b

Browse files
author
Jenkins
committed
Version: 6.0.0 (2023-10-12-10:02:41)
1 parent 615c37e commit 3d56b6b

File tree

3 files changed

+59
-30
lines changed

3 files changed

+59
-30
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There are functional tests that demonstrate how to use this library.
77

88
All you need to send requests is your own api key which you can get from nameapi.org.
99

10-
This library requires at least Java 8.
10+
This library requires at least Java 17 starting from version 6.0.0 (use a previous version for Java 8).
1111

1212

1313

@@ -18,12 +18,12 @@ Using Maven:
1818
<dependency>
1919
<groupId>org.nameapi.client</groupId>
2020
<artifactId>nameapi-client</artifactId>
21-
<version>5.4.1</version>
21+
<version>6.0.0</version>
2222
</dependency>
2323

2424
Or Gradle:
2525

26-
implementation 'org.nameapi.client:nameapi-client:5.4.1'
26+
implementation 'org.nameapi.client:nameapi-client:6.0.0'
2727

2828
Also you could download the jar, or check out the source code from this GitHub project.
2929

@@ -195,7 +195,6 @@ PersonNameFormatterArgument argument = new PersonNameFormatterArgument(person, p
195195
FormatterResult formatterResult = executor.execute(command, mode, argument).get();
196196
```
197197

198-
199198
## Risk Detector
200199

201200
Detects various types of possibly fake data in person records.
@@ -226,6 +225,7 @@ RiskDetectorResult result = executor.execute(command, mode, person).get();
226225
```
227226

228227

228+
229229
## Email Name Parser
230230

231231
The Email Name Parser extracts names out of email addresses.

pom.xml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>org.nameapi.client</groupId>
66
<artifactId>nameapi-client</artifactId>
77
<name>nameapi-client</name>
8-
<version>5.4.2</version>
8+
<version>6.0.0</version>
99

1010
<url>https://github.com/optimaize/nameapi-client-java</url>
1111
<description>
@@ -39,11 +39,10 @@
3939

4040
<properties>
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42-
<java.version>1.8</java.version>
43-
<anythingworks.version>1.1.0</anythingworks.version>
44-
<ontology.version>5.4.2</ontology.version>
42+
<java.version>17</java.version>
43+
<anythingworks.version>2.1.0</anythingworks.version>
44+
<ontology.version>5.8.0</ontology.version>
4545
<swagger-annotations-version>1.5.4</swagger-annotations-version>
46-
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
4746
<repo-base-url>https://repo1.maven.org</repo-base-url>
4847
</properties>
4948

@@ -78,7 +77,7 @@
7877
<plugin>
7978
<groupId>org.apache.maven.plugins</groupId>
8079
<artifactId>maven-compiler-plugin</artifactId>
81-
<version>3.5.1</version>
80+
<version>3.11.0</version>
8281
<configuration>
8382
<source>${java.version}</source>
8483
<target>${java.version}</target>
@@ -88,7 +87,7 @@
8887
<plugin>
8988
<groupId>org.apache.maven.plugins</groupId>
9089
<artifactId>maven-source-plugin</artifactId>
91-
<version>3.0.0</version>
90+
<version>3.3.0</version>
9291
<executions>
9392
<execution>
9493
<id>attach-sources</id>
@@ -104,7 +103,10 @@
104103
<plugin>
105104
<groupId>org.apache.maven.plugins</groupId>
106105
<artifactId>maven-javadoc-plugin</artifactId>
107-
<version>2.9.1</version>
106+
<version>3.6.0</version>
107+
<configuration>
108+
<doclint>none</doclint>
109+
</configuration>
108110
<executions>
109111
<execution>
110112
<id>attach-javadoc</id>
@@ -119,7 +121,7 @@
119121
<plugin>
120122
<groupId>org.apache.maven.plugins</groupId>
121123
<artifactId>maven-release-plugin</artifactId>
122-
<version>2.4.1</version>
124+
<version>3.0.1</version>
123125
<configuration>
124126
<!-- Automated passphrase entry: -->
125127

@@ -137,6 +139,16 @@
137139
<mavenExecutorId>forked-path</mavenExecutorId>
138140
</configuration>
139141
</plugin>
142+
143+
<plugin>
144+
<groupId>org.apache.maven.plugins</groupId>
145+
<artifactId>maven-surefire-plugin</artifactId>
146+
<version>3.1.2</version>
147+
<configuration>
148+
<!-- see https://redmine.nameprofiler.com/issues/20476-->
149+
<skipTests>true</skipTests>
150+
</configuration>
151+
</plugin>
140152
</plugins>
141153
</build>
142154

@@ -151,18 +163,6 @@
151163
</build>
152164
</profile>
153165

154-
<profile>
155-
<!-- make the build work with Java7 and Java8 out of the box, see
156-
https://stackoverflow.com/questions/22528767/how-to-work-around-the-stricter-java-8-javadoc-when-using-maven -->
157-
<id>disable-java8-doclint</id>
158-
<activation>
159-
<jdk>[1.8,)</jdk>
160-
</activation>
161-
<properties>
162-
<additionalparam>-Xdoclint:none</additionalparam>
163-
</properties>
164-
</profile>
165-
166166
<profile>
167167
<id>release-sign-artifacts</id>
168168
<activation>
@@ -177,7 +177,7 @@
177177
<plugin>
178178
<groupId>org.sonatype.plugins</groupId>
179179
<artifactId>nexus-staging-maven-plugin</artifactId>
180-
<version>1.6.7</version>
180+
<version>1.6.13</version>
181181
<extensions>true</extensions>
182182
<configuration>
183183
<serverId>ossrh</serverId>
@@ -188,7 +188,7 @@
188188
<plugin>
189189
<groupId>org.apache.maven.plugins</groupId>
190190
<artifactId>maven-gpg-plugin</artifactId>
191-
<version>${maven-gpg-plugin.version}</version>
191+
<version>3.1.0</version>
192192
<!--<configuration>-->
193193
<!--<passphrase>${gpg.passphrase}</passphrase>-->
194194
<!--</configuration>-->
@@ -358,14 +358,13 @@
358358
<dependency>
359359
<groupId>org.testng</groupId>
360360
<artifactId>testng</artifactId>
361-
<!-- updated on 2015-11-04 -->
362-
<version>6.9.9</version>
361+
<version>7.8.0</version>
363362
<scope>test</scope>
364363
</dependency>
365364
<dependency>
366365
<groupId>ch.qos.logback</groupId>
367366
<artifactId>logback-classic</artifactId>
368-
<version>1.1.3</version>
367+
<version>1.4.11</version>
369368
<scope>test</scope>
370369
</dependency>
371370
</dependencies>

src/test/java/org/nameapi/client/services/riskdetector/person/PersonRiskDetectorCommandTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,36 @@ protected Object[][] fullnames_ok() {
117117
};
118118
}
119119

120+
@Test(dataProvider = "allFields_risk")
121+
public void allFields_risk(String gn, String sn, String email, String telephone,
122+
String postalCode, String placeName, String streetName, String houseNumber,
123+
int numberOfRisks, DataItem dataItem, RiskType riskType) throws Exception {
124+
InputPerson person = new NaturalInputPersonBuilder()
125+
.name(makeName(gn, sn))
126+
.addEmail(EmailAddressFactory.forAddress(email))
127+
.addTelNumber(TelNumberFactory.forNumber(telephone))
128+
.addAddressForAll(
129+
new StructuredAddressBuilder()
130+
.placeInfo(new StructuredPlaceInfoBuilder().locality(placeName).postalCode(postalCode).build())
131+
.streetInfo(new StructuredStreetInfoBuilder().streetName(streetName).houseNumber(houseNumber).build())
132+
.build())
133+
.build();
134+
RiskDetectorResult result = run(person);
135+
assertEquals(result.getRisks().size(), numberOfRisks);
136+
assertTrue(result.getWorstRisk().isPresent());
137+
DetectedRisk mostRisky = result.getWorstRisk().get();
138+
assertEquals(mostRisky.getDataItem(), dataItem);
139+
assertEquals(mostRisky.getRiskType(), riskType);
140+
}
141+
@DataProvider
142+
protected Object[][] allFields_risk() {
143+
return new Object[][]{
144+
{"John", "Doe", "[email protected]", "999 999 999", "55555", "Atlantis", "Hill road", "72", 7, DataItem.EMAIL, FakeRiskType.OTHER},
145+
{"abcd", "efg", "[email protected]", "000 000 000 000", "000", "fsklfksgfs", "sfsf", "000", 8, DataItem.NAME, FakeRiskType.INVALID},
146+
};
147+
}
148+
149+
120150
@Test(dataProvider = "placeNames_risk")
121151
public void placeNames_risk(String placeName, DataItem dataItem, RiskType riskType) throws Exception {
122152
InputPerson person = new NaturalInputPersonBuilder()

0 commit comments

Comments
 (0)