Skip to content

Commit d0cb256

Browse files
committed
Improve coverage
1 parent 0809c8a commit d0cb256

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies {
4444

4545
testImplementation 'junit:junit:4.13.2'
4646
testImplementation 'org.assertj:assertj-core:3.23.1'
47+
testImplementation 'com.google.code.bean-matchers:bean-matchers:0.13'
4748
}
4849

4950
jar {

src/test/java/com/imsweb/seerapi/client/disease/DiseaseTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
import java.util.Collections;
88
import java.util.List;
99

10+
import org.hamcrest.CoreMatchers;
11+
import org.hamcrest.MatcherAssert;
1012
import org.junit.BeforeClass;
1113
import org.junit.Test;
1214

1315
import com.imsweb.seerapi.client.SeerApi;
1416
import com.imsweb.seerapi.client.publishable.PublishableSearch;
1517

18+
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
19+
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
1620
import static org.junit.Assert.assertEquals;
1721
import static org.junit.Assert.assertNotNull;
1822
import static org.junit.Assert.assertNull;
@@ -274,4 +278,12 @@ public void testDiseaseChangelog() throws IOException {
274278
assertNull(entry.getNewVersion());
275279
}
276280

281+
@Test
282+
public void testBeans() {
283+
MatcherAssert.assertThat(DiseaseHistoryEvent.class, CoreMatchers.allOf(
284+
hasValidBeanConstructor(),
285+
hasValidGettersAndSetters()
286+
));
287+
}
288+
277289
}

src/test/java/com/imsweb/seerapi/client/glossary/GlossaryTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
import java.util.List;
1010
import java.util.Set;
1111

12+
import org.hamcrest.CoreMatchers;
13+
import org.hamcrest.MatcherAssert;
1214
import org.junit.BeforeClass;
1315
import org.junit.Test;
1416

1517
import com.imsweb.seerapi.client.SeerApi;
1618
import com.imsweb.seerapi.client.publishable.PublishableSearch;
1719
import com.imsweb.seerapi.client.shared.KeywordMatch;
1820

21+
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
22+
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
1923
import static com.imsweb.seerapi.client.glossary.Glossary.Category.GENERAL;
2024
import static org.junit.Assert.assertEquals;
2125
import static org.junit.Assert.assertNotNull;
@@ -168,4 +172,11 @@ public void testGlossaryMatch() throws IOException {
168172
assertEquals(0, matches.size());
169173
}
170174

175+
@Test
176+
public void testBeans() {
177+
MatcherAssert.assertThat(GlossaryHistoryEvent.class, CoreMatchers.allOf(
178+
hasValidBeanConstructor(),
179+
hasValidGettersAndSetters()
180+
));
181+
}
171182
}

src/test/java/com/imsweb/seerapi/client/rx/RxTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
import java.util.HashSet;
1010
import java.util.List;
1111

12+
import org.hamcrest.CoreMatchers;
13+
import org.hamcrest.MatcherAssert;
1214
import org.junit.BeforeClass;
1315
import org.junit.Test;
1416

1517
import com.imsweb.seerapi.client.SeerApi;
1618
import com.imsweb.seerapi.client.publishable.PublishableSearch;
1719

20+
import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor;
21+
import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
1822
import static org.junit.Assert.assertEquals;
1923
import static org.junit.Assert.assertNotNull;
2024
import static org.junit.Assert.assertNull;
@@ -154,4 +158,12 @@ public void testRxSearchIterate() throws IOException {
154158
search.setOffset(search.getOffset() + results.getResults().size());
155159
}
156160
}
161+
162+
@Test
163+
public void testBeans() {
164+
MatcherAssert.assertThat(RxHistoryEvent.class, CoreMatchers.allOf(
165+
hasValidBeanConstructor(),
166+
hasValidGettersAndSetters()
167+
));
168+
}
157169
}

0 commit comments

Comments
 (0)