diff --git a/core/src/test/java/uk/gov/gchq/koryphe/binaryoperator/BinaryOperatorTest.java b/core/src/test/java/uk/gov/gchq/koryphe/binaryoperator/BinaryOperatorTest.java index d4c845d4..dd799ed8 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/binaryoperator/BinaryOperatorTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/binaryoperator/BinaryOperatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 Crown Copyright + * Copyright 2017-2022 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package uk.gov.gchq.koryphe.binaryoperator; import org.junit.jupiter.api.Test; - import uk.gov.gchq.koryphe.Since; import uk.gov.gchq.koryphe.Summary; import uk.gov.gchq.koryphe.util.EqualityTest; @@ -66,14 +65,14 @@ public void shouldHaveSinceAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation.value()) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(VersionUtil.validateVersionString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } @Test @@ -86,13 +85,13 @@ public void shouldHaveSummaryAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation.value()) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(SummaryUtil.validateSummaryString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } } diff --git a/core/src/test/java/uk/gov/gchq/koryphe/function/FunctionTest.java b/core/src/test/java/uk/gov/gchq/koryphe/function/FunctionTest.java index e7fa2d79..8acf3369 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/function/FunctionTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/function/FunctionTest.java @@ -72,14 +72,14 @@ public void shouldHaveSinceAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation.value()) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(VersionUtil.validateVersionString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } @Test @@ -92,14 +92,14 @@ public void shouldHaveSummaryAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation.value()) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(SummaryUtil.validateSummaryString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } @Test diff --git a/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/AbstractInTimeRangeDualTest.java b/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/AbstractInTimeRangeDualTest.java index 404883f5..4faa84ef 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/AbstractInTimeRangeDualTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/AbstractInTimeRangeDualTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 Crown Copyright + * Copyright 2017-2022 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -590,8 +590,8 @@ protected void testValues(final boolean expectedResult, final List values, // Then for (int i = 0; i < values.size(); i++) { assertThat(results.get(i)) - .isEqualTo(expectedResult) - .withFailMessage("Failed for value: %s", values.get(i)); + .withFailMessage("Failed for value: %s", values.get(i)) + .isEqualTo(expectedResult); } } diff --git a/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/InRangeDualTest.java b/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/InRangeDualTest.java index 39b98562..59a7c791 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/InRangeDualTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/impl/predicate/range/InRangeDualTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 Crown Copyright + * Copyright 2017-2022 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -454,8 +454,8 @@ protected void testValues(final boolean expectedResult, final List values, // Then for (int i = 0; i < values.size(); i++) { assertThat(results.get(i)) - .isEqualTo(expectedResult) - .withFailMessage("Failed for value: %s", values.get(i)); + .withFailMessage("Failed for value: %s", values.get(i)) + .isEqualTo(expectedResult); } } } diff --git a/core/src/test/java/uk/gov/gchq/koryphe/predicate/PredicateTest.java b/core/src/test/java/uk/gov/gchq/koryphe/predicate/PredicateTest.java index edac633d..157eac75 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/predicate/PredicateTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/predicate/PredicateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2021 Crown Copyright + * Copyright 2017-2022 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,14 +57,14 @@ public void shouldHaveSinceAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Since annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(VersionUtil.validateVersionString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } @Test @@ -77,13 +77,13 @@ public void shouldHaveSummaryAnnotation() { // Then assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(annotation) - .isNotNull() - .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()); + .withFailMessage("Missing Summary annotation on class %s", instance.getClass().getName()) + .isNotNull(); assertThat(SummaryUtil.validateSummaryString(annotation.value())) - .isTrue() - .withFailMessage("%s is not a valid value string.", annotation.value()); + .withFailMessage("%s is not a valid value string.", annotation.value()) + .isTrue(); } } diff --git a/core/src/test/java/uk/gov/gchq/koryphe/util/DateUtilTest.java b/core/src/test/java/uk/gov/gchq/koryphe/util/DateUtilTest.java index cfea7a2a..da61267c 100644 --- a/core/src/test/java/uk/gov/gchq/koryphe/util/DateUtilTest.java +++ b/core/src/test/java/uk/gov/gchq/koryphe/util/DateUtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 Crown Copyright + * Copyright 2016-2022 Crown Copyright * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,7 +104,7 @@ public void shouldNotParseInvalidDate() { private void assertDate(final String expected, final String testDate, final String format) throws ParseException { final Date expectedDate = DateUtils.parseDate(expected, Locale.getDefault(), format); assertThat(DateUtil.parse(testDate)) - .isEqualTo(expectedDate) - .withFailMessage("Failed to parse date: %s", testDate); + .withFailMessage("Failed to parse date: %s", testDate) + .isEqualTo(expectedDate); } }