Skip to content

Commit

Permalink
Minor inspection fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mridang Agarwalla committed Nov 8, 2021
1 parent 06bdaed commit a44891b
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public interface CollectionHandlingTest<T> extends BeanieTest<T> {
* Generate multiple random objects of the given class
* and assert serializing and deserializing back returns
* the original object.
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testSerdeCollection(Class<? extends T> concreteClass) {
EasyRandomParameters randomParameters = getEasyRandomParameters();
Expand All @@ -54,6 +55,7 @@ default void testSerdeCollection(Class<? extends T> concreteClass) {
* Generate multiple random objects of the given class
* and assert serializing and deserializing back returns
* the original object.
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testSerdeCollectionAsWell(Class<? extends T> concreteClass) {
EasyRandomParameters randomParameters = getEasyRandomParameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;


/**
* @author mridang
*/
public final class DefaultBeanieProvider implements BeanieProvider {

private final ObjectMapper objectMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public interface FinalPropertiesTest<T> extends BeanieTest<T> {

/**
* All fields should be final
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testFinalProperties(Class<? extends T> concreteClass) {
List<AnnotatedField> fields = getDescription(concreteClass).findProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public interface NamingStrategyTest<T> extends BeanieTest<T> {
/**
* Test that all properties of a bean are named with a consistent naming strategy and all property names
* comply with the bean's naming strategy.
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testNamingStrategy(Class<? extends T> concreteClass) {
BeanDescription beanDescription = getDescription(concreteClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public interface NoSettersTest<T> extends BeanieTest<T> {

/**
* Check that there is no setters
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testNoSetters(Class<? extends T> concreteClass) {
List<BeanPropertyDefinition> properties = getDescription(concreteClass).findProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public interface SerdeKosherTest<T> extends BeanieTest<T> {
* Generate multiple random objects of the given class
* and assert serializing and deserializing back returns
* the original object.
* @param concreteClass the bean class to be tests as provided by Junit
*/
default void testSerde(Class<? extends T> concreteClass) {
EasyRandomParameters randomParameters = getEasyRandomParameters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public abstract class AbstractJacksonBeanTest<T> implements JupiterBeanieTest<T>
}

public static Stream<Class<? extends JacksonBean>> getClasses() {
Reflections reflections = new Reflections((new ConfigurationBuilder())
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("com.nosto")));
return reflections.getSubTypesOf(JacksonBean.class).stream();
}
Expand Down Expand Up @@ -84,13 +84,14 @@ public static Stream<Class<? extends JacksonBean>> noSetters() {

@SuppressWarnings("unused")
public static Stream<Class<? extends JacksonBean>> finalProperties() {
Reflections reflections = new Reflections((new ConfigurationBuilder())
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("com.nosto")));
return reflections.getSubTypesOf(JacksonBean.class).stream();
}

/**
* @see ConstructorParametersTest#testConstructorParameters(Class)
* For more information @see ConstructorParametersTest#testConstructorParameters(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -99,7 +100,8 @@ public void constructorParameters(Class<T> concreteClass) {
}

/**
* @see SerdeKosherTest#testSerde(Class)
* For more information @see SerdeKosherTest#testSerde(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -108,7 +110,8 @@ public void serde(Class<T> concreteClass) {
}

/**
* @see NamingStrategyTest#testNamingStrategy(Class)
* For more information @see NamingStrategyTest#testNamingStrategy(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -117,7 +120,8 @@ public void namingStrategy(Class<T> concreteClass) {
}

/**
* @see CollectionHandlingTest#testSerdeCollection(Class)
* For more information @see CollectionHandlingTest#testSerdeCollection(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -126,7 +130,8 @@ public void serdeCollection(Class<T> concreteClass) {
}

/**
* @see CollectionHandlingTest#testSerdeCollectionAsWell(Class)
* For more information @see CollectionHandlingTest#testSerdeCollectionAsWell(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -135,7 +140,8 @@ public void serdeCollectionAsWell(Class<T> concreteClass) {
}

/**
* @see NoSettersTest#testNoSetters(Class)
* For more information @see NoSettersTest#testNoSetters(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand All @@ -144,7 +150,8 @@ public void noSetters(Class<T> concreteClass) {
}

/**
* @see FinalPropertiesTest#testFinalProperties(Class)
* For more information @see FinalPropertiesTest#testFinalProperties(Class)
* @param concreteClass the bean class to be tests as provided by Junit
*/
@ParameterizedTest
@MethodSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@SuppressWarnings("unused")
public interface JupiterBeanieTest<T> extends BeanieTest<T> {

@Override
default RandomizerRegistry getRandomizerRegistry() {
return new CustomRandomizerRegistry();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021 Nosto Solutions Ltd All Rights Reserved.
*
*
* This software is the confidential and proprietary information of
* Nosto Solutions Ltd ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,55 +50,55 @@ public AbstractJacksonBeanTest(Class<? extends T> clazz) {
}

/**
* @see ConstructorParametersTest#testConstructorParameters(Class)
* For more information @see ConstructorParametersTest#testConstructorParameters(Class)
*/
@Test
public void constructorParameters() {
testConstructorParameters(concreteClass);
}

/**
* @see SerdeKosherTest#testSerde(Class)
* For more information @see SerdeKosherTest#testSerde(Class)
*/
@Test
public void serde() {
testSerde(concreteClass);
}

/**
* @see NamingStrategyTest#testNamingStrategy(Class)
* For more information @see NamingStrategyTest#testNamingStrategy(Class)
*/
@Test
public void namingStrategy() {
testNamingStrategy(concreteClass);
}

/**
* @see CollectionHandlingTest#testSerdeCollection(Class)
* For more information @see CollectionHandlingTest#testSerdeCollection(Class)
*/
@Test
public void serdeCollection() {
testSerdeCollection(concreteClass);
}

/**
* @see CollectionHandlingTest#testSerdeCollectionAsWell(Class)
* For more information @see CollectionHandlingTest#testSerdeCollectionAsWell(Class)
*/
@Test
public void serdeCollectionAsWell() {
testSerdeCollectionAsWell(concreteClass);
}

/**
* @see NoSettersTest#testNoSetters(Class)
* For more information @see NoSettersTest#testNoSetters(Class)
*/
@Test
public void noSetters() {
testNoSetters(concreteClass);
}

/**
* @see FinalPropertiesTest#testFinalProperties(Class)
* For more information @see FinalPropertiesTest#testFinalProperties(Class)
*/
@Test
public void finalProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@SuppressWarnings("unused")
public interface VintageBeanieTest<T> extends BeanieTest<T> {

@Override
default RandomizerRegistry getRandomizerRegistry() {
return new CustomRandomizerRegistry();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021 Nosto Solutions Ltd All Rights Reserved.
*
*
* This software is the confidential and proprietary information of
* Nosto Solutions Ltd ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
Expand Down

0 comments on commit a44891b

Please sign in to comment.