diff --git a/build.gradle b/build.gradle index 972f55659..0d8c8535e 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,14 @@ subprojects { apply plugin: 'maven-publish' apply plugin: "com.github.sherter.google-java-format" + compileJava { + options.compilerArgs << '-Xlint:all' + } + + compileTestJava { + options.compilerArgs << '-Xlint:all' + } + repositories { mavenLocal() maven { diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/CallErrorException.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/CallErrorException.java index db59e16bb..c54097a83 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/CallErrorException.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/CallErrorException.java @@ -27,6 +27,7 @@ of this software and associated documentation files (the "Software"), to deal /** Exception returned to an outgoing request if an error is reported from the other end. */ public class CallErrorException extends Exception { + private static final long serialVersionUID = 2491636769263746241L; private String errorCode; private String errorDescription; diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java index 83ddff4e4..77c71d725 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/Communicator.java @@ -27,6 +27,7 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ +import eu.chargetime.ocpp.feature.Feature; import eu.chargetime.ocpp.model.*; import java.util.ArrayDeque; import org.slf4j.Logger; @@ -54,6 +55,7 @@ public abstract class Communicator { * @param payload the raw formatted payload. * @param type the expected return type. * @return the unpacked payload. + * @param the type of the unpacked payload. * @throws Exception error occurred while converting. */ public abstract T unpackPayload(Object payload, Class type) throws Exception; @@ -70,7 +72,7 @@ public abstract class Communicator { * Create a call result envelope to transmit. * * @param uniqueId the id the receiver expects. - * @param action action name of the feature. + * @param action action name of the {@link Feature}. * @param payload packed payload. * @return a fully packed message ready to send. */ @@ -80,7 +82,7 @@ public abstract class Communicator { * Create a call envelope to transmit to the server. * * @param uniqueId the id the receiver must reply with. - * @param action action name of the feature. + * @param action action name of the {@link Feature}. * @param payload packed payload. * @return a fully packed message ready to send. */ @@ -90,6 +92,7 @@ public abstract class Communicator { * Create a call error envelope to transmit. * * @param uniqueId the id the receiver expects. + * @param action action name of the {@link Feature}. * @param errorCode an OCPP error code. * @param errorDescription an associated error description. * @return a fully packed message ready to send. @@ -101,6 +104,7 @@ protected abstract Object makeCallError( * Create a call result error envelope to transmit. * * @param uniqueId the id the receiver expects. + * @param action action name of the {@link Feature}. * @param errorCode an OCPP error code. * @param errorDescription an associated error description. * @return a fully packed message ready to send. @@ -112,7 +116,7 @@ protected abstract Object makeCallResultError( * Create a send envelope to transmit to the server. * * @param uniqueId the id of the message. - * @param action action name of the feature. + * @param action action name of the {@link Feature}. * @param payload packed payload. * @return a fully packed message ready to send. */ @@ -177,7 +181,7 @@ public void accept(CommunicatorEvents events) { * Request}s. * * @param uniqueId the id the receiver should use to reply. - * @param action action name of the {@link eu.chargetime.ocpp.feature.Feature}. + * @param action action name of the {@link Feature}. * @param request the outgoing {@link Request} */ public synchronized void sendCall(String uniqueId, String action, Request request) { @@ -222,6 +226,7 @@ public synchronized void sendCall(String uniqueId, String action, Request reques * Send a {@link Confirmation} reply to a {@link Request}. * * @param uniqueId the id the receiver expects. + * @param action action name of the {@link Feature}. * @param confirmation the outgoing {@link Confirmation} */ public void sendCallResult(String uniqueId, String action, Confirmation confirmation) { @@ -255,7 +260,8 @@ public void sendCallResult(String uniqueId, String action, Confirmation confirma * Send an error. If offline, the message is thrown away. * * @param uniqueId the id the receiver expects a response to. - * @param errorCode an OCPP error Code + * @param action action name of the {@link Feature}. + * @param errorCode an OCPP error Code. * @param errorDescription a associated error description. */ public void sendCallError( @@ -282,7 +288,8 @@ public void sendCallError( * Send a call result error. If offline, the message is thrown away. * * @param uniqueId the id the receiver expects a response to. - * @param errorCode an OCPP error Code + * @param action action name of the {@link Feature}. + * @param errorCode an OCPP error Code. * @param errorDescription a associated error description. */ public void sendCallResultError( @@ -310,7 +317,7 @@ public void sendCallResultError( * Send a {@link Request} which has no confirmation. * * @param uniqueId the id of the {@link Request}. - * @param action action name of the {@link eu.chargetime.ocpp.feature.Feature}. + * @param action action name of the {@link Feature}. * @param request the outgoing {@link Request} */ public synchronized void send(String uniqueId, String action, Request request) { diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/NotConnectedException.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/NotConnectedException.java index a5ad1969b..9fd84829a 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/NotConnectedException.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/NotConnectedException.java @@ -24,4 +24,6 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ -public class NotConnectedException extends Exception {} +public class NotConnectedException extends Exception { + private static final long serialVersionUID = -2192470845608175121L; +} diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/OccurenceConstraintException.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/OccurenceConstraintException.java index b0b543f03..ecdf69874 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/OccurenceConstraintException.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/OccurenceConstraintException.java @@ -25,4 +25,6 @@ of this software and associated documentation files (the "Software"), to deal */ /** Exception thrown when trying to send a request that isn't valid. */ -public class OccurenceConstraintException extends Exception {} +public class OccurenceConstraintException extends Exception { + private static final long serialVersionUID = -8870111792165582976L; +} diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/PropertyConstraintException.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/PropertyConstraintException.java index 9138f29b0..5e8447ea4 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/PropertyConstraintException.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/PropertyConstraintException.java @@ -28,7 +28,7 @@ of this software and associated documentation files (the "Software"), to deal /** Exception used when validating fields. */ public class PropertyConstraintException extends IllegalArgumentException { - + private static final long serialVersionUID = 7561578774874709893L; private static final String EXCEPTION_MESSAGE_TEMPLATE = "Validation failed: [%s]. Current Value: [%s]"; diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/SecurityErrorException.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/SecurityErrorException.java index e7450b0a2..1a778826b 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/SecurityErrorException.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/SecurityErrorException.java @@ -29,6 +29,8 @@ of this software and associated documentation files (the "Software"), to deal /** A security issue occurred */ public class SecurityErrorException extends IllegalStateException { + private static final long serialVersionUID = 630599636179474207L; + public SecurityErrorException(String s) { super(s); } diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/Server.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/Server.java index b0dc38412..b3dd2034a 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/Server.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/Server.java @@ -227,6 +227,7 @@ public void close() { * @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported * features. * @throws OccurenceConstraintException Thrown if the request isn't valid. + * @throws NotConnectedException Thrown if session with passed sessionIndex is not found */ public CompletableFuture send(UUID sessionIndex, Request request) throws UnsupportedFeatureException, OccurenceConstraintException, NotConnectedException { @@ -275,6 +276,9 @@ public CompletableFuture send(UUID sessionIndex, Request request) * @param confirmation the {@link Confirmation} to the original {@link Request}. * @return a boolean indicating if pending request was found. * @throws NotConnectedException Thrown if session with passed sessionIndex is not found + * @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported + * features. + * @throws OccurenceConstraintException Thrown if the request isn't valid. */ public boolean asyncCompleteRequest(UUID sessionIndex, String uniqueId, Confirmation confirmation) throws NotConnectedException, UnsupportedFeatureException, OccurenceConstraintException { diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/Session.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/Session.java index fe4a1255c..4873a243e 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/Session.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/Session.java @@ -64,6 +64,8 @@ public class Session implements ISession { * * @param communicator send and receive messages. * @param queue store and restore requests based on unique ids. + * @param fulfiller the {@link PromiseFulfiller} to use + * @param featureRepository the {@link IFeatureRepository} to use */ public Session( Communicator communicator, @@ -150,6 +152,7 @@ public void removeRequest(String ticket) { * Send a {@link Confirmation} to a {@link Request} * * @param uniqueId the unique identification the receiver expects. + * @param action action name to identify the feature. * @param confirmation the {@link Confirmation} payload to send. */ public void sendConfirmation(String uniqueId, String action, Confirmation confirmation) { diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/SessionEvents.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/SessionEvents.java index aa6a62974..88680be11 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/SessionEvents.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/SessionEvents.java @@ -47,6 +47,8 @@ public interface SessionEvents { * * @param request the {@link Request}. * @return a {@link Confirmation} to send as a response or {@code null} if none to send. + * @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported + * features. */ @Nullable Confirmation handleRequest(Request request) throws UnsupportedFeatureException; @@ -57,6 +59,9 @@ public interface SessionEvents { * @param uniqueId the unique id used for the {@link Request}. * @param confirmation the {@link Confirmation} to the {@link Request}. * @return a boolean indicating if pending request was found. + * @throws UnsupportedFeatureException Thrown if the feature isn't among the list of supported + * features. + * @throws OccurenceConstraintException Thrown if the request isn't valid. */ boolean asyncCompleteRequest(String uniqueId, Confirmation confirmation) throws UnsupportedFeatureException, OccurenceConstraintException; diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/OptionalDecorator.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/OptionalDecorator.java index 9fdd32f4f..a395c02d3 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/OptionalDecorator.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/OptionalDecorator.java @@ -27,9 +27,9 @@ of this software and associated documentation files (the "Software"), to deal public class OptionalDecorator extends Validator { - private final Validator validator; + private final Validator validator; - public OptionalDecorator(Validator validator) { + public OptionalDecorator(Validator validator) { this.validator = validator; } diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredDecorator.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredDecorator.java index 8af6a3086..87815bc92 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredDecorator.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredDecorator.java @@ -27,17 +27,17 @@ of this software and associated documentation files (the "Software"), to deal import eu.chargetime.ocpp.PropertyConstraintException; -public class RequiredDecorator extends Validator { +public class RequiredDecorator extends Validator { - private final Validator requiredValidator = new RequiredValidator(); - private final Validator decoratee; + private final Validator requiredValidator = new RequiredValidator<>(); + private final Validator decoratee; - public RequiredDecorator(Validator validator) { + public RequiredDecorator(Validator validator) { this.decoratee = validator; } @Override - public void validate(Object value) throws PropertyConstraintException { + public void validate(T value) throws PropertyConstraintException { requiredValidator.validate(value); decoratee.validate(value); } diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredValidator.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredValidator.java index 1c5753d6f..22e45ba68 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredValidator.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/RequiredValidator.java @@ -27,11 +27,11 @@ of this software and associated documentation files (the "Software"), to deal import eu.chargetime.ocpp.PropertyConstraintException; -public class RequiredValidator extends Validator { - private final String ERROR_MESSAGE = "Field is required and must not be Null."; +public class RequiredValidator extends Validator { + private static final String ERROR_MESSAGE = "Field is required and must not be Null."; @Override - public void validate(Object value) throws PropertyConstraintException { + public void validate(T value) throws PropertyConstraintException { if (value == null) { throw new PropertyConstraintException(ERROR_MESSAGE, null); } diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/ValidatorBuilder.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/ValidatorBuilder.java index 30c1e38cc..15cba29d9 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/ValidatorBuilder.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/model/validation/ValidatorBuilder.java @@ -29,8 +29,8 @@ of this software and associated documentation files (the "Software"), to deal public class ValidatorBuilder { + private final ArrayList rules; private boolean required = false; - private ArrayList rules; public ValidatorBuilder() { rules = new ArrayList<>(); @@ -46,10 +46,10 @@ public ValidatorBuilder setRequired(boolean isRequired) { return this; } - public Validator build() { - Validator validator = new StringValidator(rules.toArray(new IValidationRule[0])); + public Validator build() { + Validator validator = new StringValidator(rules.toArray(new IValidationRule[0])); - if (required) validator = new RequiredDecorator(validator); + if (required) validator = new RequiredDecorator<>(validator); else validator = new OptionalDecorator(validator); return validator; diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java index 26b36c1fa..5e16b2a73 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/MoreObjects.java @@ -697,6 +697,7 @@ static ToStringHelperImpl toStringHelper(Class clazz) { * Object#getClass()}. * * @param className the name of the instance type + * @return an instance of {@link ToStringHelperImpl} */ public static ToStringHelperImpl toStringHelper(String className) { return new ToStringHelperImpl(className); @@ -722,6 +723,8 @@ private ToStringHelperImpl(String className) { * Configures the {@link ToStringHelperImpl} so {@link #toString()} will ignore properties with * null value. The order of calling this method, relative to the {@code add()}/{@code * addValue()} methods, is not significant. + * + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl omitNullValues() { omitNullValues = true; @@ -732,42 +735,88 @@ public ToStringHelperImpl omitNullValues() { * Adds a name/value pair to the formatted output in {@code name=value} format. If {@code value} * is {@code null}, the string {@code "null"} is used, unless {@link #omitNullValues()} is * called, in which case this name/value pair will not be added. + * + * @param name the name + * @param value the {@link Object} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl add(String name, Object value) { return addHolder(name, value); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@link ZonedDateTime} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, ZonedDateTime value) { return addHolder(name, value); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code boolean} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, boolean value) { return addHolder(name, String.valueOf(value)); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code char} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, char value) { return addHolder(name, String.valueOf(value)); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code double} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, double value) { return addHolder(name, String.valueOf(value)); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code float} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, float value) { return addHolder(name, String.valueOf(value)); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code int} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, int value) { return addHolder(name, String.valueOf(value)); } - /** Adds a name/value pair to the formatted output in {@code name=value} format. */ + /** + * Adds a name/value pair to the formatted output in {@code name=value} format. + * + * @param name the name + * @param value the {@code long} value + * @return this instance of {@link ToStringHelperImpl} + */ public ToStringHelperImpl add(String name, long value) { return addHolder(name, String.valueOf(value)); } @@ -777,6 +826,9 @@ public ToStringHelperImpl add(String name, long value) { * *

It is strongly encouraged to use {@link #add(String, Object)} instead and give value a * readable name. + * + * @param value the {@link Object} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(Object value) { return addHolder(value); @@ -787,6 +839,9 @@ public ToStringHelperImpl addValue(Object value) { * *

It is strongly encouraged to use {@link #add(String, boolean)} instead and give value a * readable name. + * + * @param value the {@code boolean} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(boolean value) { return addHolder(String.valueOf(value)); @@ -797,6 +852,9 @@ public ToStringHelperImpl addValue(boolean value) { * *

It is strongly encouraged to use {@link #add(String, char)} instead and give value a * readable name. + * + * @param value the {@code char} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(char value) { return addHolder(String.valueOf(value)); @@ -807,6 +865,9 @@ public ToStringHelperImpl addValue(char value) { * *

It is strongly encouraged to use {@link #add(String, double)} instead and give value a * readable name. + * + * @param value the {@code double} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(double value) { return addHolder(String.valueOf(value)); @@ -817,6 +878,9 @@ public ToStringHelperImpl addValue(double value) { * *

It is strongly encouraged to use {@link #add(String, float)} instead and give value a * readable name. + * + * @param value the {@code float} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(float value) { return addHolder(String.valueOf(value)); @@ -827,6 +891,9 @@ public ToStringHelperImpl addValue(float value) { * *

It is strongly encouraged to use {@link #add(String, int)} instead and give value a * readable name. + * + * @param value the {@code int} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(int value) { return addHolder(String.valueOf(value)); @@ -837,6 +904,9 @@ public ToStringHelperImpl addValue(int value) { * *

It is strongly encouraged to use {@link #add(String, long)} instead and give value a * readable name. + * + * @param value the {@code long} value + * @return this instance of {@link ToStringHelperImpl} */ public ToStringHelperImpl addValue(long value) { return addHolder(String.valueOf(value)); diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/Stopwatch.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/Stopwatch.java index 8af406f48..61ddf4633 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/Stopwatch.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/Stopwatch.java @@ -52,12 +52,18 @@ public interface Ticker { /** * Creates (but does not start) a new stopwatch using {@link System#nanoTime} as its time source. + * + * @return the new stopwatch (not started) */ public static Stopwatch createUnstarted() { return new Stopwatch(); } - /** Creates (and starts) a new stopwatch using {@link System#nanoTime} as its time source. */ + /** + * Creates (and starts) a new stopwatch using {@link System#nanoTime} as its time source. + * + * @return the new stopwatch (started) + */ public static Stopwatch createStarted() { return new Stopwatch().start(); } @@ -65,6 +71,9 @@ public static Stopwatch createStarted() { /** * Returns {@code true} if {@link #start()} has been called on this stopwatch, and {@link #stop()} * has not been called since the last call to {@code start()}. + * + * @return {@code true} if {@link #start()} has been called on this stopwatch, and {@link #stop()} + * has not been called since the last call to {@code start()}. */ public boolean isRunning() { return isRunning; @@ -125,6 +134,9 @@ private long elapsedNanos() { *

It is generally not a good idea to use an ambiguous, unitless {@code long} to represent * elapsed time. Therefore, we recommend using {@link #elapsed()} instead, which returns a * strongly-typed {@link Duration} instance. + * + * @param desiredUnit the desired time unit + * @return the current elapsed time shown on this stopwatch */ public long elapsed(TimeUnit desiredUnit) { return desiredUnit.convert(elapsedNanos(), NANOSECONDS); @@ -133,6 +145,8 @@ public long elapsed(TimeUnit desiredUnit) { /** * Returns the current elapsed time shown on this stopwatch as a {@link Duration}. Unlike {@link * #elapsed(TimeUnit)}, this method does not lose any precision due to rounding. + * + * @return the current elapsed time shown on this stopwatch as a {@link Duration}. */ public Duration elapsed() { return Duration.ofNanos(elapsedNanos()); diff --git a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/TestUtilities.java b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/TestUtilities.java index 24cd235e7..59d717860 100644 --- a/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/TestUtilities.java +++ b/ocpp-common/src/main/java/eu/chargetime/ocpp/utilities/TestUtilities.java @@ -26,7 +26,7 @@ * SOFTWARE. */ -/** Utilities for tests. Used to quickly create usefull objects. */ +/** Utilities for tests. Used to quickly create useful objects. */ public final class TestUtilities { /** @@ -57,6 +57,7 @@ public static String aString(int length) { * @param The type of the elements. * @return An array of the given elements. */ + @SuppressWarnings({"varargs", "unchecked"}) public static T[] aList(T... objects) { return objects; } @@ -73,6 +74,6 @@ public static String join(String delimiter, Object[] array) { for (Object current : array) output.append(String.format("%s%s", delimiter, current)); - return output.toString().substring(1); + return output.substring(1); } } diff --git a/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SessionTest.java b/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SessionTest.java index e7ed4efef..ab2a509e1 100644 --- a/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SessionTest.java +++ b/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SessionTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.test; import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.*; @@ -60,7 +60,7 @@ public class SessionTest { @Mock private PromiseFulfiller fulfiller; @Before - public void setup() throws Exception { + public void setup() { when(featureRepository.findFeature(any())).thenReturn(Optional.of(feature)); when(feature.getConfirmationType()).thenAnswer(invocation -> Confirmation.class); session = new Session(communicator, queue, fulfiller, featureRepository); @@ -159,7 +159,12 @@ public void open_connectsViaCommunicator() { public void onCall_unhandledCallback_callSendCallError() throws Exception { // Given String someId = "Some id"; - doAnswer(invocation -> invocation.getArgument(0, CompletableFuture.class).complete(null)) + doAnswer( + invocation -> { + CompletableFuture future = invocation.getArgument(0); + future.complete(null); + return null; + }) .when(fulfiller) .fulfill(any(), any(), any()); when(communicator.unpackPayload(any(), any())).thenReturn(new TestRequest()); @@ -186,8 +191,11 @@ public boolean validate() { }; doAnswer( - invocation -> - invocation.getArgument(0, CompletableFuture.class).complete(aConfirmation)) + invocation -> { + CompletableFuture future = invocation.getArgument(0); + future.complete(aConfirmation); + return null; + }) .when(fulfiller) .fulfill(any(), any(), any()); when(communicator.unpackPayload(any(), any())).thenReturn(new TestRequest()); diff --git a/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SimpleRequestDispatcherTest.java b/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SimpleRequestDispatcherTest.java index 030808ab9..e523edaca 100644 --- a/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SimpleRequestDispatcherTest.java +++ b/ocpp-common/src/test/java/eu/chargetime/ocpp/test/SimpleRequestDispatcherTest.java @@ -26,7 +26,7 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; @@ -43,7 +43,7 @@ of this software and associated documentation files (the "Software"), to deal @RunWith(MockitoJUnitRunner.class) public class SimpleRequestDispatcherTest { - private SimplePromiseFulfiller sut; + private final SimplePromiseFulfiller sut; @Mock private SessionEvents eventsMock; diff --git a/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/ModelUtilTest.java b/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/ModelUtilTest.java index 4579b769a..bcfdbd1ed 100644 --- a/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/ModelUtilTest.java +++ b/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/ModelUtilTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.utilities.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.utilities.ModelUtil; import org.junit.Test; diff --git a/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/StopwatchTest.java b/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/StopwatchTest.java index fcd0c20a0..72ab9864d 100644 --- a/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/StopwatchTest.java +++ b/ocpp-common/src/test/java/eu/chargetime/ocpp/utilities/test/StopwatchTest.java @@ -27,8 +27,8 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/ocpp-json/src/main/java/eu/chargetime/ocpp/WebSocketTransmitter.java b/ocpp-json/src/main/java/eu/chargetime/ocpp/WebSocketTransmitter.java index d162b7507..8c50ca113 100644 --- a/ocpp-json/src/main/java/eu/chargetime/ocpp/WebSocketTransmitter.java +++ b/ocpp-json/src/main/java/eu/chargetime/ocpp/WebSocketTransmitter.java @@ -29,12 +29,15 @@ of this software and associated documentation files (the "Software"), to deal import eu.chargetime.ocpp.wss.WssSocketBuilder; import java.io.IOException; import java.net.ConnectException; +import java.net.InetAddress; import java.net.Proxy; +import java.net.Socket; import java.net.URI; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.HashMap; import java.util.Map; +import javax.net.SocketFactory; import org.java_websocket.client.WebSocketClient; import org.java_websocket.drafts.Draft; import org.java_websocket.exceptions.WebsocketNotConnectedException; @@ -125,11 +128,32 @@ public void onError(Exception ex) { "wssSocketBuilder must be set to support " + WSS_SCHEME + " scheme"); } - try { - client.setSocket(wssSocketBuilder.uri(resource).build()); - } catch (IOException ex) { - logger.error("SSL socket creation failed", ex); - } + SocketFactory socketFactory = + new SocketFactory() { + public Socket createSocket() throws IOException { + return wssSocketBuilder.uri(resource).build(); + } + + public Socket createSocket(String host, int port) { + throw new UnsupportedOperationException(); + } + + public Socket createSocket( + String host, int port, InetAddress clientAddress, int clientPort) { + throw new UnsupportedOperationException(); + } + + public Socket createSocket(InetAddress address, int port) { + throw new UnsupportedOperationException(); + } + + public Socket createSocket( + InetAddress address, int port, InetAddress clientAddress, int clientPort) { + throw new UnsupportedOperationException(); + } + }; + + client.setSocketFactory(socketFactory); } configure(); diff --git a/ocpp-json/src/main/java/eu/chargetime/ocpp/wss/WssSocketBuilder.java b/ocpp-json/src/main/java/eu/chargetime/ocpp/wss/WssSocketBuilder.java index 55affe459..91fabe4ab 100644 --- a/ocpp-json/src/main/java/eu/chargetime/ocpp/wss/WssSocketBuilder.java +++ b/ocpp-json/src/main/java/eu/chargetime/ocpp/wss/WssSocketBuilder.java @@ -43,6 +43,7 @@ public interface WssSocketBuilder { * Builds SSL {@link Socket} to support WSS scheme. * * @return SSL {@link Socket} + * @throws IOException if any I/O error occurred */ Socket build() throws IOException; diff --git a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssFactoryBuilderTest.java b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssFactoryBuilderTest.java index 10313885a..4f181895f 100644 --- a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssFactoryBuilderTest.java +++ b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssFactoryBuilderTest.java @@ -1,13 +1,15 @@ package eu.chargetime.ocpp.wss.test; +import static org.hamcrest.MatcherAssert.assertThat; + import eu.chargetime.ocpp.wss.BaseWssFactoryBuilder; import eu.chargetime.ocpp.wss.CustomSSLWebSocketServerFactory; +import java.util.Collections; import java.util.List; import javax.net.ssl.SSLContext; import org.hamcrest.CoreMatchers; import org.java_websocket.WebSocketServerFactory; import org.java_websocket.server.DefaultSSLWebSocketServerFactory; -import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; @@ -17,7 +19,7 @@ public class BaseWssFactoryBuilderTest { @Test public void builder_returnsBuilder() { BaseWssFactoryBuilder builder = BaseWssFactoryBuilder.builder(); - Assert.assertThat(builder, CoreMatchers.is(CoreMatchers.any(BaseWssFactoryBuilder.class))); + assertThat(builder, CoreMatchers.is(CoreMatchers.any(BaseWssFactoryBuilder.class))); } @Test @@ -29,11 +31,11 @@ public void builder_withSSLContextSet_throwsNoException() { @Test public void builder_builtWithCiphers_returnsCustomSSLWebSocketServerFactory() { SSLContext sslContext = Mockito.mock(SSLContext.class); - List cihpers = Mockito.mock(List.class); + List ciphers = Collections.emptyList(); WebSocketServerFactory factory = - BaseWssFactoryBuilder.builder().sslContext(sslContext).ciphers(cihpers).build(); + BaseWssFactoryBuilder.builder().sslContext(sslContext).ciphers(ciphers).build(); - Assert.assertThat( + assertThat( factory, CoreMatchers.is(CoreMatchers.instanceOf(CustomSSLWebSocketServerFactory.class))); } @@ -42,7 +44,7 @@ public void builder_builtWithoutCiphers_returnsDefaultSSLWebSocketServerFactory( SSLContext sslContext = Mockito.mock(SSLContext.class); WebSocketServerFactory factory = BaseWssFactoryBuilder.builder().sslContext(sslContext).build(); - Assert.assertThat( + assertThat( factory, CoreMatchers.is(CoreMatchers.instanceOf(DefaultSSLWebSocketServerFactory.class))); } diff --git a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssSocketBuilderTest.java b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssSocketBuilderTest.java index 517af993b..403a134c9 100644 --- a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssSocketBuilderTest.java +++ b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/BaseWssSocketBuilderTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.wss.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; diff --git a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/CustomSSLWebSocketServerFactoryTest.java b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/CustomSSLWebSocketServerFactoryTest.java index cfd259f48..1191ca088 100644 --- a/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/CustomSSLWebSocketServerFactoryTest.java +++ b/ocpp-json/src/test/java/eu/chargetime/ocpp/wss/test/CustomSSLWebSocketServerFactoryTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.wss.test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.wss.CustomSSLWebSocketServerFactory; @@ -9,7 +9,6 @@ import java.nio.channels.ByteChannel; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; -import java.security.KeyManagementException; import java.security.SecureRandom; import java.util.Arrays; import java.util.List; @@ -54,7 +53,7 @@ protected TestSSLContext(SSLContextSpi sslContextSpi) { static class TestSSLContextSpi extends SSLContextSpi { - private SSLEngine sslEngine; + private final SSLEngine sslEngine; public TestSSLContextSpi(SSLEngine sslEngine) { this.sslEngine = sslEngine; @@ -62,8 +61,7 @@ public TestSSLContextSpi(SSLEngine sslEngine) { @Override protected void engineInit( - KeyManager[] keyManagers, TrustManager[] trustManagers, SecureRandom secureRandom) - throws KeyManagementException { + KeyManager[] keyManagers, TrustManager[] trustManagers, SecureRandom secureRandom) { throw new UnsupportedOperationException(); } diff --git a/ocpp-v1_6-json/src/test/java/eu/chargetime/ocpp/test/JSONCommunicatorTest.java b/ocpp-v1_6-json/src/test/java/eu/chargetime/ocpp/test/JSONCommunicatorTest.java index 35d8c0205..53a938930 100644 --- a/ocpp-v1_6-json/src/test/java/eu/chargetime/ocpp/test/JSONCommunicatorTest.java +++ b/ocpp-v1_6-json/src/test/java/eu/chargetime/ocpp/test/JSONCommunicatorTest.java @@ -298,10 +298,11 @@ public void pack_bootNotificationConfirmation_limitsTimeFractionalDigitsToThree( // Given String expected = "{\"currentTime\":\"2016-04-28T06:41:13.123Z\",\"interval\":300,\"status\":\"Accepted\"}"; - BootNotificationConfirmation confirmation = new BootNotificationConfirmation(); - confirmation.setCurrentTime(createDateTimeInNanos(1461825673123456789L)); // will be truncated - confirmation.setInterval(300); - confirmation.setStatus(RegistrationStatus.Accepted); + BootNotificationConfirmation confirmation = + new BootNotificationConfirmation( + createDateTimeInNanos(1461825673123456789L), // will be truncated + 300, + RegistrationStatus.Accepted); // When Object payload = communicator.packPayload(confirmation); @@ -316,10 +317,9 @@ public void pack_bootNotificationConfirmation_returnsBootNotificationConfirmatio // Given String expected = "{\"currentTime\":\"2016-04-28T06:41:13.720Z\",\"interval\":300,\"status\":\"Accepted\"}"; - BootNotificationConfirmation confirmation = new BootNotificationConfirmation(); - confirmation.setCurrentTime(createDateTimeInMillis(1461825673720L)); - confirmation.setInterval(300); - confirmation.setStatus(RegistrationStatus.Accepted); + BootNotificationConfirmation confirmation = + new BootNotificationConfirmation( + createDateTimeInMillis(1461825673720L), 300, RegistrationStatus.Accepted); // When Object payload = communicator.packPayload(confirmation); @@ -334,10 +334,11 @@ public void pack_bootNotificationConfirmation_alwaysFormatsTimeWithThreeFraction // Given String expected = "{\"currentTime\":\"2016-04-28T06:41:13.000Z\",\"interval\":300,\"status\":\"Accepted\"}"; - BootNotificationConfirmation confirmation = new BootNotificationConfirmation(); - confirmation.setCurrentTime(createDateTimeInMillis(1461825673000L)); // will not be truncated - confirmation.setInterval(300); - confirmation.setStatus(RegistrationStatus.Accepted); + BootNotificationConfirmation confirmation = + new BootNotificationConfirmation( + createDateTimeInMillis(1461825673000L), // will not be truncated + 300, + RegistrationStatus.Accepted); // When Object payload = communicator.packPayload(confirmation); diff --git a/ocpp-v1_6-soap/src/main/java/eu/chargetime/ocpp/TimeoutSessionDecorator.java b/ocpp-v1_6-soap/src/main/java/eu/chargetime/ocpp/TimeoutSessionDecorator.java index 140fe97c7..9a20b71ee 100644 --- a/ocpp-v1_6-soap/src/main/java/eu/chargetime/ocpp/TimeoutSessionDecorator.java +++ b/ocpp-v1_6-soap/src/main/java/eu/chargetime/ocpp/TimeoutSessionDecorator.java @@ -38,7 +38,12 @@ public class TimeoutSessionDecorator implements ISession { private TimeoutTimer timeoutTimer; private final ISession session; - /** Handles required injections. */ + /** + * Handles required injections. + * + * @param timeoutTimer the {@link TimeoutTimer} to use + * @param session the {@link ISession} to decorate + */ public TimeoutSessionDecorator(TimeoutTimer timeoutTimer, ISession session) { this.timeoutTimer = timeoutTimer; this.session = session; diff --git a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/DummyHandlers.java b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/DummyHandlers.java index 064206720..7c2fe8661 100644 --- a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/DummyHandlers.java +++ b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/DummyHandlers.java @@ -48,6 +48,7 @@ of this software and associated documentation files (the "Software"), to deal import java.util.UUID; import java.util.function.BiConsumer; +@SuppressWarnings("deprecation") public class DummyHandlers { private boolean riggedToFail; @@ -279,6 +280,7 @@ public boolean wasLatestRequest(Type requestType) { && requestType.equals(receivedRequest.getClass()); } + @SuppressWarnings("unchecked") public T getReceivedRequest(Class clazz) { return wasLatestRequest(clazz) ? (T) receivedRequest : null; } @@ -289,6 +291,7 @@ public boolean wasLatestConfirmation(Type confirmationType) { && confirmationType.equals(receivedConfirmation.getClass()); } + @SuppressWarnings("unchecked") public T getReceivedConfirmation(Class clazz) { return wasLatestConfirmation(clazz) ? (T) receivedConfirmation : null; } diff --git a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java index 7ba22ef82..e05a2f6e5 100644 --- a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java +++ b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java @@ -52,6 +52,7 @@ of this software and associated documentation files (the "Software"), to deal import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@SuppressWarnings("deprecation") public class FakeCentralSystem { private static final Logger logger = LoggerFactory.getLogger(FakeCentralSystem.class); diff --git a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeChargePoint.java b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeChargePoint.java index bf55a354f..5b1976603 100644 --- a/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeChargePoint.java +++ b/ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/FakeChargePoint.java @@ -49,6 +49,7 @@ of this software and associated documentation files (the "Software"), to deal import java.net.URL; import java.time.ZonedDateTime; +@SuppressWarnings("deprecation") public class FakeChargePoint { final ClientCoreProfile core; final ClientSmartChargingProfile smartCharging; diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerCoreProfile.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerCoreProfile.java index 20f8c75fa..235ec6607 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerCoreProfile.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerCoreProfile.java @@ -97,8 +97,8 @@ public Confirmation handleRequest(UUID sessionIndex, Request request) { /** * Create a {@link ChangeAvailabilityRequest} with required values. * - * @param connectorId integer, must be a non-negative number. * @param type the {@link - * AvailabilityType} of the connector. + * @param type the {@link AvailabilityType} of the connector. + * @param connectorId integer, must be a non-negative number. * @return an instance of {@link ChangeAvailabilityRequest}. * @see ChangeAvailabilityRequest * @see ChangeAvailabilityFeature diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerFirmwareManagementProfile.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerFirmwareManagementProfile.java index 2519a20f0..d561abfa5 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerFirmwareManagementProfile.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/ServerFirmwareManagementProfile.java @@ -88,8 +88,8 @@ public GetDiagnosticsRequest createGetDiagnosticsRequest(String location) { /** * Create a client {@link UpdateFirmwareRequest} with required values. * - * @param location String, a URI with the firmware * @param retrieveDate ZonedDateTime, date and - * time of retrieving + * @param location String, a URI with the firmware + * @param retrieveDate ZonedDateTime, date and time of retrieving * @return an instance of {@link UpdateFirmwareRequest} * @see UpdateFirmwareRequest * @see UpdateFirmwareFeature diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ClientSecurityExtProfile.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ClientSecurityExtProfile.java index 2aec013bc..bcd859dc8 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ClientSecurityExtProfile.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ClientSecurityExtProfile.java @@ -117,6 +117,7 @@ public Confirmation handleRequest(UUID sessionIndex, Request request) { /** * Create a client {@link LogStatusNotificationRequest} with required values. * + * @param status the {@link UploadLogStatusEnumType}. * @return an instance of {@link LogStatusNotificationRequest}. * @see LogStatusNotificationRequest * @see LogStatusNotificationFeature @@ -129,6 +130,8 @@ public LogStatusNotificationRequest createLogStatusNotificationRequest( /** * Create a client {@link SecurityEventNotificationRequest} with required values. * + * @param type the type {@link String} + * @param timestamp the {@link ZonedDateTime} stamp * @return an instance of {@link SecurityEventNotificationRequest} * @see SecurityEventNotificationRequest * @see SecurityEventNotificationFeature @@ -141,6 +144,7 @@ public SecurityEventNotificationRequest createSecurityEventNotificationRequest( /** * Create a client {@link SignCertificateRequest} with required values. * + * @param csr the certificate signing request as a PEM encoded {@link String} * @return an instance of {@link SignCertificateRequest}. * @see SignCertificateRequest * @see SignCertificateFeature @@ -152,6 +156,7 @@ public SignCertificateRequest createSignCertificateRequest(String csr) { /** * Create a client {@link SignedFirmwareStatusNotificationRequest}. * + * @param status the {@link FirmwareStatusEnumType} * @return an instance of {@link SignedFirmwareStatusNotificationRequest} * @see SignedFirmwareStatusNotificationRequest * @see SignedFirmwareStatusNotificationFeature diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ServerSecurityExtProfile.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ServerSecurityExtProfile.java index 0ab3b30c6..ff86fcfa4 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ServerSecurityExtProfile.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/feature/profile/securityext/ServerSecurityExtProfile.java @@ -116,6 +116,7 @@ public Confirmation handleRequest(UUID sessionIndex, Request request) { /** * Create a client {@link CertificateSignedRequest} with required values. * + * @param certificateChain the certificate chain as a PEM encoded {@link String} * @return an instance of {@link CertificateSignedRequest} * @see CertificateSignedRequest * @see CertificateSignedFeature @@ -127,6 +128,7 @@ public CertificateSignedRequest createCertificateSignedRequest(String certificat /** * Create a client {@link DeleteCertificateRequest} with required values. * + * @param certificateHashData the {@link CertificateHashDataType} * @return an instance of {@link DeleteCertificateRequest} * @see DeleteCertificateRequest * @see DeleteCertificateFeature @@ -139,6 +141,7 @@ public DeleteCertificateRequest createDeleteCertificateRequest( /** * Create a client {@link ExtendedTriggerMessageFeature}. * + * @param requestedMessage the {@link MessageTriggerEnumType} * @return an instance of {@link ExtendedTriggerMessageRequest} * @see ExtendedTriggerMessageRequest * @see ExtendedTriggerMessageFeature @@ -151,6 +154,7 @@ public ExtendedTriggerMessageRequest createExtendedTriggerMessageRequest( /** * Create a client {@link GetInstalledCertificateIdsRequest} required values. * + * @param certificateType the {@link CertificateUseEnumType} * @return an instance of {@link GetInstalledCertificateIdsRequest} * @see GetInstalledCertificateIdsRequest * @see GetInstalledCertificateIdsFeature @@ -163,6 +167,9 @@ public GetInstalledCertificateIdsRequest createGetInstalledCertificateIdsRequest /** * Create a client {@link GetLogRequest}. * + * @param logType the {@link LogEnumType} + * @param requestId the request identifier + * @param log the {@link LogParametersType} * @return an instance of {@link GetLogRequest} * @see GetLogRequest * @see GetLogFeature @@ -175,6 +182,8 @@ public GetLogRequest createGetLogRequest( /** * Create a client {@link InstallCertificateRequest} with required values. * + * @param certificateType the {@link CertificateUseEnumType} + * @param certificate the certificate as a PEM encoded {@link String} * @return an instance of {@link InstallCertificateRequest} * @see InstallCertificateRequest * @see InstallCertificateFeature @@ -187,6 +196,8 @@ public InstallCertificateRequest createInstallCertificateRequest( /** * Create a client {@link SignedUpdateFirmwareRequest} with required values. * + * @param requestId the request identifier + * @param firmware the {@link FirmwareType} * @return an instance of {@link SignedUpdateFirmwareRequest} * @see SignedUpdateFirmwareRequest * @see SignedUpdateFirmwareFeature diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/ChangeAvailabilityConfirmation.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/ChangeAvailabilityConfirmation.java index 191d7e477..b508ef530 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/ChangeAvailabilityConfirmation.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/core/ChangeAvailabilityConfirmation.java @@ -46,6 +46,7 @@ public class ChangeAvailabilityConfirmation extends Confirmation { * @deprecated use {@link #ChangeAvailabilityConfirmation(AvailabilityStatus)} to be sure to set * required fields */ + @Deprecated public ChangeAvailabilityConfirmation() {} /** diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/CertificateSignedRequest.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/CertificateSignedRequest.java index 31602ae8d..9fd807c90 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/CertificateSignedRequest.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/CertificateSignedRequest.java @@ -35,7 +35,7 @@ of this software and associated documentation files (the "Software"), to deal public class CertificateSignedRequest extends RequestWithId { - private static final transient Validator certificateChainValidator = + private static final Validator certificateChainValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(10000)) .setRequired(true) diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/GetLogConfirmation.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/GetLogConfirmation.java index 93e89180c..01928dfcc 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/GetLogConfirmation.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/GetLogConfirmation.java @@ -37,7 +37,7 @@ of this software and associated documentation files (the "Software"), to deal public class GetLogConfirmation extends Confirmation { - private static final transient Validator filenameValidator = + private static final Validator filenameValidator = new ValidatorBuilder().addRule(new StringMaxLengthValidationRule(255)).build(); private LogStatusEnumType status; diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/InstallCertificateRequest.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/InstallCertificateRequest.java index 1dadd6500..ab0b50c5a 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/InstallCertificateRequest.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/InstallCertificateRequest.java @@ -36,7 +36,7 @@ of this software and associated documentation files (the "Software"), to deal public class InstallCertificateRequest extends RequestWithId { - private static final transient Validator certificateValidator = + private static final Validator certificateValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(5500)) .setRequired(true) diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SecurityEventNotificationRequest.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SecurityEventNotificationRequest.java index 44fd2318e..787c8fe2e 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SecurityEventNotificationRequest.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SecurityEventNotificationRequest.java @@ -36,13 +36,13 @@ of this software and associated documentation files (the "Software"), to deal public class SecurityEventNotificationRequest extends RequestWithId { - private static final transient Validator typeValidator = + private static final Validator typeValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(50)) .setRequired(true) .build(); - private static final transient Validator techInfoValidator = + private static final Validator techInfoValidator = new ValidatorBuilder().addRule(new StringMaxLengthValidationRule(255)).build(); private String type; diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SignCertificateRequest.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SignCertificateRequest.java index ee5eb9406..70a95ace8 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SignCertificateRequest.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/SignCertificateRequest.java @@ -35,7 +35,7 @@ of this software and associated documentation files (the "Software"), to deal public class SignCertificateRequest extends RequestWithId { - private static final transient Validator csrValidator = + private static final Validator csrValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(5500)) .setRequired(true) diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/CertificateHashDataType.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/CertificateHashDataType.java index bb7a6c532..0ce3bed0e 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/CertificateHashDataType.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/CertificateHashDataType.java @@ -35,14 +35,14 @@ of this software and associated documentation files (the "Software"), to deal import java.util.Objects; public class CertificateHashDataType implements Validatable { - private static final transient Validator identifierString128Validator = + private static final Validator identifierString128Validator = new ValidatorBuilder() .addRule(OCPPSecurityExtDatatypes.identifierString()) .addRule(new StringMaxLengthValidationRule(128)) .setRequired(true) .build(); - private static final transient Validator serialNumberValidator = + private static final Validator serialNumberValidator = new ValidatorBuilder().addRule(OCPPSecurityExtDatatypes.string40()).setRequired(true).build(); private HashAlgorithmEnumType hashAlgorithm; diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/FirmwareType.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/FirmwareType.java index 5c9f81036..5ff23abd2 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/FirmwareType.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/FirmwareType.java @@ -41,19 +41,19 @@ of this software and associated documentation files (the "Software"), to deal * used by {@link SignedUpdateFirmwareRequest} */ public class FirmwareType implements Validatable { - private static final transient Validator locationValidator = + private static final Validator locationValidator = new ValidatorBuilder() .addRule(OCPPSecurityExtDatatypes.string512()) .setRequired(true) .build(); - private static final transient Validator signingCertificateValidator = + private static final Validator signingCertificateValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(5500)) .setRequired(true) .build(); - private static final transient Validator signatureValidator = + private static final Validator signatureValidator = new ValidatorBuilder() .addRule(new StringMaxLengthValidationRule(800)) .setRequired(true) diff --git a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/LogParametersType.java b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/LogParametersType.java index 3c51ccc57..fffeb1011 100644 --- a/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/LogParametersType.java +++ b/ocpp-v1_6/src/main/java/eu/chargetime/ocpp/model/securityext/types/LogParametersType.java @@ -35,7 +35,7 @@ of this software and associated documentation files (the "Software"), to deal import java.util.Objects; public class LogParametersType implements Validatable { - private static final transient Validator remoteLocationValidator = + private static final Validator remoteLocationValidator = new ValidatorBuilder() .addRule(OCPPSecurityExtDatatypes.string512()) .setRequired(true) diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientCoreProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientCoreProfileTest.java index d0c73ae61..b13b4b463 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientCoreProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientCoreProfileTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.feature.*; @@ -48,6 +48,7 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class ClientCoreProfileTest extends ProfileTest { private static final UUID SESSION_NULL = null; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientFirmwareManagementProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientFirmwareManagementProfileTest.java index dc18611e1..d26e6ad0c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientFirmwareManagementProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientFirmwareManagementProfileTest.java @@ -27,8 +27,8 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientLocalAuthListProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientLocalAuthListProfileTest.java index 2c6837a40..aa3bbfe46 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientLocalAuthListProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientLocalAuthListProfileTest.java @@ -27,7 +27,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientRemoteTriggerProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientRemoteTriggerProfileTest.java index b5055d5fd..230a5b016 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientRemoteTriggerProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientRemoteTriggerProfileTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.feature.profile.test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.feature.profile.ClientRemoteTriggerEventHandler; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientReservationProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientReservationProfileTest.java index dcc33dd97..2564d4448 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientReservationProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientReservationProfileTest.java @@ -28,8 +28,8 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientSmartChargingProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientSmartChargingProfileTest.java index 31378f1f8..3ac48284f 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientSmartChargingProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ClientSmartChargingProfileTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.feature.profile.test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.feature.profile.ClientSmartChargingEventHandler; @@ -44,6 +44,7 @@ */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class ClientSmartChargingProfileTest { private static final UUID SESSION_NULL = null; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerCoreProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerCoreProfileTest.java index 576847456..7886d9469 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerCoreProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerCoreProfileTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerFirmwareManagementProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerFirmwareManagementProfileTest.java index 7ce1e3b73..48ce02b16 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerFirmwareManagementProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerFirmwareManagementProfileTest.java @@ -27,7 +27,7 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerLocalAuthListProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerLocalAuthListProfileTest.java index be68e20a1..eff720cf1 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerLocalAuthListProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerLocalAuthListProfileTest.java @@ -27,7 +27,7 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.feature.Feature; import eu.chargetime.ocpp.feature.GetLocalListVersionFeature; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerRemoteTriggerProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerRemoteTriggerProfileTest.java index f9fcc9f86..b70a42c17 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerRemoteTriggerProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerRemoteTriggerProfileTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.feature.Feature; import eu.chargetime.ocpp.feature.TriggerMessageFeature; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerReservationProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerReservationProfileTest.java index 47bbcae17..be33896af 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerReservationProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerReservationProfileTest.java @@ -27,8 +27,8 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import eu.chargetime.ocpp.feature.*; import eu.chargetime.ocpp.feature.profile.ServerReservationProfile; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerSmartChargingProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerSmartChargingProfileTest.java index 582972935..e5c13747d 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerSmartChargingProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/feature/profile/test/ServerSmartChargingProfileTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.feature.ClearChargingProfileFeature; import eu.chargetime.ocpp.feature.Feature; @@ -43,6 +43,7 @@ */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class ServerSmartChargingProfileTest extends ProfileTest { private ServerSmartChargingProfile smartCharging; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/core/test/BootNotificationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/core/test/BootNotificationRequestTest.java index fe49393e5..f4566a9fa 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/core/test/BootNotificationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/core/test/BootNotificationRequestTest.java @@ -31,6 +31,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class BootNotificationRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationConfirmationTest.java index 5dd34e673..ff2b823d8 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationConfirmationTest.java @@ -25,8 +25,8 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import eu.chargetime.ocpp.model.firmware.DiagnosticsStatusNotificationConfirmation; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationRequestTest.java index ef67035d7..1129d14b6 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/DiagnosticsStatusNotificationRequestTest.java @@ -28,7 +28,7 @@ of this software and associated documentation files (the "Software"), to deal import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.firmware.DiagnosticsStatus; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class DiagnosticsStatusNotificationRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationConfirmationTest.java index c679f1c88..3b3412006 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationConfirmationTest.java @@ -26,8 +26,8 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import eu.chargetime.ocpp.model.firmware.FirmwareStatusNotificationConfirmation; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationRequestTest.java index d2e8291e3..d1a4c869e 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/FirmwareStatusNotificationRequestTest.java @@ -29,7 +29,7 @@ of this software and associated documentation files (the "Software"), to deal import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.firmware.FirmwareStatus; @@ -39,6 +39,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class FirmwareStatusNotificationRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsConfirmationTest.java index 7239ed68a..4b1dd5079 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsConfirmationTest.java @@ -28,8 +28,8 @@ of this software and associated documentation files (the "Software"), to deal import static eu.chargetime.ocpp.utilities.TestUtilities.aString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.firmware.GetDiagnosticsConfirmation; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class GetDiagnosticsConfirmationTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsRequestTest.java index 51c96a3bb..143bb9aef 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/GetDiagnosticsRequestTest.java @@ -28,7 +28,7 @@ of this software and associated documentation files (the "Software"), to deal import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.firmware.GetDiagnosticsRequest; @@ -37,6 +37,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class GetDiagnosticsRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareConfirmationTest.java index 1d6d6cc69..0188d0aa8 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareConfirmationTest.java @@ -26,8 +26,8 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import eu.chargetime.ocpp.model.firmware.UpdateFirmwareConfirmation; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareRequestTest.java index 09e486c31..33c95e681 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/firmware/test/UpdateFirmwareRequestTest.java @@ -28,7 +28,7 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.firmware.UpdateFirmwareRequest; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class UpdateFirmwareRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionConfirmationTest.java index 326a1d132..1cb34d66c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.localauthlist.GetLocalListVersionConfirmation; @@ -14,6 +14,7 @@ import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class GetLocalListVersionConfirmationTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionRequestTest.java index 1e0541d67..99ab6ff31 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/GetLocalListVersionRequestTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.localauthlist.GetLocalListVersionRequest; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListConfirmationTest.java index c106aa1dc..66e0464e6 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.localauthlist.SendLocalListConfirmation; @@ -15,6 +15,7 @@ import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class SendLocalListConfirmationTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListRequestTest.java index 371a961ab..b9caabc94 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/localauthlist/test/SendLocalListRequestTest.java @@ -3,7 +3,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aList; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -23,6 +23,7 @@ import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class SendLocalListRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationConfirmationTest.java index b4e34d4d9..f7c82fa21 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationConfirmationTest.java @@ -27,13 +27,14 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.reservation.CancelReservationConfirmation; import eu.chargetime.ocpp.model.reservation.CancelReservationStatus; import org.junit.Before; import org.junit.Test; +@SuppressWarnings("deprecation") public class CancelReservationConfirmationTest { private CancelReservationConfirmation request; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationRequestTest.java index 638404637..cf0d53ac2 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/CancelReservationRequestTest.java @@ -27,12 +27,13 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.reservation.CancelReservationRequest; import org.junit.Before; import org.junit.Test; +@SuppressWarnings("deprecation") public class CancelReservationRequestTest { private CancelReservationRequest request; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowConfirmationTest.java index bc8e8e07d..fe3680352 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowConfirmationTest.java @@ -26,7 +26,7 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.reservation.ReservationStatus; import eu.chargetime.ocpp.model.reservation.ReserveNowConfirmation; @@ -34,6 +34,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Before; import org.junit.Test; +@SuppressWarnings("deprecation") public class ReserveNowConfirmationTest { private ReserveNowConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowRequestTest.java index 3133b0244..d8c3c1dce 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/reservation/test/ReserveNowRequestTest.java @@ -28,7 +28,7 @@ of this software and associated documentation files (the "Software"), to deal */ import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.reservation.ReserveNowRequest; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class ReserveNowRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/smartcharging/ClearChargingProfileRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/smartcharging/ClearChargingProfileRequestTest.java index 7485ba5f1..054776063 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/smartcharging/ClearChargingProfileRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/smartcharging/ClearChargingProfileRequestTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import org.junit.Before; @@ -11,6 +11,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class ClearChargingProfileRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeConfirmationTest.java index 9f3e63967..a32514c49 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeConfirmationTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -40,6 +40,7 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class AuthorizeConfirmationTest { AuthorizeConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeRequestTest.java index ef557dfd0..3fdf5f23c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/AuthorizeRequestTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.AuthorizeRequest; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@SuppressWarnings("deprecation") public class AuthorizeRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationConfirmationTest.java index 86f01a043..5fc9b43d2 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationConfirmationTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.BootNotificationConfirmation; @@ -42,6 +42,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@SuppressWarnings("deprecation") public class BootNotificationConfirmationTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationRequestTest.java index 455b30ac5..441185ef2 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/BootNotificationRequestTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.BootNotificationRequest; @@ -38,6 +38,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@SuppressWarnings("deprecation") public class BootNotificationRequestTest { private static final String EXCEPTION_MESSAGE_TEMPLATE = diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityConfirmationTest.java index 22afa9e26..c913f2231 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.AvailabilityStatus; import eu.chargetime.ocpp.model.core.ChangeAvailabilityConfirmation; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChangeAvailabilityConfirmationTest { private ChangeAvailabilityConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityRequestTest.java index ea3722070..5786846de 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeAvailabilityRequestTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.AvailabilityType; @@ -38,6 +38,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChangeAvailabilityRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationConfirmationTest.java index 4158655cf..497d563fb 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.ChangeConfigurationConfirmation; import eu.chargetime.ocpp.model.core.ConfigurationStatus; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChangeConfigurationConfirmationTest { ChangeConfigurationConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationRequestTest.java index 2f8eca303..1697c3e6e 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChangeConfigurationRequestTest.java @@ -4,7 +4,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.ChangeConfigurationRequest; @@ -39,6 +39,7 @@ * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChangeConfigurationRequestTest { private static final String EXCEPTION_MESSAGE_TEMPLATE = diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingProfileTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingProfileTest.java index 0d2aa437d..11fd07e1c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingProfileTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingProfileTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -39,6 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChargingProfileTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingSchedulePeriodTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingSchedulePeriodTest.java index 6a85e21fb..5954d19f5 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingSchedulePeriodTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingSchedulePeriodTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.ChargingSchedulePeriod; import org.junit.Before; @@ -33,6 +33,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChargingSchedulePeriodTest { ChargingSchedulePeriod chargingSchedulePeriod; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingScheduleTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingScheduleTest.java index 2088c6b8a..d50a5b9b7 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingScheduleTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ChargingScheduleTest.java @@ -3,7 +3,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aList; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.model.core.ChargingRateUnitType; @@ -39,6 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ChargingScheduleTest { ChargingSchedule chargingSchedule; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheConfirmationTest.java index 0096958e8..669cec4a7 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.ClearCacheConfirmation; import eu.chargetime.ocpp.model.core.ClearCacheStatus; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ClearCacheConfirmationTest { ClearCacheConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheRequestTest.java index 823b5ef01..7c769096f 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ClearCacheRequestTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.ClearCacheRequest; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferConfirmationTest.java index 62fdee948..f2787b7ee 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.DataTransferConfirmation; import eu.chargetime.ocpp.model.core.DataTransferStatus; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class DataTransferConfirmationTest { DataTransferConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferRequestTest.java index 63aa8d94d..ab1df13e7 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/DataTransferRequestTest.java @@ -27,7 +27,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aString; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.DataTransferRequest; @@ -36,6 +36,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; +@SuppressWarnings("deprecation") public class DataTransferRequestTest { private static final String EXCEPTION_MESSAGE_TEMPLATE = diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetCompositeScheduleRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetCompositeScheduleRequestTest.java index 3d6d4b717..bbafe2cff 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetCompositeScheduleRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetCompositeScheduleRequestTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.smartcharging.ChargingRateUnitType; @@ -40,6 +40,7 @@ * SOFTWARE. */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class GetCompositeScheduleRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationConfirmationTest.java index 6e31752d2..77a28ba7a 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationConfirmationTest.java @@ -44,6 +44,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class GetConfigurationConfirmationTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationRequestTest.java index 5a03e229d..ba4ef15ab 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/GetConfigurationRequestTest.java @@ -5,7 +5,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.GetConfigurationRequest; @@ -39,6 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class GetConfigurationRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatConfirmationTest.java index 18677492b..d1198ec7c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.HeartbeatConfirmation; import java.time.ZonedDateTime; @@ -35,6 +35,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class HeartbeatConfirmationTest { HeartbeatConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatRequestTest.java index 5bf14f3f2..7ea997dc8 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/HeartbeatRequestTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.HeartbeatRequest; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/IdTagInfoTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/IdTagInfoTest.java index 7a8989a5f..595befcbb 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/IdTagInfoTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/IdTagInfoTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.AuthorizationStatus; import eu.chargetime.ocpp.model.core.IdTagInfo; @@ -34,6 +34,7 @@ of this software and associated documentation files (the "Software"), to deal OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +@SuppressWarnings("deprecation") public class IdTagInfoTest { private IdTagInfo idTagInfo; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/KeyValueTypeTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/KeyValueTypeTest.java index 3ff6eb377..5a2b2af7c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/KeyValueTypeTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/KeyValueTypeTest.java @@ -4,7 +4,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.KeyValueType; @@ -38,6 +38,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class KeyValueTypeTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValueTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValueTest.java index d45c19fa1..ada5af66e 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValueTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValueTest.java @@ -3,7 +3,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aList; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.model.core.MeterValue; @@ -42,6 +42,7 @@ * SOFTWARE. */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class MeterValueTest { private MeterValue meterValue; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesConfirmationTest.java index bf781fb2b..f3ce041ae 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesConfirmationTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.MeterValuesConfirmation; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesRequestTest.java index 35578a927..bdf365dfb 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/MeterValuesRequestTest.java @@ -2,7 +2,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aList; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.PropertyConstraintException; @@ -43,6 +43,7 @@ * SOFTWARE. */ @RunWith(MockitoJUnitRunner.class) +@SuppressWarnings("deprecation") public class MeterValuesRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionConfirmationTest.java index 3be71cfcf..7e52a57e2 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.RemoteStartStopStatus; import eu.chargetime.ocpp.model.core.RemoteStartTransactionConfirmation; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class RemoteStartTransactionConfirmationTest { RemoteStartTransactionConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionRequestTest.java index fbbd3c7f1..f6fba5dcd 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStartTransactionRequestTest.java @@ -4,7 +4,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -42,6 +42,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class RemoteStartTransactionRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionConfirmationTest.java index a4a971f5c..0a7844f2f 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.RemoteStartStopStatus; import eu.chargetime.ocpp.model.core.RemoteStopTransactionConfirmation; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class RemoteStopTransactionConfirmationTest { RemoteStopTransactionConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionRequestTest.java index b875634c9..dfeb4351f 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/RemoteStopTransactionRequestTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.RemoteStopTransactionRequest; import org.junit.Before; @@ -33,6 +33,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class RemoteStopTransactionRequestTest { RemoteStopTransactionRequest request; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetConfirmationTest.java index 8325cc238..7aaa2fb29 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetConfirmationTest.java @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ResetConfirmationTest { ResetConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetRequestTest.java index 497e49043..3c2c464ec 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/ResetRequestTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.ResetRequest; import eu.chargetime.ocpp.model.core.ResetType; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class ResetRequestTest { ResetRequest request; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SampledValueTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SampledValueTest.java index b1c7a98bc..f7fe20cc1 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SampledValueTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SampledValueTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.Location; @@ -39,6 +39,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class SampledValueTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileConfirmationTest.java index c1d0b2c86..b9a98c082 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.smartcharging.ChargingProfileStatus; import eu.chargetime.ocpp.model.smartcharging.SetChargingProfileConfirmation; @@ -35,6 +35,7 @@ * SOFTWARE. */ +@SuppressWarnings("deprecation") public class SetChargingProfileConfirmationTest { SetChargingProfileConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileRequestTest.java index b51f33560..93f1c8aa5 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/SetChargingProfileRequestTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.smartcharging.SetChargingProfileRequest; @@ -37,6 +37,7 @@ * SOFTWARE. */ +@SuppressWarnings("deprecation") public class SetChargingProfileRequestTest { private static final String EXPECTED_ERROR_MESSAGE = diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionConfirmationTest.java index 69142d461..723762a4f 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.model.core.IdTagInfo; @@ -35,6 +35,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class StartTransactionConfirmationTest { StartTransactionConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionRequestTest.java index a74a3c213..be9ffc4a3 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StartTransactionRequestTest.java @@ -2,7 +2,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aString; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.StartTransactionRequest; @@ -38,6 +38,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class StartTransactionRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationConfirmationTest.java index 44304222b..831422eb0 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationConfirmationTest.java @@ -1,7 +1,7 @@ package eu.chargetime.ocpp.model.test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.StatusNotificationConfirmation; import org.junit.Before; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationRequestTest.java index 1fca0829e..6d7ea59bc 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StatusNotificationRequestTest.java @@ -2,7 +2,7 @@ import static eu.chargetime.ocpp.utilities.TestUtilities.aString; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.ChargePointErrorCode; @@ -40,6 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class StatusNotificationRequestTest { private static final String EXCEPTION_MESSAGE_TEMPLATE = diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionConfirmationTest.java index 040e7c1d2..ddde7393c 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.*; import eu.chargetime.ocpp.model.core.IdTagInfo; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionRequestTest.java index e70f40402..240132c46 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/StopTransactionRequestTest.java @@ -43,6 +43,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class StopTransactionRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); @@ -210,6 +211,6 @@ public void isTransactionRelated_returnsFalse() { boolean isTransactionRelated = request.transactionRelated(); // Then - Assert.assertThat(isTransactionRelated, is(true)); + assertThat(isTransactionRelated, is(true)); } } diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageConfirmationTest.java index e2051881b..e5551e48d 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageConfirmationTest.java @@ -2,13 +2,14 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageConfirmation; import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageStatus; import org.junit.Before; import org.junit.Test; +@SuppressWarnings("deprecation") public class TriggerMessageConfirmationTest { TriggerMessageConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageRequestTest.java index c4a2f925e..e0dc5ee26 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/TriggerMessageRequestTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageRequest; @@ -39,6 +39,7 @@ of this software and associated documentation files (the "Software"), to deal SOFTWARE. */ +@SuppressWarnings("deprecation") public class TriggerMessageRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorConfirmationTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorConfirmationTest.java index cc25f33bf..fe5b2b25e 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorConfirmationTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorConfirmationTest.java @@ -2,7 +2,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.model.core.UnlockConnectorConfirmation; import eu.chargetime.ocpp.model.core.UnlockStatus; @@ -34,6 +34,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class UnlockConnectorConfirmationTest { UnlockConnectorConfirmation confirmation; diff --git a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorRequestTest.java b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorRequestTest.java index 5af36dd9e..d6e842041 100644 --- a/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorRequestTest.java +++ b/ocpp-v1_6/src/test/java/eu/chargetime/ocpp/model/test/UnlockConnectorRequestTest.java @@ -3,7 +3,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import eu.chargetime.ocpp.PropertyConstraintException; import eu.chargetime.ocpp.model.core.UnlockConnectorRequest; @@ -37,6 +37,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +@SuppressWarnings("deprecation") public class UnlockConnectorRequestTest { @Rule public ExpectedException thrownException = ExpectedException.none(); diff --git a/pom.xml b/pom.xml index 8dcf543f5..c764cf49e 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,9 @@ 1.8 1.8 + + -Xlint:all + 3.14.1 diff --git a/settings.gradle b/settings.gradle index d5b6f617f..8604de7a3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,8 @@ rootProject.name = 'java-oca-ocpp' +enableFeaturePreview('STABLE_PUBLISHING') + include(':ocpp16') include(':ocpp16j') include(':ocpp16s')