Skip to content

Commit f89bdd3

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent 4ee9265 commit f89bdd3

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/test/java/org/apache/commons/beanutils2/BeanMapTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ protected Object putIfAbsent(final String key, final Object value) {
267267
}
268268

269269
@Test
270-
public void testBeanMapClone() {
270+
void testBeanMapClone() {
271271
final BeanMap map = (BeanMap) makeFullMap();
272272
try {
273273
final BeanMap map2 = (BeanMap) map.clone();
@@ -284,7 +284,7 @@ public void testBeanMapClone() {
284284
}
285285

286286
@Test
287-
public void testBeanMapPutAllWriteable() {
287+
void testBeanMapPutAllWriteable() {
288288
final BeanMap map1 = (BeanMap) makeFullMap();
289289
final BeanMap map2 = (BeanMap) makeFullMap();
290290
map2.put("someIntValue", Integer.valueOf(0));
@@ -296,7 +296,7 @@ public void testBeanMapPutAllWriteable() {
296296
* Test that the cause of exception thrown by clear() is initialized.
297297
*/
298298
@Test
299-
public void testExceptionThrowFromClear() {
299+
void testExceptionThrowFromClear() {
300300
try {
301301
final Object bean = Jira87BeanFactory.createMappedPropertyBean();
302302
final BeanMap map = new BeanMap(bean);
@@ -318,7 +318,7 @@ public void testExceptionThrowFromClear() {
318318
* Test that the cause of exception thrown by a clone() is initialized.
319319
*/
320320
@Test
321-
public void testExceptionThrowFromClone() {
321+
void testExceptionThrowFromClone() {
322322
// Test cloning a non-public bean (instantiation exception)
323323
try {
324324
final Object bean = Jira87BeanFactory.createMappedPropertyBean();
@@ -357,7 +357,7 @@ public void testExceptionThrowFromClone() {
357357
* Test that the cause of exception thrown by put() is initialized.
358358
*/
359359
@Test
360-
public void testExceptionThrowFromPut() {
360+
void testExceptionThrowFromPut() {
361361
try {
362362
final Map<String, Object> map = new BeanMap(new BeanThrowingExceptions());
363363
map.put("valueThrowingException", "value");
@@ -382,7 +382,7 @@ public void testExceptionThrowFromPut() {
382382
* Test the default transformers using the getTypeTransformer() method
383383
*/
384384
@Test
385-
public void testGetTypeTransformerMethod() {
385+
void testGetTypeTransformerMethod() {
386386
final BeanMap beanMap = new BeanMap();
387387
assertEquals(Boolean.TRUE, beanMap.getTypeTransformer(Boolean.TYPE).apply("true"), "Boolean.TYPE");
388388
assertEquals(Character.valueOf('B'), beanMap.getTypeTransformer(Character.TYPE).apply("BCD"), "Character.TYPE");
@@ -416,14 +416,14 @@ public void testMapPut() {
416416
}
417417

418418
@Test
419-
public void testMethodAccessor() throws Exception {
419+
void testMethodAccessor() throws Exception {
420420
final BeanMap map = (BeanMap) makeFullMap();
421421
final Method method = BeanWithProperties.class.getDeclaredMethod("getSomeIntegerValue");
422422
assertEquals(method, map.getReadMethod("someIntegerValue"));
423423
}
424424

425425
@Test
426-
public void testMethodMutator() throws Exception {
426+
void testMethodMutator() throws Exception {
427427
final BeanMap map = (BeanMap) makeFullMap();
428428
final Method method = BeanWithProperties.class.getDeclaredMethod("setSomeIntegerValue", Integer.class);
429429
assertEquals(method, map.getWriteMethod("someIntegerValue"));

src/test/java/org/apache/commons/beanutils2/ConvertUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void tearDown() {
8484
@Test
8585
@SuppressWarnings({ "unchecked", "rawtypes" })
8686
// We need to use raw types in order to test legacy converters
87-
public void testConvertToString() throws Exception {
87+
void testConvertToString() throws Exception {
8888
final Converter dummyConverter = (type, value) -> value;
8989

9090
final Converter fooConverter = (type, value) -> "Foo-Converter";

src/test/java/org/apache/commons/beanutils2/LazyDynaListTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public void tearDown() {
268268
/**
269269
* Test Collection
270270
*/
271-
public void testCollection(final LazyDynaList list, final Class<?> testClass, final DynaClass testDynaClass, final Object wrongBean) {
271+
void testCollection(final LazyDynaList list, final Class<?> testClass, final DynaClass testDynaClass, final Object wrongBean) {
272272

273273
// Create Collection & Array of Maps
274274
final int size = 5;

src/test/java/org/apache/commons/beanutils2/converters/CharacterConverterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void testConvertToCharacterNullNoDefault() {
7474
*/
7575
@Test
7676
@SuppressWarnings("unchecked") // testing raw conversion
77-
public void testConvertToString() {
77+
void testConvertToString() {
7878

7979
final Converter<Character> converter = new CharacterConverter();
8080
@SuppressWarnings("rawtypes")
@@ -91,7 +91,7 @@ public void testConvertToString() {
9191
*/
9292
@Test
9393
@SuppressWarnings("unchecked") // tests failure so allow mismatch
94-
public void testConvertToUnsupportedType() {
94+
void testConvertToUnsupportedType() {
9595
@SuppressWarnings("rawtypes") // tests failure so allow mismatch
9696
final Converter converter = new CharacterConverter();
9797
assertThrows(ConversionException.class, () -> converter.convert(Integer.class, "Test"));

src/test/java/org/apache/commons/beanutils2/converters/IntegerConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void testInvalidAmount() {
9393
*/
9494
@Test
9595
@SuppressWarnings("unchecked") // raw to test throwing
96-
public void testInvalidDefaultObject() {
96+
void testInvalidDefaultObject() {
9797
@SuppressWarnings("rawtypes") // raw to test throwing
9898
final NumberConverter converter = makeConverter();
9999
assertThrows(ConversionException.class, () -> converter.setDefaultValue("notANumber"), "Invalid default value not detected!");

0 commit comments

Comments
 (0)