From fefacc645e87a1a7251c8005b3d17d8b408b432d Mon Sep 17 00:00:00 2001 From: Thomas Perkins Date: Thu, 5 Mar 2020 17:04:51 +0000 Subject: [PATCH 1/4] Add dcover tests for "waltz-common" Coverage: 44.7% --- .../waltz/common/AliasesDiffblueTest.java | 16 ++ .../common/ArrayUtilitiesDiffblueTest.java | 37 +++++ .../waltz/common/ChecksDiffblueTest.java | 18 +++ .../CollectionUtilitiesDiffblueTest.java | 75 ++++++++++ .../common/DebugUtilitiesDiffblueTest.java | 30 ++++ .../common/DigestUtilitiesDiffblueTest.java | 19 +++ .../waltz/common/IOUtilitiesDiffblueTest.java | 46 ++++++ .../common/ListUtilitiesDiffblueTest.java | 91 ++++++++++++ .../waltz/common/MapBuilderDiffblueTest.java | 35 +++++ .../common/MapUtilitiesDiffblueTest.java | 91 ++++++++++++ .../common/ObjectUtilitiesDiffblueTest.java | 19 +++ .../common/RandomUtilitiesDiffblueTest.java | 67 +++++++++ .../waltz/common/RangeBandDiffblueTest.java | 62 ++++++++ .../common/SetUtilitiesDiffblueTest.java | 98 ++++++++++++ .../common/StringUtilitiesDiffblueTest.java | 139 ++++++++++++++++++ .../common/XmlUtilitiesDiffblueTest.java | 25 ++++ .../DuplicateKeyExceptionDiffblueTest.java | 32 ++++ ...ficientPrivelegeExceptionDiffblueTest.java | 23 +++ .../NotFoundExceptionDiffblueTest.java | 19 +++ .../UpdateFailedExceptionDiffblueTest.java | 19 +++ .../common/hierarchy/ForestDiffblueTest.java | 37 +++++ .../HierarchyUtilitiesDiffblueTest.java | 43 ++++++ .../common/hierarchy/NodeDiffblueTest.java | 56 +++++++ 23 files changed, 1097 insertions(+) create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/AliasesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/ArrayUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/ChecksDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/CollectionUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/DebugUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/DigestUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/IOUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/ListUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/MapBuilderDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/MapUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/ObjectUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/RandomUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/RangeBandDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/SetUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/StringUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/XmlUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/exception/NotFoundExceptionDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/ForestDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesDiffblueTest.java create mode 100644 waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/NodeDiffblueTest.java diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/AliasesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/AliasesDiffblueTest.java new file mode 100644 index 0000000000..a806b47918 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/AliasesDiffblueTest.java @@ -0,0 +1,16 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class AliasesDiffblueTest { + @Test + public void registerTest() { + // Arrange + Aliases aliases = new Aliases(); + + // Act and Assert + assertSame(aliases, aliases.register("val", "foo", "foo", "foo")); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/ArrayUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/ArrayUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..9c1b762541 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/ArrayUtilitiesDiffblueTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import java.util.Arrays; +import org.junit.Test; + +public class ArrayUtilitiesDiffblueTest { + @Test + public void initialTest() { + // Arrange, Act and Assert + assertEquals(2, ArrayUtilities.initial(new Object[]{"foo", "foo", "foo"}).length); + } + + @Test + public void isEmptyTest() { + // Arrange, Act and Assert + assertFalse(ArrayUtilities.isEmpty(new Object[]{"foo", "foo", "foo"})); + } + + @Test + public void lastTest() { + // Arrange, Act and Assert + assertEquals("foo", ArrayUtilities.last(new Object[]{"foo", "foo", "foo"})); + } + + @Test + public void sumTest() { + // Arrange + int[] intArray = new int[8]; + Arrays.fill(intArray, 1); + + // Act and Assert + assertEquals(8, ArrayUtilities.sum(intArray)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/ChecksDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/ChecksDiffblueTest.java new file mode 100644 index 0000000000..d9b8cf4b40 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/ChecksDiffblueTest.java @@ -0,0 +1,18 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class ChecksDiffblueTest { + @Test + public void checkNotEmptyTest() { + // Arrange, Act and Assert + assertEquals("str", Checks.checkNotEmpty("str", "message")); + } + @Test + public void checkNotNullTest() { + // Arrange, Act and Assert + assertEquals("", Checks.checkNotNull("", "message", "foo", "", "foo")); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/CollectionUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/CollectionUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..dbf22dcdb6 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/CollectionUtilitiesDiffblueTest.java @@ -0,0 +1,75 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class CollectionUtilitiesDiffblueTest { + @Test + public void firstTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals("foo", CollectionUtilities.first(objectList)); + } + + @Test + public void isEmptyTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertFalse(CollectionUtilities.isEmpty(objectList)); + } + + @Test + public void notEmptyTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertTrue(CollectionUtilities.notEmpty(objectList)); + } + + @Test + public void sortTest() { + // Arrange + ArrayList resultFloatList = new ArrayList(); + resultFloatList.add(10.0f); + + // Act + List actualSortResult = CollectionUtilities.sort(resultFloatList); + + // Assert + assertEquals(1, actualSortResult.size()); + assertEquals(Float.valueOf(10.0f), actualSortResult.get(0)); + } + + @Test + public void sumIntsTest() { + // Arrange + ArrayList integerList = new ArrayList(); + integerList.add(1); + + // Act and Assert + assertEquals(Long.valueOf(1L), CollectionUtilities.sumInts(integerList)); + } + + @Test + public void sumLongsTest() { + // Arrange + ArrayList resultLongList = new ArrayList(); + resultLongList.add(1L); + + // Act and Assert + assertEquals(Long.valueOf(1L), CollectionUtilities.sumLongs(resultLongList)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/DebugUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/DebugUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..9abd35a80d --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/DebugUtilitiesDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class DebugUtilitiesDiffblueTest { + @Test + public void dumpTest() { + // Arrange + HashMap objectObjectMap = new HashMap(); + objectObjectMap.put("foo", "foo"); + + // Act + Map actualDumpResult = DebugUtilities.dump(objectObjectMap); + + // Assert + assertSame(objectObjectMap, actualDumpResult); + assertEquals(1, actualDumpResult.size()); + } + + @Test + public void logValueTest() { + // Arrange, Act and Assert + assertEquals("result", DebugUtilities.logValue("result", "result", "foo", "result")); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/DigestUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/DigestUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..1dda1c7b5a --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/DigestUtilitiesDiffblueTest.java @@ -0,0 +1,19 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import org.junit.Test; + +public class DigestUtilitiesDiffblueTest { + @Test + public void digestTest() throws NoSuchAlgorithmException { + // Arrange + byte[] byteArray = new byte[24]; + Arrays.fill(byteArray, (byte) 88); + + // Act and Assert + assertEquals("ooseQ9DejG1ltYq+oL/LANK66RQ=", DigestUtilities.digest(byteArray)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/IOUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/IOUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..f1e362b6f1 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/IOUtilitiesDiffblueTest.java @@ -0,0 +1,46 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import java.io.ByteArrayInputStream; +import java.util.Arrays; +import java.util.List; +import org.junit.Test; +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.Resource; + +public class IOUtilitiesDiffblueTest { + @Test + public void getFileResourceTest() { + // Arrange and Act + Resource actualFileResource = IOUtilities.getFileResource("file.txt"); + + // Assert + String actualPath = ((FileSystemResource) actualFileResource).getPath(); + assertEquals("file.txt", actualFileResource.getFilename()); + } + + @Test + public void readAsStringTest() { + // Arrange + byte[] byteArray = new byte[24]; + Arrays.fill(byteArray, (byte) 88); + + // Act and Assert + assertEquals("XXXXXXXXXXXXXXXXXXXXXXXX", IOUtilities.readAsString(new ByteArrayInputStream(byteArray))); + } + + @Test + public void readLinesTest() { + // Arrange + byte[] byteArray = new byte[24]; + Arrays.fill(byteArray, (byte) 88); + + // Act + List actualReadLinesResult = IOUtilities.readLines(new ByteArrayInputStream(byteArray)); + + // Assert + assertEquals(1, actualReadLinesResult.size()); + assertEquals("XXXXXXXXXXXXXXXXXXXXXXXX", actualReadLinesResult.get(0)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/ListUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/ListUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..34a41ea3d8 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/ListUtilitiesDiffblueTest.java @@ -0,0 +1,91 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import java.util.ArrayList; +import org.junit.Test; + +public class ListUtilitiesDiffblueTest { + @Test + public void appendTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(2, ListUtilities.append(objectList, "foo").size()); + } + + @Test + public void asListTest() { + // Arrange, Act and Assert + assertEquals(3, ListUtilities.asList("foo", "foo", "foo").size()); + } + + @Test + public void compactTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, ListUtilities.compact(objectList).size()); + } + + @Test + public void dropTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(0, ListUtilities.drop(objectList, 3).size()); + } + + @Test + public void ensureNotNullTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, ListUtilities.ensureNotNull(objectList).size()); + } + + @Test + public void isEmptyTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertFalse(ListUtilities.isEmpty(objectList)); + } + + @Test + public void newArrayListTest() { + // Arrange, Act and Assert + assertEquals(3, ListUtilities.newArrayList("foo", "foo", "foo").size()); + } + + @Test + public void pushTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(4, ListUtilities.push(objectList, "foo", "foo", "foo").size()); + } + + @Test + public void reverseTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, ListUtilities.reverse(objectList).size()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/MapBuilderDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/MapBuilderDiffblueTest.java new file mode 100644 index 0000000000..f24c9ba176 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/MapBuilderDiffblueTest.java @@ -0,0 +1,35 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.HashMap; +import org.junit.Test; + +public class MapBuilderDiffblueTest { + @Test + public void addTest() { + // Arrange + MapBuilder mapBuilder = new MapBuilder(); + + // Act and Assert + assertSame(mapBuilder, mapBuilder.add("k", "k")); + } + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals(0, (new MapBuilder()).build().size()); + } + + @Test + public void fromTest() { + // Arrange + MapBuilder mapBuilder = new MapBuilder(); + HashMap objectObjectMap = new HashMap(); + objectObjectMap.put("foo", "foo"); + + // Act and Assert + assertSame(mapBuilder, mapBuilder.from(objectObjectMap)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/MapUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/MapUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..a59e2e9ff2 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/MapUtilitiesDiffblueTest.java @@ -0,0 +1,91 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class MapUtilitiesDiffblueTest { + @Test + public void composeTest() { + // Arrange + HashMap objectObjectMap = new HashMap(); + objectObjectMap.put("foo", "foo"); + HashMap objectObjectMap1 = new HashMap(); + objectObjectMap1.put("foo", "foo"); + + // Act and Assert + assertEquals(1, MapUtilities.compose(objectObjectMap, objectObjectMap1).size()); + } + + @Test + public void ensureNotNullTest() { + // Arrange + HashMap objectObjectMap = new HashMap(); + objectObjectMap.put("foo", "foo"); + + // Act + Map actualEnsureNotNullResult = MapUtilities.ensureNotNull(objectObjectMap); + + // Assert + assertSame(objectObjectMap, actualEnsureNotNullResult); + assertEquals(1, actualEnsureNotNullResult.size()); + } + + @Test + public void isEmptyTest() { + // Arrange + HashMap objectObjectMap = new HashMap(); + objectObjectMap.put("foo", "foo"); + + // Act and Assert + assertFalse(MapUtilities.isEmpty(objectObjectMap)); + } + + @Test + public void newHashMapTest() { + // Arrange, Act and Assert + assertEquals(1, MapUtilities.newHashMap("key", "key").size()); + } + + @Test + public void newHashMapTest2() { + // Arrange, Act and Assert + assertEquals(1, + MapUtilities.newHashMap("k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1").size()); + } + + @Test + public void newHashMapTest3() { + // Arrange, Act and Assert + assertEquals(1, MapUtilities + .newHashMap("k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1").size()); + } + + @Test + public void newHashMapTest4() { + // Arrange, Act and Assert + assertEquals(0, MapUtilities.newHashMap().size()); + } + + @Test + public void newHashMapTest5() { + // Arrange, Act and Assert + assertEquals(1, MapUtilities.newHashMap("k1", "k1", "k1", "k1").size()); + } + + @Test + public void newHashMapTest6() { + // Arrange, Act and Assert + assertEquals(1, MapUtilities.newHashMap("k1", "k1", "k1", "k1", "k1", "k1", "k1", "k1").size()); + } + + @Test + public void newHashMapTest7() { + // Arrange, Act and Assert + assertEquals(1, MapUtilities.newHashMap("k1", "k1", "k1", "k1", "k1", "k1").size()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/ObjectUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/ObjectUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..9d47827342 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/ObjectUtilitiesDiffblueTest.java @@ -0,0 +1,19 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class ObjectUtilitiesDiffblueTest { + @Test + public void dumpTest() { + // Arrange, Act and Assert + assertEquals("x", ObjectUtilities.dump("x")); + } + + @Test + public void firstNotNullTest() { + // Arrange, Act and Assert + assertEquals("foo", ObjectUtilities.firstNotNull("foo", "foo", "foo")); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/RandomUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/RandomUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..99e31a5d0a --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/RandomUtilitiesDiffblueTest.java @@ -0,0 +1,67 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import org.junit.Test; + +public class RandomUtilitiesDiffblueTest { + + @Test + public void randomPickTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals("foo", RandomUtilities.randomPick((Collection) objectList)); + } + + @Test + public void randomPickTest2() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, RandomUtilities.randomPick(objectList, 1).size()); + } + + @Test + public void randomPickTest3() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, RandomUtilities.randomPick(objectList, 38).size()); + } + + @Test + public void randomPickTest4() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(0, RandomUtilities.randomPick(objectList, 0).size()); + } + + @Test + public void randomPickTest5() { + // Arrange, Act and Assert + assertEquals("foo", RandomUtilities.randomPick("foo", "foo", "foo")); + } + + @Test + public void randomPickTest6() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals("foo", RandomUtilities.randomPick((List) objectList)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/RangeBandDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/RangeBandDiffblueTest.java new file mode 100644 index 0000000000..dbd6c3782e --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/RangeBandDiffblueTest.java @@ -0,0 +1,62 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class RangeBandDiffblueTest { + + @Test + public void constructorTest2() { + // Arrange and Act + RangeBand actualRangeBand = new RangeBand(10.0f, 10.0f); + + // Assert + assertEquals(Float.valueOf(10.0f), actualRangeBand.getHigh()); + assertEquals(Float.valueOf(10.0f), actualRangeBand.getLow()); + } + + @Test + public void containsTest() { + // Arrange, Act and Assert + assertTrue((new RangeBand(10.0f, 10.0f)).contains(10.0f)); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse((new RangeBand(10.0f, 10.0f)).equals("o")); + } + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(603979776, (new RangeBand(10.0f, 10.0f)).hashCode()); + } + + @Test + public void testTest() { + // Arrange, Act and Assert + assertFalse((new RangeBand(10.0f, 10.0f)).test(0.5f)); + } + + @Test + public void testTest2() { + // Arrange, Act and Assert + assertTrue((new RangeBand(10.0f, 10.0f)).test(10.0f)); + } + + @Test + public void testTest3() { + // Arrange, Act and Assert + assertFalse((new RangeBand(10.0f, 10.0f)).test(Float.NaN)); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("10.0 - 10.0", (new RangeBand(10.0f, 10.0f)).toString()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/SetUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/SetUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..c5bf6a274b --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/SetUtilitiesDiffblueTest.java @@ -0,0 +1,98 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import org.junit.Test; + +public class SetUtilitiesDiffblueTest { + @Test + public void asSetTest() { + // Arrange, Act and Assert + assertEquals(1, SetUtilities.asSet("foo", "foo", "foo").size()); + } + + @Test + public void fromArrayTest() { + // Arrange, Act and Assert + assertEquals(1, SetUtilities.fromArray("foo", "foo", "foo").size()); + } + + @Test + public void fromCollectionTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals(1, SetUtilities.fromCollection(objectList).size()); + } + + @Test + public void intersectionTest() { + // Arrange + HashSet objectSet = new HashSet(); + objectSet.add("foo"); + HashSet objectSet1 = new HashSet(); + objectSet1.add("foo"); + + // Act and Assert + assertEquals(1, SetUtilities.intersection(objectSet, objectSet1).size()); + } + + @Test + public void minusTest() { + // Arrange + HashSet objectSet = new HashSet(); + objectSet.add("foo"); + HashSet objectSet1 = new HashSet(); + objectSet1.add("foo"); + HashSet objectSet2 = new HashSet(); + objectSet2.add("foo"); + + // Act and Assert + assertEquals(0, SetUtilities.minus(objectSet, objectSet1, objectSet2, objectSet2).size()); + } + + @Test + public void orderedUnionTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + ArrayList objectList1 = new ArrayList(); + objectList1.add("foo"); + ArrayList objectList2 = new ArrayList(); + objectList2.add("foo"); + + // Act and Assert + assertEquals(1, SetUtilities.orderedUnion(objectList, objectList1, objectList2).size()); + } + + @Test + public void unionAllTest() { + // Arrange + ArrayList> collectionList = new ArrayList>(); + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + collectionList.add(objectList); + + // Act and Assert + assertEquals(1, SetUtilities.unionAll(collectionList).size()); + } + + @Test + public void unionTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + ArrayList objectList1 = new ArrayList(); + objectList1.add("foo"); + ArrayList objectList2 = new ArrayList(); + objectList2.add("foo"); + + // Act and Assert + assertEquals(1, SetUtilities.union(objectList, objectList1, objectList2).size()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/StringUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/StringUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..59c3c4aa01 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/StringUtilitiesDiffblueTest.java @@ -0,0 +1,139 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class StringUtilitiesDiffblueTest { + @Test + public void firstCharTest() { + // Arrange + char actualFirstCharResult = StringUtilities.firstChar("", 'A'); + + // Act and Assert + assertEquals('A', actualFirstCharResult); + assertEquals('s', StringUtilities.firstChar("str", 'A')); + } + + @Test + public void ifEmptyTest() { + // Arrange + String actualIfEmptyResult = StringUtilities.ifEmpty("", ""); + + // Act and Assert + assertEquals("", actualIfEmptyResult); + assertEquals("x", StringUtilities.ifEmpty("x", "")); + } + + @Test + public void isEmptyTest() { + // Arrange, Act and Assert + assertTrue(StringUtilities.isEmpty("")); + } + + @Test + public void isNumericLongTest() { + // Arrange + boolean actualIsNumericLongResult = StringUtilities.isNumericLong("value"); + + // Act and Assert + assertFalse(actualIsNumericLongResult); + assertFalse(StringUtilities.isNumericLong("")); + } + + @Test + public void joinTest() { + // Arrange + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act and Assert + assertEquals("foo", StringUtilities.join(objectList, "")); + } + + @Test + public void lengthTest() { + // Arrange, Act and Assert + assertEquals(0, StringUtilities.length("")); + } + + @Test + public void limitTest() { + // Arrange, Act and Assert + assertEquals("", StringUtilities.limit("", 3)); + } + + @Test + public void lowerTest() { + // Arrange, Act and Assert + assertEquals("value", StringUtilities.lower("value")); + } + + @Test + public void mkSafeTest() { + // Arrange, Act and Assert + assertEquals("", StringUtilities.mkSafe("")); + } + + @Test + public void notEmptyTest() { + // Arrange + boolean actualNotEmptyResult = StringUtilities.notEmpty(""); + + // Act and Assert + assertFalse(actualNotEmptyResult); + assertTrue(StringUtilities.notEmpty("x")); + } + + @Test + public void parseIntegerTest() { + // Arrange, Act and Assert + assertEquals(Integer.valueOf(0), StringUtilities.parseInteger("value", 0)); + } + + @Test + public void parseLongTest() { + // Arrange, Act and Assert + assertEquals(Long.valueOf(1L), StringUtilities.parseLong("value", 1L)); + } + + @Test + public void tokeniseTest() { + // Arrange and Act + List actualTokeniseResult = StringUtilities.tokenise("value", ""); + + // Assert + assertEquals(5, actualTokeniseResult.size()); + assertEquals("v", actualTokeniseResult.get(0)); + assertEquals("a", actualTokeniseResult.get(1)); + assertEquals("l", actualTokeniseResult.get(2)); + assertEquals("u", actualTokeniseResult.get(3)); + assertEquals("e", actualTokeniseResult.get(4)); + } + + @Test + public void tokeniseTest2() { + // Arrange, Act and Assert + assertEquals(0, StringUtilities.tokenise("", "").size()); + } + + @Test + public void tokeniseTest3() { + // Arrange, Act and Assert + assertEquals(0, StringUtilities.tokenise(" ").size()); + } + + @Test + public void tokeniseTest4() { + // Arrange and Act + List actualTokeniseResult = StringUtilities.tokenise("value"); + + // Assert + assertEquals(1, actualTokeniseResult.size()); + assertEquals("value", actualTokeniseResult.get(0)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/XmlUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/XmlUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..b5e928520b --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/XmlUtilitiesDiffblueTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import org.junit.Test; + +public class XmlUtilitiesDiffblueTest { + @Test + public void createNonValidatingDocumentBuilderFactoryTest() throws ParserConfigurationException { + // Arrange, Act and Assert + assertTrue(XmlUtilities + .createNonValidatingDocumentBuilderFactory() instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl); + } + + @Test + public void printDocumentTest() throws TransformerException { + // Arrange, Act and Assert + assertEquals("" + "\n" + "\n", + XmlUtilities.printDocument(new CoreDocumentImpl(), true)); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionDiffblueTest.java new file mode 100644 index 0000000000..8f290f69fe --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionDiffblueTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.common.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class DuplicateKeyExceptionDiffblueTest { + @Test + public void constructorTest() { + // Arrange + Throwable throwable = new Throwable(); + + // Act and Assert + assertSame((new DuplicateKeyException("An error occurred", throwable)).getCause(), throwable); + } + + @Test + public void constructorTest2() { + // Arrange and Act + DuplicateKeyException actualDuplicateKeyException = new DuplicateKeyException("An error occurred"); + + // Assert + assertEquals("com.khartec.waltz.common.exception.DuplicateKeyException:" + " An error occurred", + actualDuplicateKeyException.toString()); + assertEquals("An error occurred", actualDuplicateKeyException.getLocalizedMessage()); + assertNull(actualDuplicateKeyException.getCause()); + assertEquals("An error occurred", actualDuplicateKeyException.getMessage()); + assertEquals(0, actualDuplicateKeyException.getSuppressed().length); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionDiffblueTest.java new file mode 100644 index 0000000000..3814a6bbc9 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionDiffblueTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.common.exception; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class InsufficientPrivelegeExceptionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + InsufficientPrivelegeException actualInsufficientPrivelegeException = new InsufficientPrivelegeException( + "An error occurred"); + + // Assert + assertEquals("com.khartec.waltz.common.exception.InsufficientPri" + "velegeException: An error occurred", + actualInsufficientPrivelegeException.toString()); + assertEquals("An error occurred", actualInsufficientPrivelegeException.getLocalizedMessage()); + assertNull(actualInsufficientPrivelegeException.getCause()); + assertEquals("An error occurred", actualInsufficientPrivelegeException.getMessage()); + assertEquals(0, actualInsufficientPrivelegeException.getSuppressed().length); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/NotFoundExceptionDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/NotFoundExceptionDiffblueTest.java new file mode 100644 index 0000000000..215e2d5068 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/NotFoundExceptionDiffblueTest.java @@ -0,0 +1,19 @@ +package com.khartec.waltz.common.exception; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class NotFoundExceptionDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals("code", (new NotFoundException("code", "An error occurred")).getCode()); + } + + @Test + public void constructorTest2() { + // Arrange, Act and Assert + assertEquals("code", (new NotFoundException("code", "An error occurred", new Throwable())).getCode()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionDiffblueTest.java new file mode 100644 index 0000000000..87bf3d18ca --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionDiffblueTest.java @@ -0,0 +1,19 @@ +package com.khartec.waltz.common.exception; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class UpdateFailedExceptionDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals("code", (new UpdateFailedException("code", "An error occurred")).getCode()); + } + + @Test + public void constructorTest2() { + // Arrange, Act and Assert + assertEquals("code", (new UpdateFailedException("code", "An error occurred", new Throwable())).getCode()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/ForestDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/ForestDiffblueTest.java new file mode 100644 index 0000000000..518342fd64 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/ForestDiffblueTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.junit.Assert.assertEquals; +import java.util.HashMap; +import java.util.HashSet; +import org.junit.Test; + +public class ForestDiffblueTest { + @Test + public void constructorTest() { + // Arrange + Node param1 = new Node("123", "foo"); + HashMap> objectNodeMap = new HashMap>(); + objectNodeMap.put("foo", param1); + HashSet> nodeSet = new HashSet>(); + nodeSet.add(new Node("foo", "123")); + + // Act and Assert + assertEquals("Forest{#allNodes=1, rootNodes=[Node{id=foo," + " #children=0}]}", + (new Forest(objectNodeMap, nodeSet)).toString()); + } + + @Test + public void toStringTest() { + // Arrange + Node param1 = new Node("123", "foo"); + HashMap> objectNodeMap = new HashMap>(); + objectNodeMap.put("foo", param1); + HashSet> nodeSet = new HashSet>(); + nodeSet.add(new Node("foo", "123")); + + // Act and Assert + assertEquals("Forest{#allNodes=1, rootNodes=[Node{id=foo," + " #children=0}]}", + (new Forest(objectNodeMap, nodeSet)).toString()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..da1bbfd441 --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import java.util.HashMap; +import java.util.HashSet; +import org.junit.Test; + +public class HierarchyUtilitiesDiffblueTest { + @Test + public void assignDepthsTest() { + // Arrange + Node param1 = new Node("123", "foo"); + HashMap> objectNodeMap = new HashMap>(); + objectNodeMap.put("foo", param1); + HashSet> nodeSet = new HashSet>(); + nodeSet.add(new Node("foo", "123")); + + // Act and Assert + assertEquals(1, + HierarchyUtilities.assignDepths(new Forest(objectNodeMap, nodeSet)).size()); + } + + @Test + public void hasCycleTest() { + // Arrange + Node param1 = new Node("123", "foo"); + HashMap> objectNodeMap = new HashMap>(); + objectNodeMap.put("foo", param1); + HashSet> nodeSet = new HashSet>(); + nodeSet.add(new Node("foo", "123")); + + // Act and Assert + assertFalse(HierarchyUtilities.hasCycle(new Forest(objectNodeMap, nodeSet))); + } + + @Test + public void parentsTest() { + // Arrange, Act and Assert + assertEquals(0, HierarchyUtilities.parents(new Node("123", "123")).size()); + } +} + diff --git a/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/NodeDiffblueTest.java b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/NodeDiffblueTest.java new file mode 100644 index 0000000000..5fe2da01bb --- /dev/null +++ b/waltz-common/src/dcover/java/com/khartec/waltz/common/hierarchy/NodeDiffblueTest.java @@ -0,0 +1,56 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class NodeDiffblueTest { + @Test + public void addChildTest() { + // Arrange + Node node = new Node("123", "123"); + + // Act and Assert + assertSame(node, node.addChild(new Node("123", "123"))); + } + + @Test + public void constructorTest() { + // Arrange and Act + Node actualNode = new Node("123", "123"); + + // Assert + assertEquals("Node{id=123, #children=0}", actualNode.toString()); + assertNull(actualNode.getParent()); + assertTrue(actualNode.getData() instanceof String); + } + + @Test + public void getChildrenTest() { + // Arrange, Act and Assert + assertEquals(0, (new Node("123", "123")).getChildren().size()); + } + + @Test + public void setParentTest() { + // Arrange + Node node = new Node("123", "123"); + Node node1 = new Node("123", "123"); + + // Act + Node actualSetParentResult = node.setParent(node1); + + // Assert + assertSame(node, actualSetParentResult); + assertSame(node1, actualSetParentResult.getParent()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("Node{id=123, #children=0}", (new Node("123", "123")).toString()); + } +} + From a92a7224f025b25b75837d45ab41d4f40cf3477a Mon Sep 17 00:00:00 2001 From: Thomas Perkins Date: Thu, 5 Mar 2020 17:05:34 +0000 Subject: [PATCH 2/4] Add jcover tests for "waltz-common" Coverage: 62.0% --- .../com/khartec/waltz/common/AliasesTest.java | 27 ++++ .../waltz/common/ArrayUtilitiesTest.java | 68 ++++++++++ .../common/BatchProcessingCollectorTest.java | 42 ++++++ .../com/khartec/waltz/common/ChecksTest.java | 53 ++++++++ .../waltz/common/CollectionUtilitiesTest.java | 123 ++++++++++++++++++ .../waltz/common/DateTimeUtilitiesTest.java | 45 +++++++ .../waltz/common/DebugUtilitiesTest.java | 32 +++++ .../waltz/common/DigestUtilitiesTest.java | 21 +++ .../waltz/common/EnumUtilitiesTest.java | 26 ++++ .../waltz/common/FunctionUtilitiesTest.java | 35 +++++ .../khartec/waltz/common/IOUtilitiesTest.java | 35 +++++ .../waltz/common/ListUtilitiesTest.java | 87 +++++++++++++ .../waltz/common/LoggingUtilitiesTest.java | 17 +++ .../khartec/waltz/common/MapBuilderTest.java | 35 +++++ .../waltz/common/MapUtilitiesTest.java | 81 ++++++++++++ .../waltz/common/ObjectUtilitiesTest.java | 34 +++++ .../waltz/common/OptionalUtilitiesTest.java | 51 ++++++++ .../waltz/common/PredicateUtilitiesTest.java | 95 ++++++++++++++ .../waltz/common/RandomUtilitiesTest.java | 47 +++++++ .../waltz/common/SetUtilitiesTest.java | 90 +++++++++++++ .../waltz/common/StreamUtilitiesTest.java | 52 ++++++++ .../waltz/common/StringUtilitiesTest.java | 105 +++++++++++++++ .../waltz/common/XmlUtilitiesTest.java | 37 ++++++ .../exception/DuplicateKeyExceptionTest.java | 24 ++++ .../InsufficientPrivelegeExceptionTest.java | 24 ++++ .../exception/NotFoundExceptionTest.java | 20 +++ .../exception/UpdateFailedExceptionTest.java | 20 +++ .../waltz/common/hierarchy/FlatNodeTest.java | 39 ++++++ .../waltz/common/hierarchy/ForestTest.java | 32 +++++ .../hierarchy/HierarchyUtilitiesTest.java | 50 +++++++ .../waltz/common/hierarchy/NodeTest.java | 43 ++++++ 31 files changed, 1490 insertions(+) create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/AliasesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/ArrayUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/BatchProcessingCollectorTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/ChecksTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/CollectionUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/DateTimeUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/DebugUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/DigestUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/EnumUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/FunctionUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/IOUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/ListUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/LoggingUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/MapBuilderTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/MapUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/ObjectUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/OptionalUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/PredicateUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/RandomUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/SetUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/StreamUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/StringUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/XmlUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/exception/NotFoundExceptionTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/FlatNodeTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/ForestTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesTest.java create mode 100644 waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/NodeTest.java diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/AliasesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/AliasesTest.java new file mode 100644 index 0000000000..71997a2b3c --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/AliasesTest.java @@ -0,0 +1,27 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.Aliases + * + * @author Diffblue JCover + */ + +public class AliasesTest { + + @Test + public void lookupAliasIsFoo() { + assertThat(new Aliases().lookup("foo").isPresent(), is(false)); + } + + @Test + public void registerAliasesIsFooAndValIsFoo() { + Aliases aliases = new Aliases(); + assertThat(aliases.register("foo", "foo"), sameInstance(aliases)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/ArrayUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/ArrayUtilitiesTest.java new file mode 100644 index 0000000000..e5c537c318 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/ArrayUtilitiesTest.java @@ -0,0 +1,68 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertArrayEquals; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.ArrayUtilities + * + * @author Diffblue JCover + */ + +public class ArrayUtilitiesTest { + + @Test + public void allTsIsBarReturnsFalse() { + String[] ts = new String[] { "bar" }; + assertThat(ArrayUtilities.all(ts, new RangeBand("foo", "foo")), is(false)); + } + + @Test + public void allTsIsEmpty() { + assertThat(ArrayUtilities.all(new String[] { }, new RangeBand("foo", "foo")), is(true)); + } + + @Test + public void allTsIsFoo() { + String[] ts = new String[] { "foo" }; + assertThat(ArrayUtilities.all(ts, new RangeBand("bar", "foo")), is(true)); + } + + @Test + public void initialBitsIsFooReturnsEmpty() { + String[] bits = new String[] { "foo" }; + assertArrayEquals(new String[] { }, ArrayUtilities.initial(bits)); + } + + @Test + public void isEmpty() { + assertThat(ArrayUtilities.isEmpty(new String[] { }), is(true)); + assertThat(ArrayUtilities.isEmpty(null), is(true)); + } + + @Test + public void isEmptyArrIsFooReturnsFalse() { + String[] arr = new String[] { "foo" }; + assertThat(ArrayUtilities.isEmpty(arr), is(false)); + } + + @Test + public void lastArrIsSmithReturnsSmith() { + String[] arr = new String[] { "Smith" }; + assertThat(ArrayUtilities.last(arr), is("Smith")); + } + + @Test + public void sumArrIsEmptyReturnsZero() { + assertThat(ArrayUtilities.sum(new int[] { }), is(0)); + } + + @Test + public void sumArrIsOneReturnsOne() { + int[] arr = new int[] { 1 }; + assertThat(ArrayUtilities.sum(arr), is(1)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/BatchProcessingCollectorTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/BatchProcessingCollectorTest.java new file mode 100644 index 0000000000..8bfb5b2062 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/BatchProcessingCollectorTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.common; + +import static org.junit.Assert.assertTrue; + +import java.util.List; +import java.util.function.Consumer; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.BatchProcessingCollector + * + * @author Diffblue JCover + */ + +public class BatchProcessingCollectorTest { + + @Test + public void accumulator() { + @SuppressWarnings("unchecked") + Consumer> batchProcessor = null; + } + + @Test + public void characteristicsReturnsEmpty() { + @SuppressWarnings("unchecked") + Consumer> batchProcessor = null; + assertTrue(new BatchProcessingCollector(1, batchProcessor).characteristics().isEmpty()); + } + + @Test + public void combiner() { + @SuppressWarnings("unchecked") + Consumer> batchProcessor = null; + } + + @Test + public void supplier() { + @SuppressWarnings("unchecked") + Consumer> batchProcessor = null; + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/ChecksTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/ChecksTest.java new file mode 100644 index 0000000000..be8a13d451 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/ChecksTest.java @@ -0,0 +1,53 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; +import java.util.LinkedList; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.Checks + * + * @author Diffblue JCover + */ + +public class ChecksTest { + + @Test + public void checkAllTsIsEmptyReturnsEmpty() { + Collection ts = new LinkedList(); + Collection result = Checks.checkAll(ts, new RangeBand("bar", "foo"), "foo"); + assertTrue(result.isEmpty()); + assertThat(ts, sameInstance(result)); + } + + @Test + public void checkAllTsIsFooReturnsFoo() { + String[] ts = new String[] { "foo" }; + assertArrayEquals(new String[] { "foo" }, Checks.checkAll(ts, new RangeBand("bar", "foo"), "foo")); + } + + @Test + public void checkNotEmptyStrIsBarReturnsBar() { + assertThat(Checks.checkNotEmpty("bar", "foo"), is("bar")); + } + + @Test + public void checkNotEmptyTsIsBar() { + String[] ts = new String[] { "bar" }; + Checks.checkNotEmpty(ts, "foo"); + } + + @Test + public void checkNotEmptyTsIsFoo() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + Checks.checkNotEmpty(ts, "foo"); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/CollectionUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/CollectionUtilitiesTest.java new file mode 100644 index 0000000000..6d0ee00ca7 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/CollectionUtilitiesTest.java @@ -0,0 +1,123 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.function.Consumer; +import java.util.function.Function; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.CollectionUtilities + * + * @author Diffblue JCover + */ + +public class CollectionUtilitiesTest { + + @Test + public void anyTsIsEmptyReturnsFalse() { + assertThat(CollectionUtilities.any(new LinkedList(), new RangeBand("bar", "foo")), is(false)); + } + + @Test + public void anyTsIsFooReturnsTrue() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + assertThat(CollectionUtilities.any(ts, new RangeBand("foo", "foo")), is(true)); + } + + @Test + public void filterXsIsEmptyReturnsEmpty() { + assertTrue(CollectionUtilities.filter(new LinkedList(), new RangeBand("foo", "foo")).isEmpty()); + } + + @Test + public void headXsIsFooReturnsFoo() { + Collection xs = new LinkedList(); + ((LinkedList)xs).add("foo"); + assertThat(CollectionUtilities.head(xs).get(), is("foo")); + } + + @Test + public void isEmptyXsIsEmptyReturnsTrue() { + assertThat(CollectionUtilities.isEmpty(new LinkedList()), is(true)); + } + + @Test + public void isEmptyXsIsFooReturnsFalse() { + Collection xs = new LinkedList(); + ((LinkedList)xs).add("foo"); + assertThat(CollectionUtilities.isEmpty(xs), is(false)); + } + + @Test + public void isPresent() { + assertThat(CollectionUtilities.head(new LinkedList()).isPresent(), is(false)); + assertThat(CollectionUtilities.head(null).isPresent(), is(false)); + assertThat(CollectionUtilities.maybeFirst(new LinkedList()).isPresent(), is(false)); + assertThat(CollectionUtilities.maybeFirst(new LinkedList(), new RangeBand("foo", "foo")).isPresent(), is(false)); + } + + @Test + public void maybe() { + @SuppressWarnings("unchecked") + Consumer> fn = null; + CollectionUtilities.maybe(new LinkedList(), fn); + } + + @Test + public void maybeDfltIsFooReturnsFoo() { + @SuppressWarnings("unchecked") + Function, String> fn = null; + assertThat(CollectionUtilities.maybe(new LinkedList(), fn, "foo"), is("foo")); + } + + @Test + public void maybeFirstXsIsAnnaReturnsAnna() { + Collection xs = new LinkedList(); + ((LinkedList)xs).add("Anna"); + assertThat(CollectionUtilities.maybeFirst(xs).get(), is("Anna")); + } + + @Test + public void notEmpty() { + assertThat(CollectionUtilities.notEmpty(new LinkedList()), is(false)); + assertThat(CollectionUtilities.notEmpty(null), is(false)); + } + + @Test + public void notEmptyTsIsFooReturnsTrue() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + assertThat(CollectionUtilities.notEmpty(ts), is(true)); + } + + @Test + public void sumIntsValuesIsEmptyReturnsZero() { + assertThat(CollectionUtilities.sumInts(new LinkedList()), is(0L)); + } + + @Test + public void sumIntsValuesIsOneReturnsOne() { + Collection values = new LinkedList(); + ((LinkedList)values).add(1); + assertThat(CollectionUtilities.sumInts(values), is(1L)); + } + + @Test + public void sumLongsValuesIsEmptyReturnsZero() { + assertThat(CollectionUtilities.sumLongs(new LinkedList()), is(0L)); + } + + @Test + public void sumLongsValuesIsOneReturnsOne() { + Collection values = new LinkedList(); + ((LinkedList)values).add(1L); + assertThat(CollectionUtilities.sumLongs(values), is(1L)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/DateTimeUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/DateTimeUtilitiesTest.java new file mode 100644 index 0000000000..855d0084dd --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/DateTimeUtilitiesTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.core.IsNull.nullValue; + +import java.sql.Timestamp; +import java.time.LocalDate; +import java.util.Date; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.DateTimeUtilities + * + * @author Diffblue JCover + */ + +public class DateTimeUtilitiesTest { + + @Test + public void today() { + assertThat(DateTimeUtilities.today(), equalTo(LocalDate.now())); + } + + @Test + public void toLocalDate() { + assertThat(DateTimeUtilities.toLocalDate((Date)null), is(nullValue())); + assertThat(DateTimeUtilities.toLocalDate((Timestamp)null), is(nullValue())); + } + + @Test + public void toLocalDateTimeDateIsNullReturnsNull() { + assertThat(DateTimeUtilities.toLocalDateTime(null), is(nullValue())); + } + + @Test + public void toSqlDate() { + assertThat(DateTimeUtilities.toSqlDate(LocalDate.of(2_000, 1, 1)), equalTo(new java.sql.Date(946_684_800_000L))); + assertThat(DateTimeUtilities.toSqlDate(new Date(1L)), equalTo(new java.sql.Date(1L))); + assertThat(DateTimeUtilities.toSqlDate((Date)null), is(nullValue())); + assertThat(DateTimeUtilities.toSqlDate((LocalDate)null), is(nullValue())); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/DebugUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/DebugUtilitiesTest.java new file mode 100644 index 0000000000..9bd3467374 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/DebugUtilitiesTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.DebugUtilities + * + * @author Diffblue JCover + */ + +public class DebugUtilitiesTest { + + @Test + public void dumpMIsEmptyReturnsEmpty() { + Map m = new HashMap(); + Map result = DebugUtilities.dump(m); + assertThat(result.isEmpty(), is(true)); + assertThat(m, sameInstance(result)); + } + + @Test + public void logValueResultIsFooReturnsFoo() { + assertThat(DebugUtilities.logValue("foo", new Object[] { new Aliases() }), is("foo")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/DigestUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/DigestUtilitiesTest.java new file mode 100644 index 0000000000..60b314bb59 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/DigestUtilitiesTest.java @@ -0,0 +1,21 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.DigestUtilities + * + * @author Diffblue JCover + */ + +public class DigestUtilitiesTest { + + @Test + public void digestBytesIsOne() throws java.security.NoSuchAlgorithmException { + byte[] bytes = new byte[] { 1 }; + assertThat(DigestUtilities.digest(bytes), is("v4tFMNjSRt10rFOhNHG7oXlB3/c=")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/EnumUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/EnumUtilitiesTest.java new file mode 100644 index 0000000000..24b41befdc --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/EnumUtilitiesTest.java @@ -0,0 +1,26 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import java.time.DayOfWeek; +import java.util.LinkedList; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.EnumUtilities + * + * @author Diffblue JCover + */ + +public class EnumUtilitiesTest { + + @Test + public void names() { + assertTrue(EnumUtilities.names(new LinkedList()).isEmpty()); + assertThat(EnumUtilities.names(new DayOfWeek[] { DayOfWeek.MONDAY }).size(), is(1)); + assertTrue(EnumUtilities.names(new DayOfWeek[] { DayOfWeek.MONDAY }).contains("MONDAY")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/FunctionUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/FunctionUtilitiesTest.java new file mode 100644 index 0000000000..484f5ba321 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/FunctionUtilitiesTest.java @@ -0,0 +1,35 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import java.util.function.Supplier; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.FunctionUtilities + * + * @author Diffblue JCover + */ + +public class FunctionUtilitiesTest { + + @Test + public void discardResult() { + FunctionUtilities.discardResult(new Aliases()); + } + + @Test + public void time() { + FunctionUtilities.time("/bin/bash", Thread.currentThread()); + } + + @Test + public void timeReturnsNull() { + @SuppressWarnings("unchecked") + Supplier supplier = null; + assertThat(FunctionUtilities.time("/bin/bash", supplier), is(nullValue())); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/IOUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/IOUtilitiesTest.java new file mode 100644 index 0000000000..8d7a25abd0 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/IOUtilitiesTest.java @@ -0,0 +1,35 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.io.ByteArrayOutputStream; +import java.io.StringBufferInputStream; + +import org.junit.Test; +import org.springframework.core.io.Resource; + +/** + * Unit tests for com.khartec.waltz.common.IOUtilities + * + * @author Diffblue JCover + */ + +public class IOUtilitiesTest { + + @Test + public void copyStream() throws java.io.IOException { + IOUtilities.copyStream(new StringBufferInputStream("Broadway"), new ByteArrayOutputStream()); + } + + @Test + public void readAsStringReturnsBroadway() { + assertThat(IOUtilities.readAsString(new StringBufferInputStream("Broadway")), is("Broadway")); + } + + @Test + public void readLinesReturnsBroadway() { + assertThat(IOUtilities.readLines(new StringBufferInputStream("Broadway")).size(), is(1)); + assertThat(IOUtilities.readLines(new StringBufferInputStream("Broadway")).get(0), is("Broadway")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/ListUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/ListUtilitiesTest.java new file mode 100644 index 0000000000..8a3e99455f --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/ListUtilitiesTest.java @@ -0,0 +1,87 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Function; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.ListUtilities + * + * @author Diffblue JCover + */ + +public class ListUtilitiesTest { + + @Test + public void appendTIsSmithAndTsIsEmptyReturnsSmith() { + assertThat(ListUtilities.append(new ArrayList(), "Smith").size(), is(1)); + assertThat(ListUtilities.append(new ArrayList(), "Smith").get(0), is("Smith")); + } + + @Test + public void applyToFirstXsIsEmpty() { + @SuppressWarnings("unchecked") + Function mapFn = null; + assertThat(ListUtilities.applyToFirst(new ArrayList(), mapFn).isPresent(), is(false)); + } + + @Test + public void asListTsIsSmithReturnsSmith() { + assertThat(ListUtilities.asList("Smith").size(), is(1)); + assertThat(ListUtilities.asList("Smith").get(0), is("Smith")); + } + + @Test + public void compactTsIsEmptyReturnsEmpty() { + assertTrue(ListUtilities.compact(new LinkedList()).isEmpty()); + } + + @Test + public void dropCountIsOneAndTsIsEmptyReturnsEmpty() { + assertTrue(ListUtilities.drop(new ArrayList(), 1).isEmpty()); + } + + @Test + public void ensureNotNull() { + assertTrue(ListUtilities.ensureNotNull(new LinkedList()).isEmpty()); + assertTrue(ListUtilities.ensureNotNull(null).isEmpty()); + } + + @Test + public void filterTsIsEmptyReturnsEmpty() { + assertTrue(ListUtilities.filter(new RangeBand("foo", "foo"), new ArrayList()).isEmpty()); + } + + @Test + public void isEmpty() { + assertThat(ListUtilities.isEmpty(new ArrayList()), is(true)); + assertThat(ListUtilities.isEmpty(null), is(true)); + } + + @Test + public void isEmptyTsIsSmithReturnsFalse() { + List ts = new ArrayList(); + ((ArrayList)ts).add("Smith"); + assertThat(ListUtilities.isEmpty(ts), is(false)); + } + + @Test + public void push() { + assertThat(ListUtilities.push(new ArrayList(), "Smith").size(), is(1)); + assertThat(ListUtilities.push(new ArrayList(), "Smith").get(0), is("Smith")); + assertThat(ListUtilities.push(null, "Smith").size(), is(1)); + assertThat(ListUtilities.push(null, "Smith").get(0), is("Smith")); + } + + @Test + public void reverseTsIsEmptyReturnsEmpty() { + assertTrue(ListUtilities.reverse(new ArrayList()).isEmpty()); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/LoggingUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/LoggingUtilitiesTest.java new file mode 100644 index 0000000000..0fc0cc838b --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/LoggingUtilitiesTest.java @@ -0,0 +1,17 @@ +package com.khartec.waltz.common; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.LoggingUtilities + * + * @author Diffblue JCover + */ + +public class LoggingUtilitiesTest { + + @Test + public void configureLogging() { + LoggingUtilities.configureLogging(); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/MapBuilderTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/MapBuilderTest.java new file mode 100644 index 0000000000..190c904639 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/MapBuilderTest.java @@ -0,0 +1,35 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; + +import java.util.HashMap; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.MapBuilder + * + * @author Diffblue JCover + */ + +public class MapBuilderTest { + + @Test + public void addKIsFooAndVIsFoo() { + MapBuilder mapBuilder = new MapBuilder(); + assertThat(mapBuilder.add("foo", "foo"), sameInstance(mapBuilder)); + } + + @Test + public void buildReturnsEmpty() { + assertThat(new MapBuilder().build().isEmpty(), is(true)); + } + + @Test + public void fromMIsEmpty() { + MapBuilder mapBuilder = new MapBuilder(); + assertThat(mapBuilder.from(new HashMap()), sameInstance(mapBuilder)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/MapUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/MapUtilitiesTest.java new file mode 100644 index 0000000000..1873cfda7b --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/MapUtilitiesTest.java @@ -0,0 +1,81 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Map; +import java.util.function.Function; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.MapUtilities + * + * @author Diffblue JCover + */ + +public class MapUtilitiesTest { + + @Test + public void countByXsIsEmpty() { + @SuppressWarnings("unchecked") + Function keyFn = null; + assertThat(MapUtilities.countBy(keyFn, new LinkedList()).isEmpty(), is(true)); + } + + @Test + public void countByXsIsNull() { + @SuppressWarnings("unchecked") + Function keyFn = null; + assertThat(MapUtilities.countBy(keyFn, null).isEmpty(), is(true)); + } + + @Test + public void ensureNotNullMaybeMapIsEmpty() { + Map maybeMap = new HashMap(); + Map result = MapUtilities.ensureNotNull(maybeMap); + assertThat(result.isEmpty(), is(true)); + assertThat(maybeMap, sameInstance(result)); + } + + @Test + public void get() { + assertThat(MapUtilities.newHashMap("foo", "foo", "foo", "foo").get("foo"), is("foo")); + assertThat(MapUtilities.newHashMap("foo", "foo", "foo", "foo", "foo", "foo").get("foo"), is("foo")); + assertThat(MapUtilities.newHashMap("foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo").get("foo"), is("foo")); + assertThat(MapUtilities.newHashMap("foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo").get("foo"), is("foo")); + assertThat(MapUtilities.newHashMap("foo", "foo", "foo", "foo", "foo", "foo", "foo", "foo").get("foo"), is("foo")); + assertThat(MapUtilities.newHashMap("foo", "foo").get("foo"), is("foo")); + } + + @Test + public void isEmpty() { + assertThat(MapUtilities.ensureNotNull(null).isEmpty(), is(true)); + assertThat(MapUtilities.isEmpty(new HashMap()), is(true)); + assertThat(MapUtilities.isEmpty(null), is(true)); + assertThat(MapUtilities.newHashMap().isEmpty(), is(true)); + } + + @Test + public void isEmptyMapIsFooReturnsFalse() { + Map map = new HashMap(); + ((HashMap)map).put("foo", "foo"); + assertThat(MapUtilities.isEmpty(map), is(false)); + } + + @Test + public void isPresent() { + assertThat(MapUtilities.maybeGet(new HashMap(), "foo").isPresent(), is(false)); + assertThat(MapUtilities.maybeGet(null, "foo").isPresent(), is(false)); + } + + @Test + public void transformKeysOriginalIsEmptyReturnsEmpty() { + @SuppressWarnings("unchecked") + Function transformation = null; + assertThat(MapUtilities.transformKeys(new HashMap(), transformation).isEmpty(), is(true)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/ObjectUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/ObjectUtilitiesTest.java new file mode 100644 index 0000000000..ee8b03f3a8 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/ObjectUtilitiesTest.java @@ -0,0 +1,34 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.ObjectUtilities + * + * @author Diffblue JCover + */ + +public class ObjectUtilitiesTest { + + @Test + public void any() { + assertThat(ObjectUtilities.any(new RangeBand("foo", "foo"), "bar"), is(false)); + assertThat(ObjectUtilities.any(new RangeBand("bar", "foo"), "foo"), is(true)); + } + + @Test + public void dumpXIsFooReturnsFoo() { + assertThat(ObjectUtilities.dump("foo"), is("foo")); + } + + @Test + public void firstNotNull() { + assertThat(ObjectUtilities.firstNotNull("Anna"), is("Anna")); + assertThat(ObjectUtilities.firstNotNull(), is(nullValue())); + assertThat(ObjectUtilities.firstNotNull(new String[] { null }), is(nullValue())); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/OptionalUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/OptionalUtilitiesTest.java new file mode 100644 index 0000000000..4357710cc6 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/OptionalUtilitiesTest.java @@ -0,0 +1,51 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; +import static org.junit.Assert.assertTrue; + +import java.util.Optional; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.OptionalUtilities + * + * @author Diffblue JCover + */ + +public class OptionalUtilitiesTest { + + @Test + public void contentsEqual() { + assertThat(OptionalUtilities.contentsEqual(Optional.of("foo"), "foo"), is(true)); + assertThat(OptionalUtilities.contentsEqual(Optional.empty(), "foo"), is(false)); + assertThat(OptionalUtilities.contentsEqual(Optional.empty(), null), is(true)); + } + + @Test + public void maybeValueIsFooReturnsFoo() { + assertThat(OptionalUtilities.maybe("foo").get(), is("foo")); + } + + @Test + public void ofNullableOptional() { + Optional nullable = Optional.empty(); + Optional result = OptionalUtilities.ofNullableOptional(nullable); + assertThat(result.isPresent(), is(false)); + assertThat(nullable, sameInstance(result)); + } + + @Test + public void ofNullableOptionalNullableIsNull() { + assertThat(OptionalUtilities.ofNullableOptional(null).isPresent(), is(false)); + } + + @Test + public void toList() { + assertTrue(OptionalUtilities.toList(null).isEmpty()); + assertThat(OptionalUtilities.toList(Optional.of("foo")).size(), is(1)); + assertThat(OptionalUtilities.toList(Optional.of("foo")).get(0), is("foo")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/PredicateUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/PredicateUtilitiesTest.java new file mode 100644 index 0000000000..85fbb8e77d --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/PredicateUtilitiesTest.java @@ -0,0 +1,95 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.util.Collection; +import java.util.LinkedList; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.PredicateUtilities + * + * @author Diffblue JCover + */ + +public class PredicateUtilitiesTest { + + @Test + public void allTsIsBarReturnsFalse1() { + String[] ts = new String[] { "bar" }; + assertThat(PredicateUtilities.all(ts, new RangeBand("foo", "foo")), is(false)); + } + + @Test + public void allTsIsBarReturnsFalse2() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("bar"); + assertThat(PredicateUtilities.all(ts, new RangeBand("foo", "foo")), is(false)); + } + + @Test + public void allTsIsEmptyReturnsTrue() { + assertThat(PredicateUtilities.all(new LinkedList(), new RangeBand("bar", "foo")), is(true)); + } + + @Test + public void allTsIsFooReturnsTrue() { + String[] ts = new String[] { "foo" }; + assertThat(PredicateUtilities.all(ts, new RangeBand("bar", "foo")), is(true)); + } + + @Test + public void anyTsIsBarReturnsFalse() { + String[] ts = new String[] { "bar" }; + assertThat(PredicateUtilities.any(ts, new RangeBand("foo", "foo")), is(false)); + } + + @Test + public void anyTsIsEmptyReturnsFalse() { + assertThat(PredicateUtilities.any(new LinkedList(), new RangeBand("bar", "foo")), is(false)); + } + + @Test + public void anyTsIsFooReturnsTrue1() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + assertThat(PredicateUtilities.any(ts, new RangeBand("foo", "foo")), is(true)); + } + + @Test + public void anyTsIsFooReturnsTrue2() { + String[] ts = new String[] { "foo" }; + assertThat(PredicateUtilities.any(ts, new RangeBand("bar", "foo")), is(true)); + } + + @Test + public void noneTsIsBarReturnsTrue() { + String[] ts = new String[] { "bar" }; + assertThat(PredicateUtilities.none(ts, new RangeBand("foo", "foo")), is(true)); + } + + @Test + public void noneTsIsEmptyReturnsTrue() { + assertThat(PredicateUtilities.none(new LinkedList(), new RangeBand("bar", "foo")), is(true)); + } + + @Test + public void noneTsIsFooReturnsFalse1() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + assertThat(PredicateUtilities.none(ts, new RangeBand("foo", "foo")), is(false)); + } + + @Test + public void noneTsIsFooReturnsFalse2() { + String[] ts = new String[] { "foo" }; + assertThat(PredicateUtilities.none(ts, new RangeBand("bar", "foo")), is(false)); + } + + @Test + public void testReturnsTrue() { + assertThat(PredicateUtilities.not(new RangeBand("foo", "foo")).test("html"), is(true)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/RandomUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/RandomUtilitiesTest.java new file mode 100644 index 0000000000..4d13d34122 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/RandomUtilitiesTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; +import java.util.LinkedList; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.RandomUtilities + * + * @author Diffblue JCover + */ + +public class RandomUtilitiesTest { + + @Test + public void randomlySizedIntStreamLowerIsZeroAndUpperIsOne() { + int[] array = RandomUtilities.randomlySizedIntStream(0, 1).toArray(); + assertArrayEquals(new int[] { }, array); + } + + @Test + public void randomPick() { + assertTrue(RandomUtilities.randomPick(new LinkedList(), 1).isEmpty()); + assertThat(RandomUtilities.randomPick(new String[] { "foo" }), is("foo")); + } + + @Test + public void randomPickChoicesIsFooAndHowManyIsOneReturnsFoo() { + Collection choices = new LinkedList(); + ((LinkedList)choices).add("foo"); + assertThat(RandomUtilities.randomPick(choices, 1).size(), is(1)); + assertThat(RandomUtilities.randomPick(choices, 1).get(0), is("foo")); + } + + @Test + public void randomPickChoicesIsFooAndHowManyIsZeroReturnsEmpty() { + Collection choices = new LinkedList(); + ((LinkedList)choices).add("foo"); + assertTrue(RandomUtilities.randomPick(choices, 0).isEmpty()); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/SetUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/SetUtilitiesTest.java new file mode 100644 index 0000000000..28bdcc09a7 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/SetUtilitiesTest.java @@ -0,0 +1,90 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Set; +import java.util.function.Function; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.SetUtilities + * + * @author Diffblue JCover + */ + +public class SetUtilitiesTest { + + @Test + public void asSet() { + assertTrue(SetUtilities.asSet().isEmpty()); + assertThat(SetUtilities.asSet("foo").size(), is(1)); + assertTrue(SetUtilities.asSet("foo").contains("foo")); + assertTrue(SetUtilities.asSet(null).isEmpty()); + } + + @Test + public void fromCollection() { + assertTrue(SetUtilities.fromCollection(new LinkedList()).isEmpty()); + assertTrue(SetUtilities.fromCollection(null).isEmpty()); + } + + @Test + public void fromCollectionTsIsFooReturnsFoo() { + Collection ts = new LinkedList(); + ((LinkedList)ts).add("foo"); + assertThat(SetUtilities.fromCollection(ts).size(), is(1)); + assertTrue(SetUtilities.fromCollection(ts).contains("foo")); + } + + @Test + public void intersectionXsIsEmptyAndYsIsEmptyReturnsEmpty() { + assertTrue(SetUtilities.intersection(new HashSet(), new HashSet()).isEmpty()); + } + + @Test + public void mapXsIsEmpty() { + @SuppressWarnings("unchecked") + Function fn = null; + assertTrue(SetUtilities.map(new LinkedList(), fn).isEmpty()); + } + + @Test + public void mapXsIsNull() { + @SuppressWarnings("unchecked") + Function fn = null; + assertTrue(SetUtilities.map(null, fn).isEmpty()); + } + + @Test + public void minusXsIsEmptyReturnsEmpty() { + assertTrue(SetUtilities.minus(new HashSet(), new HashSet()).isEmpty()); + } + + @Test + public void orderedUnionReturnsEmpty() { + assertTrue(SetUtilities.orderedUnion(new LinkedList()).isEmpty()); + } + + @Test + public void unionAllValuesIsEmptyReturnsEmpty() { + assertTrue(SetUtilities.unionAll(new LinkedList>()).isEmpty()); + } + + @Test + public void unionReturnsEmpty() { + assertTrue(SetUtilities.union(new LinkedList()).isEmpty()); + } + + @Test + public void uniqByXsIsEmptyReturnsEmpty() { + @SuppressWarnings("unchecked") + Function comparator = null; + assertTrue(SetUtilities.uniqBy(new LinkedList(), comparator).isEmpty()); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/StreamUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/StreamUtilitiesTest.java new file mode 100644 index 0000000000..849ae09787 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/StreamUtilitiesTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Consumer; +import java.util.stream.Stream; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.StreamUtilities + * + * @author Diffblue JCover + */ + +public class StreamUtilitiesTest { + + @Test + public void applyReturnsFoo() { + assertThat(StreamUtilities.tap().apply("foo"), is("foo")); + } + + @Test + public void batchProcessingCollectorBatchSizeIsOne() { + @SuppressWarnings("unchecked") + Consumer> batchProcessor = null; + } + + @Test + public void mkSiphon() { + assertTrue(StreamUtilities.mkSiphon(new RangeBand("foo", "foo")).getResults().isEmpty()); + } + + @Test + public void ofNullableArrayArrIsBroadway() { + String[] arr = new String[] { "Broadway" }; + String[] array = StreamUtilities.ofNullableArray(arr).toArray(String[]::new); + assertArrayEquals(new String[] { "Broadway" }, array); + } + + @Test + public void ofNullableArrayArrIsNull() { + String[] array = StreamUtilities.ofNullableArray(null).toArray(String[]::new); + assertArrayEquals(new String[] { }, array); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/StringUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/StringUtilitiesTest.java new file mode 100644 index 0000000000..38018aaa3e --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/StringUtilitiesTest.java @@ -0,0 +1,105 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; +import static org.junit.Assert.assertTrue; + +import java.util.LinkedList; +import java.util.Optional; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.StringUtilities + * + * @author Diffblue JCover + */ + +public class StringUtilitiesTest { + + @Test + public void firstChar() { + assertThat(StringUtilities.firstChar("", '\u0000'), is('\u0000')); + assertThat(StringUtilities.firstChar("Anna", 'a'), is('A')); + assertThat(StringUtilities.firstChar("", 'a'), is('a')); + assertThat(StringUtilities.firstChar(null, 'a'), is('a')); + } + + @Test + public void ifEmpty() { + assertThat(StringUtilities.ifEmpty("bar", "foo"), is("bar")); + assertThat(StringUtilities.ifEmpty("", "foo"), is("foo")); + } + + @Test + public void isEmpty() { + assertThat(StringUtilities.isEmpty(Optional.empty()), is(true)); + assertThat(StringUtilities.isEmpty(Optional.of("foo")), is(false)); + assertThat(StringUtilities.isEmpty(""), is(true)); + assertThat(StringUtilities.isEmpty("foo"), is(false)); + assertThat(StringUtilities.isEmpty((String)null), is(true)); + } + + @Test + public void isNumericLong() { + assertThat(StringUtilities.isNumericLong(""), is(false)); + assertThat(StringUtilities.isNumericLong("foo"), is(false)); + } + + @Test + public void joinValuesIsEmptyReturnsEmpty() { + assertThat(StringUtilities.join(new LinkedList(), ","), is("")); + } + + @Test + public void length() { + assertThat(StringUtilities.length(""), is(0)); + assertThat(StringUtilities.length("foo"), is(3)); + assertThat(StringUtilities.length(null), is(0)); + } + + @Test + public void limit() { + assertThat(StringUtilities.limit("foo", 1), is("f")); + assertThat(StringUtilities.limit(null, 1), is(nullValue())); + } + + @Test + public void lowerValueIsFooReturnsFoo() { + assertThat(StringUtilities.lower("foo"), is("foo")); + } + + @Test + public void mkSafeStrIsFooReturnsFoo() { + assertThat(StringUtilities.mkSafe("foo"), is("foo")); + } + + @Test + public void notEmpty() { + assertThat(StringUtilities.notEmpty(""), is(false)); + assertThat(StringUtilities.notEmpty("foo"), is(true)); + } + + @Test + public void parseIntegerDfltIsOneAndValueIsFooReturnsOne() { + assertThat(StringUtilities.parseInteger("foo", 1), is(1)); + } + + @Test + public void tokenise() { + assertTrue(StringUtilities.tokenise("").isEmpty()); + assertThat(StringUtilities.tokenise("foo").size(), is(1)); + assertThat(StringUtilities.tokenise("foo").get(0), is("foo")); + } + + @Test + public void toOptionalStrIsEmpty() { + assertThat(StringUtilities.toOptional("").isPresent(), is(false)); + } + + @Test + public void toOptionalStrIsFooReturnsFoo() { + assertThat(StringUtilities.toOptional("foo").get(), is("foo")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/XmlUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/XmlUtilitiesTest.java new file mode 100644 index 0000000000..b913a9d6f2 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/XmlUtilitiesTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.common; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import javax.xml.parsers.DocumentBuilderFactory; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.XmlUtilities + * + * @author Diffblue JCover + */ + +public class XmlUtilitiesTest { + + @Test + public void createNonValidatingDocumentBuilderFactory() throws javax.xml.parsers.ParserConfigurationException { + DocumentBuilderFactory result = XmlUtilities.createNonValidatingDocumentBuilderFactory(); + assertThat(result.getSchema(), is(nullValue())); + assertThat(result.isCoalescing(), is(false)); + assertThat(result.isExpandEntityReferences(), is(true)); + assertThat(result.isIgnoringComments(), is(false)); + assertThat(result.isIgnoringElementContentWhitespace(), is(false)); + assertThat(result.isNamespaceAware(), is(true)); + assertThat(result.isValidating(), is(false)); + assertThat(result.isXIncludeAware(), is(false)); + } + + @Test + public void printDocument() throws javax.xml.parsers.ParserConfigurationException, javax.xml.transform.TransformerException { + assertThat(XmlUtilities.printDocument(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(), false), is("")); + assertThat(XmlUtilities.printDocument(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(), true), is("\n\n")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionTest.java new file mode 100644 index 0000000000..80c3cd69fb --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/DuplicateKeyExceptionTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.common.exception; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.exception.DuplicateKeyException + * + * @author Diffblue JCover + */ + +public class DuplicateKeyExceptionTest { + + @Test + public void constructor() { + DuplicateKeyException duplicateKeyException = new DuplicateKeyException("jpg"); + assertThat(duplicateKeyException.getCause(), is(nullValue())); + assertThat(duplicateKeyException.getLocalizedMessage(), is("jpg")); + assertThat(duplicateKeyException.getMessage(), is("jpg")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionTest.java new file mode 100644 index 0000000000..e3f3f55809 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/InsufficientPrivelegeExceptionTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.common.exception; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.exception.InsufficientPrivelegeException + * + * @author Diffblue JCover + */ + +public class InsufficientPrivelegeExceptionTest { + + @Test + public void constructor() { + InsufficientPrivelegeException insufficientPrivelegeException = new InsufficientPrivelegeException("jpg"); + assertThat(insufficientPrivelegeException.getCause(), is(nullValue())); + assertThat(insufficientPrivelegeException.getLocalizedMessage(), is("jpg")); + assertThat(insufficientPrivelegeException.getMessage(), is("jpg")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/NotFoundExceptionTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/NotFoundExceptionTest.java new file mode 100644 index 0000000000..4225c6e9ba --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/NotFoundExceptionTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.common.exception; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.exception.NotFoundException + * + * @author Diffblue JCover + */ + +public class NotFoundExceptionTest { + + @Test + public void getCode() { + assertThat(new NotFoundException("OX13QD", "jpg").getCode(), is("OX13QD")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionTest.java new file mode 100644 index 0000000000..d4b08519ba --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/exception/UpdateFailedExceptionTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.common.exception; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.exception.UpdateFailedException + * + * @author Diffblue JCover + */ + +public class UpdateFailedExceptionTest { + + @Test + public void getCode() { + assertThat(new UpdateFailedException("OX13QD", "jpg").getCode(), is("OX13QD")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/FlatNodeTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/FlatNodeTest.java new file mode 100644 index 0000000000..2b047cb746 --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/FlatNodeTest.java @@ -0,0 +1,39 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsSame.sameInstance; + +import java.util.Optional; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.hierarchy.FlatNode + * + * @author Diffblue JCover + */ + +public class FlatNodeTest { + + @Test + public void constructor() { + Optional parentId = Optional.empty(); + FlatNode flatNode = new FlatNode("root", parentId, "something"); + assertThat(flatNode.getData(), is("something")); + assertThat(flatNode.getId(), is("root")); + assertThat(flatNode.getParentId(), sameInstance(parentId)); + } + + @Test + public void getParentId() { + Optional parentId = Optional.empty(); + assertThat(new FlatNode("root", parentId, "something").getParentId(), sameInstance(parentId)); + } + + @Test + public void getters() { + assertThat(new FlatNode("root", Optional.empty(), "something").getData(), is("something")); + assertThat(new FlatNode("root", Optional.empty(), "something").getId(), is("root")); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/ForestTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/ForestTest.java new file mode 100644 index 0000000000..6b05fa8e1d --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/ForestTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsSame.sameInstance; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.hierarchy.Forest + * + * @author Diffblue JCover + */ + +public class ForestTest { + + @Test + public void getAllNodes() { + Map> allNodes = new HashMap>(); + assertThat(new Forest(allNodes, new HashSet>()).getAllNodes(), sameInstance(allNodes)); + } + + @Test + public void getRootNodes() { + Set> rootNodes = new HashSet>(); + assertThat(new Forest(new HashMap>(), rootNodes).getRootNodes(), sameInstance(rootNodes)); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesTest.java new file mode 100644 index 0000000000..62b27c9a3e --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/HierarchyUtilitiesTest.java @@ -0,0 +1,50 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Map; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.hierarchy.HierarchyUtilities + * + * @author Diffblue JCover + */ + +public class HierarchyUtilitiesTest { + + @Test + public void assignDepthsReturnsEmpty() { + assertThat(HierarchyUtilities.assignDepths(new Forest(new HashMap>(), new HashSet>())).isEmpty(), is(true)); + } + + @Test + public void hasCycle1() { + assertThat(HierarchyUtilities.hasCycle(new Forest(new HashMap>(), new HashSet>())), is(false)); + } + + @Test + public void hasCycle2() { + Map> allNodes = new HashMap>(); + ((HashMap>)allNodes).put("foo", new Node("root", "something")); + assertThat(HierarchyUtilities.hasCycle(new Forest(allNodes, new HashSet>())), is(false)); + } + + @Test + public void parentsReturnsEmpty() { + assertTrue(HierarchyUtilities.parents(new Node("root", "something")).isEmpty()); + } + + @Test + public void toForestFlatNodesIsEmpty() { + Forest result = HierarchyUtilities.toForest(new LinkedList>()); + assertThat(result.getAllNodes().isEmpty(), is(true)); + assertTrue(result.getRootNodes().isEmpty()); + } +} diff --git a/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/NodeTest.java b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/NodeTest.java new file mode 100644 index 0000000000..f705389cab --- /dev/null +++ b/waltz-common/src/jcover/java/com/khartec/waltz/common/hierarchy/NodeTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.common.hierarchy; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; +import static org.hamcrest.core.IsSame.sameInstance; +import static org.junit.Assert.assertTrue; + +import com.khartec.waltz.common.Aliases; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.common.hierarchy.Node + * + * @author Diffblue JCover + */ + +public class NodeTest { + + @Test + public void addChild() { + Node node = new Node("root", "something"); + assertThat(node.addChild(new Node(new Aliases(), new Aliases())), sameInstance(node)); + assertThat(node.getChildren().size(), is(1)); + } + + @Test + public void getters() { + assertTrue(new Node("root", "something").getChildren().isEmpty()); + assertThat(new Node("root", "something").getData(), is("something")); + assertThat(new Node("root", "something").getId(), is("root")); + assertThat(new Node("root", "something").getParent(), is(nullValue())); + } + + @Test + public void setParent() { + Node node = new Node("root", "something"); + Node parent = new Node("root", "something"); + assertThat(node.setParent(parent), sameInstance(node)); + assertThat(node.getParent(), sameInstance(parent)); + } +} From 9517208ade1278c9423daf267de7b6974342782d Mon Sep 17 00:00:00 2001 From: Thomas Perkins Date: Thu, 5 Mar 2020 17:06:14 +0000 Subject: [PATCH 3/4] Add dcover tests for "waltz-model" Coverage: 59.5% --- .../waltz/model/DurationDiffblueTest.java | 13 ++ .../model/EndOfLifeStatusDiffblueTest.java | 21 ++ .../EntityLifecycleStatusDiffblueTest.java | 17 ++ .../EntityLinkUtilitiesDiffblueTest.java | 20 ++ .../HierarchyQueryScopeDiffblueTest.java | 31 +++ .../ImmutableCodedReferenceDiffblueTest.java | 40 ++++ ...mmutableDateChangeCommandDiffblueTest.java | 63 ++++++ .../ImmutableEntityReferenceDiffblueTest.java | 68 +++++++ ...EntityReferenceKeyedGroupDiffblueTest.java | 40 ++++ .../model/ImmutableEntryDiffblueTest.java | 40 ++++ .../model/ImmutableEnumValueDiffblueTest.java | 104 ++++++++++ ...mmutableIdCommandResponseDiffblueTest.java | 70 +++++++ .../model/ImmutableIdGroupDiffblueTest.java | 43 ++++ ...mutableIdSelectionOptionsDiffblueTest.java | 65 ++++++ ...bleLeveledEntityReferenceDiffblueTest.java | 46 +++++ ...ecycleStatusChangeCommandDiffblueTest.java | 27 +++ ...ImmutableSelectionFiltersDiffblueTest.java | 94 +++++++++ ...utableSetAttributeCommandDiffblueTest.java | 60 ++++++ .../model/ImmutableSimpleDiffblueTest.java | 25 +++ ...utableStringChangeCommandDiffblueTest.java | 69 +++++++ ...eUpdateDescriptionCommandDiffblueTest.java | 78 ++++++++ ...mmutableUpdateNameCommandDiffblueTest.java | 25 +++ .../ImmutableUserTimestampDiffblueTest.java | 32 +++ ...ImmutableWaltzVersionInfoDiffblueTest.java | 52 +++++ .../model/ImmutableWebErrorDiffblueTest.java | 28 +++ .../waltz/model/QuarterDiffblueTest.java | 22 +++ .../ImmutableAccessLogDiffblueTest.java | 53 +++++ .../ImmutableAccessTimeDiffblueTest.java | 32 +++ ...mutableActorChangeCommandDiffblueTest.java | 37 ++++ ...mutableActorCreateCommandDiffblueTest.java | 58 ++++++ .../actor/ImmutableActorDiffblueTest.java | 100 ++++++++++ .../ImmutableAllocationDiffblueTest.java | 89 +++++++++ ...easurablePercentageChangeDiffblueTest.java | 47 +++++ ...tableMeasurablePercentageDiffblueTest.java | 45 +++++ ...ImmutableAllocationSchemeDiffblueTest.java | 67 +++++++ ...bleAppGroupBulkAddRequestDiffblueTest.java | 161 +++++++++++++++ .../ImmutableAppGroupDetailDiffblueTest.java | 76 +++++++ .../ImmutableAppGroupDiffblueTest.java | 81 ++++++++ .../ImmutableAppGroupMemberDiffblueTest.java | 56 ++++++ ...bleAppRegistrationRequestDiffblueTest.java | 123 ++++++++++++ ...leAppRegistrationResponseDiffblueTest.java | 28 +++ .../ImmutableApplicationDiffblueTest.java | 158 +++++++++++++++ ...icationIdSelectionOptionsDiffblueTest.java | 65 ++++++ ...tableAssessmentDefinitionDiffblueTest.java | 119 +++++++++++ ...bleAssessmentRatingDetailDiffblueTest.java | 30 +++ ...ImmutableAssessmentRatingDiffblueTest.java | 87 ++++++++ ...veAssessmentRatingCommandDiffblueTest.java | 46 +++++ ...veAssessmentRatingCommandDiffblueTest.java | 87 ++++++++ ...utableAttestEntityCommandDiffblueTest.java | 30 +++ ...eAttestationCreateSummaryDiffblueTest.java | 59 ++++++ ...utableAttestationInstanceDiffblueTest.java | 49 +++++ ...estationInstanceRecipientDiffblueTest.java | 42 ++++ ...testationRunCreateCommandDiffblueTest.java | 75 +++++++ .../ImmutableAttestationRunDiffblueTest.java | 91 +++++++++ ...stationRunResponseSummaryDiffblueTest.java | 59 ++++++ .../ImmutableAttributeChangeDiffblueTest.java | 109 +++++++++++ ...itativeRatingVantagePointDiffblueTest.java | 84 ++++++++ ...tativeSourceCreateCommandDiffblueTest.java | 85 ++++++++ ...utableAuthoritativeSourceDiffblueTest.java | 71 +++++++ ...tativeSourceUpdateCommandDiffblueTest.java | 43 ++++ ...bleNonAuthoritativeSourceDiffblueTest.java | 51 +++++ .../ImmutableBookmarkDiffblueTest.java | 108 ++++++++++ ...ImmutableChangeInitiativeDiffblueTest.java | 133 +++++++++++++ .../ImmutableChangeSetDiffblueTest.java | 98 ++++++++++ .../ImmutableChangeUnitDiffblueTest.java | 118 +++++++++++ ...calFlowChangeUnitViewItemDiffblueTest.java | 41 ++++ ...ateExecutionStatusCommandDiffblueTest.java | 34 ++++ .../ImmutableChangeLogDiffblueTest.java | 68 +++++++ .../ImmutableCheckpointDiffblueTest.java | 72 +++++++ .../ImmutableCheckpointGoalDiffblueTest.java | 63 ++++++ .../ImmutableClientCacheKeyDiffblueTest.java | 41 ++++ .../ImmutableCommandResponseDiffblueTest.java | 32 +++ .../ImmutableDateFieldChangeDiffblueTest.java | 160 +++++++++++++++ .../ImmutableFieldChangeDiffblueTest.java | 68 +++++++ ...ImmutableComplexityRatingDiffblueTest.java | 37 ++++ .../ImmutableComplexityScoreDiffblueTest.java | 63 ++++++ .../ImmutableApplicationCostDiffblueTest.java | 30 +++ .../cost/ImmutableAssetCostDiffblueTest.java | 61 ++++++ ...ableAssetCostQueryOptionsDiffblueTest.java | 33 ++++ .../model/cost/ImmutableCostDiffblueTest.java | 73 +++++++ ...tableDataTypeDirectionKeyDiffblueTest.java | 41 ++++ ...bleDecoratorRatingSummaryDiffblueTest.java | 46 +++++ ...tableLogicalFlowDecoratorDiffblueTest.java | 81 ++++++++ ...eLogicalFlowDecoratorStatDiffblueTest.java | 47 +++++ ...eDataFlowDecoratorsActionDiffblueTest.java | 60 ++++++ .../ImmutableDataTypeUsageDiffblueTest.java | 48 +++++ ...utableDatabaseInformationDiffblueTest.java | 143 ++++++++++++++ ...DatabaseSummaryStatisticsDiffblueTest.java | 176 +++++++++++++++++ .../ImmutableDataTypeDiffblueTest.java | 105 ++++++++++ ...utableDrillGridDefinitionDiffblueTest.java | 45 +++++ ...mutableEndUserApplicationDiffblueTest.java | 142 ++++++++++++++ ...tableEntityEnumDefinitionDiffblueTest.java | 111 +++++++++++ .../ImmutableEntityEnumValueDiffblueTest.java | 72 +++++++ ...utableEntityHierarchyItemDiffblueTest.java | 52 +++++ ...utableEntityNamedNodeTypeDiffblueTest.java | 79 ++++++++ .../ImmutableEntityNamedNoteDiffblueTest.java | 72 +++++++ ...amedNoteTypeChangeCommandDiffblueTest.java | 148 ++++++++++++++ ...RelationshipChangeCommandDiffblueTest.java | 42 ++++ ...mutableEntityRelationshipDiffblueTest.java | 70 +++++++ ...ableEntityRelationshipKeyDiffblueTest.java | 30 +++ ...eEntityRelationshipParamsDiffblueTest.java | 45 +++++ ...utableEntitySearchOptionsDiffblueTest.java | 86 ++++++++ ...EntityStatisticDefinitionDiffblueTest.java | 163 +++++++++++++++ .../ImmutableEntityStatisticDiffblueTest.java | 42 ++++ ...tableEntityStatisticValueDiffblueTest.java | 121 ++++++++++++ ...ImmutableEntitySvgDiagramDiffblueTest.java | 77 ++++++++ ...eEntityWorkflowDefinitionDiffblueTest.java | 43 ++++ ...utableEntityWorkflowStateDiffblueTest.java | 94 +++++++++ ...eEntityWorkflowTransitionDiffblueTest.java | 96 +++++++++ .../enum_value/EnumValueKindDiffblueTest.java | 13 ++ .../NotAuthorizedExceptionDiffblueTest.java | 36 ++++ ...mutableExternalIdentifierDiffblueTest.java | 42 ++++ ...ableFlowDiagramAnnotationDiffblueTest.java | 45 +++++ .../ImmutableFlowDiagramDiffblueTest.java | 100 ++++++++++ ...mmutableFlowDiagramEntityDiffblueTest.java | 32 +++ ...mutableSaveDiagramCommandDiffblueTest.java | 83 ++++++++ ...mutableImmediateHierarchyDiffblueTest.java | 40 ++++ ...bleApplicationInvolvementDiffblueTest.java | 30 +++ ...yInvolvementChangeCommandDiffblueTest.java | 46 +++++ .../ImmutableInvolvementDiffblueTest.java | 72 +++++++ ...olvementKindChangeCommandDiffblueTest.java | 36 ++++ ...olvementKindCreateCommandDiffblueTest.java | 42 ++++ .../ImmutableInvolvementKindDiffblueTest.java | 66 +++++++ .../licence/ImmutableLicenceDiffblueTest.java | 88 +++++++++ ...lDataElementChangeCommandDiffblueTest.java | 66 +++++++ ...mutableLogicalDataElementDiffblueTest.java | 106 ++++++++++ ...ableAddLogicalFlowCommandDiffblueTest.java | 19 ++ .../ImmutableLogicalFlowDiffblueTest.java | 63 ++++++ ...utableLogicalFlowMeasuresDiffblueTest.java | 64 ++++++ ...ableLogicalFlowStatisticsDiffblueTest.java | 52 +++++ .../ImmutableMeasurableDiffblueTest.java | 124 ++++++++++++ ...mutableMeasurableCategoryDiffblueTest.java | 110 +++++++++++ ...ImmutableMeasurableRatingDiffblueTest.java | 97 +++++++++ ...veMeasurableRatingCommandDiffblueTest.java | 34 ++++ ...veMeasurableRatingCommandDiffblueTest.java | 83 ++++++++ ...RatingPlannedDecommissionDiffblueTest.java | 70 +++++++ ...asurableRatingReplacementDiffblueTest.java | 70 +++++++ ...bleMeasurableRelationshipDiffblueTest.java | 98 ++++++++++ ...utableNotificationSummaryDiffblueTest.java | 45 +++++ ...mutableOrganisationalUnitDiffblueTest.java | 56 ++++++ ...ganisationalUnitHierarchyDiffblueTest.java | 60 ++++++ ...mutableOrphanRelationshipDiffblueTest.java | 30 +++ ...rformanceMetricDefinitionDiffblueTest.java | 67 +++++++ .../pack/ImmutableMetricPackDiffblueTest.java | 90 +++++++++ .../ImmutableMetricPackItemDiffblueTest.java | 65 ++++++ .../ImmutableMetricSampleDiffblueTest.java | 76 +++++++ .../person/ImmutablePersonDiffblueTest.java | 107 ++++++++++ .../ImmutableFlowAttributesDiffblueTest.java | 90 +++++++++ ...PhysicalFlowCreateCommandDiffblueTest.java | 47 +++++ ...FlowCreateCommandResponseDiffblueTest.java | 47 +++++ ...PhysicalFlowDeleteCommandDiffblueTest.java | 31 +++ ...FlowDeleteCommandResponseDiffblueTest.java | 79 ++++++++ .../ImmutablePhysicalFlowDiffblueTest.java | 185 ++++++++++++++++++ ...mutablePhysicalFlowParsedDiffblueTest.java | 142 ++++++++++++++ ...ecDefinitionChangeCommandDiffblueTest.java | 31 +++ ...PhysicalFlowUploadCommandDiffblueTest.java | 184 +++++++++++++++++ ...FlowUploadCommandResponseDiffblueTest.java | 69 +++++++ ...lePhysicalFlowParticipantDiffblueTest.java | 85 ++++++++ ...alSpecificationAddCommandDiffblueTest.java | 56 ++++++ ...pecificationDeleteCommandDiffblueTest.java | 31 +++ ...ablePhysicalSpecificationDiffblueTest.java | 97 +++++++++ ...icalSpecificationDataTypeDiffblueTest.java | 73 +++++++ ...ecDefinitionChangeCommandDiffblueTest.java | 54 +++++ ...blePhysicalSpecDefinitionDiffblueTest.java | 114 +++++++++++ ...initionFieldChangeCommandDiffblueTest.java | 69 +++++++ ...ysicalSpecDefinitionFieldDiffblueTest.java | 91 +++++++++ ...onSampleFileCreateCommandDiffblueTest.java | 43 ++++ ...lSpecDefinitionSampleFileDiffblueTest.java | 57 ++++++ .../rating/ImmutableRagNameDiffblueTest.java | 23 +++ .../ImmutableRatingSchemeDiffblueTest.java | 45 +++++ ...oadmapAndScenarioOverviewDiffblueTest.java | 49 +++++ ...tableRoadmapCreateCommandDiffblueTest.java | 47 +++++ .../roadmap/ImmutableRoadmapDiffblueTest.java | 101 ++++++++++ .../model/role/ImmutableRoleDiffblueTest.java | 74 +++++++ ...ImmutableScenarioAxisItemDiffblueTest.java | 60 ++++++ .../ImmutableScenarioDiffblueTest.java | 128 ++++++++++++ ...mutableScenarioRatingItemDiffblueTest.java | 76 +++++++ ...mmutableServerInformationDiffblueTest.java | 136 +++++++++++++ ...leServerSummaryStatisticsDiffblueTest.java | 126 ++++++++++++ .../ImmutableServerUsageDiffblueTest.java | 72 +++++++ .../ImmutableSettingDiffblueTest.java | 45 +++++ ...ImmutableSharedPreferenceDiffblueTest.java | 66 +++++++ ...aredPreferenceSaveCommandDiffblueTest.java | 52 +++++ .../ImmutableSoftwareCatalogDiffblueTest.java | 141 +++++++++++++ .../ImmutableSoftwarePackageDiffblueTest.java | 125 ++++++++++++ ...utableSoftwarePackageViewDiffblueTest.java | 119 +++++++++++ ...SoftwareSummaryStatisticsDiffblueTest.java | 158 +++++++++++++++ .../ImmutableSoftwareUsageDiffblueTest.java | 84 ++++++++ .../ImmutableSoftwareVersionDiffblueTest.java | 111 +++++++++++ ...ImmutableSourceDataRatingDiffblueTest.java | 85 ++++++++ .../ImmutableStaticPanelDiffblueTest.java | 107 ++++++++++ ...rveyInstanceCreateCommandDiffblueTest.java | 45 +++++ .../ImmutableSurveyInstanceDiffblueTest.java | 93 +++++++++ ...yInstanceQuestionResponseDiffblueTest.java | 55 ++++++ ...nceRecipientCreateCommandDiffblueTest.java | 40 ++++ ...leSurveyInstanceRecipientDiffblueTest.java | 34 ++++ ...nceRecipientUpdateCommandDiffblueTest.java | 52 +++++ ...stanceStatusChangeCommandDiffblueTest.java | 25 +++ .../ImmutableSurveyQuestionDiffblueTest.java | 90 +++++++++ ...rveyQuestionDropdownEntryDiffblueTest.java | 41 ++++ ...bleSurveyQuestionResponseDiffblueTest.java | 37 ++++ ...bleSurveyRunChangeCommandDiffblueTest.java | 81 ++++++++ ...leSurveyRunCompletionRateDiffblueTest.java | 79 ++++++++ ...bleSurveyRunCreateCommandDiffblueTest.java | 82 ++++++++ .../ImmutableSurveyRunDiffblueTest.java | 115 +++++++++++ ...veyRunStatusChangeCommandDiffblueTest.java | 25 +++ ...urveyRunWithOwnerAndStatsDiffblueTest.java | 43 ++++ ...rveyTemplateChangeCommandDiffblueTest.java | 55 ++++++ .../ImmutableSurveyTemplateDiffblueTest.java | 81 ++++++++ .../svg/ImmutableSvgDiagramDiffblueTest.java | 131 +++++++++++++ .../job_log/ImmutableJobLogDiffblueTest.java | 68 +++++++ .../model/tag/ImmutableTagDiffblueTest.java | 60 ++++++ .../tag/ImmutableTagUsageDiffblueTest.java | 69 +++++++ ...ableMeasurableRatingTallyDiffblueTest.java | 59 ++++++ .../ImmutableOrderedTallyDiffblueTest.java | 58 ++++++ .../tally/ImmutableTallyDiffblueTest.java | 47 +++++ .../tally/ImmutableTallyPackDiffblueTest.java | 28 +++ ...ableTaxonomyChangeCommandDiffblueTest.java | 76 +++++++ ...tableTaxonomyChangeImpactDiffblueTest.java | 53 +++++ ...ableTaxonomyChangePreviewDiffblueTest.java | 44 +++++ .../ImmutableThumbnailDiffblueTest.java | 82 ++++++++ .../ImmutableUsageInfoDiffblueTest.java | 56 ++++++ ...bleAuthenticationResponseDiffblueTest.java | 61 ++++++ .../ImmutableLoginRequestDiffblueTest.java | 40 ++++ ...tablePasswordResetRequestDiffblueTest.java | 52 +++++ .../model/user/ImmutableUserDiffblueTest.java | 45 +++++ .../ImmutableUserPreferenceDiffblueTest.java | 40 ++++ ...leUserRegistrationRequestDiffblueTest.java | 40 ++++ .../model/user/SystemRoleDiffblueTest.java | 29 +++ .../ImmutableUserAgentInfoDiffblueTest.java | 86 ++++++++ 230 files changed, 15821 insertions(+) create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/DurationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/EndOfLifeStatusDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLifecycleStatusDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLinkUtilitiesDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/HierarchyQueryScopeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableCodedReferenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableDateChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceKeyedGroupDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEnumValueDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdCommandResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdGroupDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdSelectionOptionsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableLeveledEntityReferenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableReleaseLifecycleStatusChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSelectionFiltersDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSetAttributeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSimpleDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableStringChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateDescriptionCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateNameCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUserTimestampDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWaltzVersionInfoDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWebErrorDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/QuarterDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessLogDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessTimeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableAllocationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageChangeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/allocation_scheme/ImmutableAllocationSchemeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupBulkAddRequestDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDetailDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupMemberDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationRequestDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationIdSelectionOptionsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_definition/ImmutableAssessmentDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDetailDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableRemoveAssessmentRatingCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableSaveAssessmentRatingCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestEntityCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationCreateSummaryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceRecipientDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunResponseSummaryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/attribute_change/ImmutableAttributeChangeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeRatingVantagePointDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceUpdateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableNonAuthoritativeSourceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/bookmark/ImmutableBookmarkDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/change_initiative/ImmutableChangeInitiativeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/change_set/ImmutableChangeSetDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableChangeUnitDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutablePhysicalFlowChangeUnitViewItemDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableUpdateExecutionStatusCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/changelog/ImmutableChangeLogDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointGoalDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/client_cache_key/ImmutableClientCacheKeyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableCommandResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableDateFieldChangeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableFieldChangeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityRatingDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityScoreDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableApplicationCostDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostQueryOptionsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableCostDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDataTypeDirectionKeyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDecoratorRatingSummaryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorStatDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableUpdateDataFlowDecoratorsActionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/data_type_usage/ImmutableDataTypeUsageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseInformationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseSummaryStatisticsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/datatype/ImmutableDataTypeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/drill_grid/ImmutableDrillGridDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/enduserapp/ImmutableEndUserApplicationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumValueDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_hierarchy/ImmutableEntityHierarchyItemDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNodeTypeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteTypeChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipKeyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableUpdateEntityRelationshipParamsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_search/ImmutableEntitySearchOptionsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticValueDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_svg_diagram/ImmutableEntitySvgDiagramDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowStateDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowTransitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/enum_value/EnumValueKindDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/external_identifier/ImmutableExternalIdentifierDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramAnnotationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramEntityDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableSaveDiagramCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/immediate_hierarchy/ImmutableImmediateHierarchyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableApplicationInvolvementDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableEntityInvolvementChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableInvolvementDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/licence/ImmutableLicenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableAddLogicalFlowCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowMeasuresDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowStatisticsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable/ImmutableMeasurableDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_category/ImmutableMeasurableCategoryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableMeasurableRatingDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableRemoveMeasurableRatingCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableSaveMeasurableRatingCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_planned_decommission/ImmutableMeasurableRatingPlannedDecommissionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_replacement/ImmutableMeasurableRatingReplacementDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_relationship/ImmutableMeasurableRelationshipDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/notification/ImmutableNotificationSummaryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitHierarchyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/orphan/ImmutableOrphanRelationshipDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/ImmutablePerformanceMetricDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackItemDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/sample/ImmutableMetricSampleDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/person/ImmutablePersonDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutableFlowAttributesDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowParsedDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowSpecDefinitionChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow_participant/ImmutablePhysicalFlowParticipantDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationAddCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDeleteCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_data_type/ImmutablePhysicalSpecificationDataTypeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRagNameDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRatingSchemeDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapAndScenarioOverviewDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/role/ImmutableRoleDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioAxisItemDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioRatingItemDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerInformationDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerSummaryStatisticsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/server_usage/ImmutableServerUsageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/settings/ImmutableSettingDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceSaveCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareCatalogDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageViewDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareSummaryStatisticsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareUsageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareVersionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/source_data_rating/ImmutableSourceDataRatingDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/staticpanel/ImmutableStaticPanelDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceQuestionResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientUpdateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceStatusChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDropdownEntryDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCompletionRateDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCreateCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunStatusChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunWithOwnerAndStatsDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/svg/ImmutableSvgDiagramDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/system/job_log/ImmutableJobLogDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagUsageDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableMeasurableRatingTallyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableOrderedTallyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyPackDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeCommandDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeImpactDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangePreviewDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/thumbnail/ImmutableThumbnailDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/usage_info/ImmutableUsageInfoDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableAuthenticationResponseDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableLoginRequestDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutablePasswordResetRequestDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserPreferenceDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserRegistrationRequestDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user/SystemRoleDiffblueTest.java create mode 100644 waltz-model/src/dcover/java/com/khartec/waltz/model/user_agent_info/ImmutableUserAgentInfoDiffblueTest.java diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/DurationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/DurationDiffblueTest.java new file mode 100644 index 0000000000..c75043d96a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/DurationDiffblueTest.java @@ -0,0 +1,13 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class DurationDiffblueTest { + @Test + public void numDaysTest() { + // Arrange, Act and Assert + assertEquals(1, Duration.DAY.numDays()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/EndOfLifeStatusDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/EndOfLifeStatusDiffblueTest.java new file mode 100644 index 0000000000..841676d9b3 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/EndOfLifeStatusDiffblueTest.java @@ -0,0 +1,21 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import java.util.Date; +import org.junit.Test; + +public class EndOfLifeStatusDiffblueTest { + @Test + public void calculateEndOfLifeStatusTest() { + // Arrange, Act and Assert + assertEquals(EndOfLifeStatus.NOT_END_OF_LIFE, + EndOfLifeStatus.calculateEndOfLifeStatus(new Date(9223372036854775807L))); + } + + @Test + public void calculateEndOfLifeStatusTest2() { + // Arrange, Act and Assert + assertEquals(EndOfLifeStatus.END_OF_LIFE, EndOfLifeStatus.calculateEndOfLifeStatus(new Date(1L))); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLifecycleStatusDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLifecycleStatusDiffblueTest.java new file mode 100644 index 0000000000..c65b78cc1d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLifecycleStatusDiffblueTest.java @@ -0,0 +1,17 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class EntityLifecycleStatusDiffblueTest { + @Test + public void fromIsRemovedFlagTest() { + // Arrange + EntityLifecycleStatus actualFromIsRemovedFlagResult = EntityLifecycleStatus.fromIsRemovedFlag(true); + + // Act and Assert + assertEquals(EntityLifecycleStatus.REMOVED, actualFromIsRemovedFlagResult); + assertEquals(EntityLifecycleStatus.ACTIVE, EntityLifecycleStatus.fromIsRemovedFlag(false)); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLinkUtilitiesDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLinkUtilitiesDiffblueTest.java new file mode 100644 index 0000000000..683abc7f40 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/EntityLinkUtilitiesDiffblueTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class EntityLinkUtilitiesDiffblueTest { + @Test + public void mkExternalIdLinkTest() { + // Arrange, Act and Assert + assertEquals("baseUrlentity/ACTOR/external-id/123", + EntityLinkUtilities.mkExternalIdLink("baseUrl", EntityKind.ACTOR, "123")); + } + + @Test + public void mkIdLinkTest() { + // Arrange, Act and Assert + assertEquals("baseUrlentity/ACTOR/id/123", EntityLinkUtilities.mkIdLink("baseUrl", EntityKind.ACTOR, 123L)); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/HierarchyQueryScopeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/HierarchyQueryScopeDiffblueTest.java new file mode 100644 index 0000000000..2542b5b31c --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/HierarchyQueryScopeDiffblueTest.java @@ -0,0 +1,31 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class HierarchyQueryScopeDiffblueTest { + @Test + public void determineDownwardsScopeForKindTest() { + // Arrange + HierarchyQueryScope actualDetermineDownwardsScopeForKindResult = HierarchyQueryScope + .determineDownwardsScopeForKind(EntityKind.ACTOR); + + // Act and Assert + assertEquals(HierarchyQueryScope.EXACT, actualDetermineDownwardsScopeForKindResult); + assertEquals(HierarchyQueryScope.CHILDREN, + HierarchyQueryScope.determineDownwardsScopeForKind(EntityKind.CHANGE_INITIATIVE)); + } + + @Test + public void determineUpwardsScopeForKindTest() { + // Arrange + HierarchyQueryScope actualDetermineUpwardsScopeForKindResult = HierarchyQueryScope + .determineUpwardsScopeForKind(EntityKind.ACTOR); + + // Act and Assert + assertEquals(HierarchyQueryScope.EXACT, actualDetermineUpwardsScopeForKindResult); + assertEquals(HierarchyQueryScope.PARENTS, + HierarchyQueryScope.determineUpwardsScopeForKind(EntityKind.CHANGE_INITIATIVE)); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableCodedReferenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableCodedReferenceDiffblueTest.java new file mode 100644 index 0000000000..55439c6895 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableCodedReferenceDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableCodedReferenceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableCodedReference.Json actualJson = new ImmutableCodedReference.Json(); + + // Assert + assertNull(actualJson.code); + assertNull(actualJson.name); + } + @Test + public void setCodeTest() { + // Arrange + ImmutableCodedReference.Json json = new ImmutableCodedReference.Json(); + + // Act + json.setCode("code"); + + // Assert + assertEquals("code", json.code); + } + @Test + public void setNameTest() { + // Arrange + ImmutableCodedReference.Json json = new ImmutableCodedReference.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableDateChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableDateChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..cd553e40bb --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableDateChangeCommandDiffblueTest.java @@ -0,0 +1,63 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.time.LocalDate; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableDateChangeCommandDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("DateChangeCommand{}", ImmutableDateChangeCommand.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + Optional optional = (new ImmutableDateChangeCommand.Json()).newDateVal; + assertEquals("Optional.empty", optional.toString()); + assertFalse(optional.isPresent()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableDateChangeCommand.fromJson(new ImmutableDateChangeCommand.Json()).equals("DateChangeCommand{")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("DateChangeCommand{}", + ImmutableDateChangeCommand.fromJson(new ImmutableDateChangeCommand.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, ImmutableDateChangeCommand.fromJson(new ImmutableDateChangeCommand.Json()).hashCode()); + } + + @Test + public void newDateValTest() { + // Arrange + ImmutableDateChangeCommand.Json json = new ImmutableDateChangeCommand.Json(); + + // Act and Assert + assertSame(json.newDateVal, ImmutableDateChangeCommand.fromJson(json).newDateVal()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("DateChangeCommand{}", + ImmutableDateChangeCommand.fromJson(new ImmutableDateChangeCommand.Json()).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceDiffblueTest.java new file mode 100644 index 0000000000..0c98b4a3ea --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceDiffblueTest.java @@ -0,0 +1,68 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableEntityReferenceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityReference.Json actualJson = new ImmutableEntityReference.Json(); + + // Assert + assertFalse(actualJson.idIsSet); + assertNull(actualJson.description); + assertEquals(0L, actualJson.id); + assertNull(actualJson.kind); + assertNull(actualJson.entityLifecycleStatus); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityReference.Json json = new ImmutableEntityReference.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableEntityReference.Json json = new ImmutableEntityReference.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setIdTest() { + // Arrange + ImmutableEntityReference.Json json = new ImmutableEntityReference.Json(); + + // Act + json.setId(123L); + + // Assert + assertTrue(json.idIsSet); + assertEquals(123L, json.id); + } + @Test + public void setKindTest() { + // Arrange + ImmutableEntityReference.Json json = new ImmutableEntityReference.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceKeyedGroupDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceKeyedGroupDiffblueTest.java new file mode 100644 index 0000000000..6be127d254 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntityReferenceKeyedGroupDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableEntityReferenceKeyedGroupDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableEntityReferenceKeyedGroup.Json()).values.size()); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableEntityReferenceKeyedGroup.Json json = new ImmutableEntityReferenceKeyedGroup.Json(); + ImmutableEntityReference.Json json1 = new ImmutableEntityReference.Json(); + + // Act + json.setKey(json1); + + // Assert + assertSame(json1, json.key); + } + @Test + public void setValuesTest() { + // Arrange + ImmutableEntityReferenceKeyedGroup.Json json = new ImmutableEntityReferenceKeyedGroup.Json(); + ArrayList entityReferenceList = new ArrayList(); + entityReferenceList.add(new ImmutableEntityReference.Json()); + + // Act + json.setValues(entityReferenceList); + + // Assert + assertSame(entityReferenceList, json.values); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntryDiffblueTest.java new file mode 100644 index 0000000000..adcac4a10a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEntryDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableEntryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntry.Json actualJson = new ImmutableEntry.Json(); + + // Assert + assertNull(actualJson.key); + assertNull(actualJson.value); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableEntry.Json json = new ImmutableEntry.Json(); + + // Act + json.setKey("key"); + + // Assert + assertTrue(json.key instanceof String); + } + @Test + public void setValueTest() { + // Arrange + ImmutableEntry.Json json = new ImmutableEntry.Json(); + + // Act + json.setValue("value"); + + // Assert + assertTrue(json.value instanceof String); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEnumValueDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEnumValueDiffblueTest.java new file mode 100644 index 0000000000..01500d9bcf --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableEnumValueDiffblueTest.java @@ -0,0 +1,104 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableEnumValueDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEnumValue.Json actualJson = new ImmutableEnumValue.Json(); + + // Assert + assertNull(actualJson.type); + assertEquals(0, actualJson.position); + assertFalse(actualJson.positionIsSet); + assertNull(actualJson.description); + assertNull(actualJson.iconColor); + assertNull(actualJson.name); + assertNull(actualJson.icon); + assertNull(actualJson.key); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIconColorTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setIconColor("iconColor"); + + // Assert + assertEquals("iconColor", json.iconColor); + } + @Test + public void setIconTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setIcon("icon"); + + // Assert + assertEquals("icon", json.icon); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } + @Test + public void setNameTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setPosition(1); + + // Assert + assertEquals(1, json.position); + assertTrue(json.positionIsSet); + } + @Test + public void setTypeTest() { + // Arrange + ImmutableEnumValue.Json json = new ImmutableEnumValue.Json(); + + // Act + json.setType("type"); + + // Assert + assertEquals("type", json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdCommandResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdCommandResponseDiffblueTest.java new file mode 100644 index 0000000000..14937430fa --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdCommandResponseDiffblueTest.java @@ -0,0 +1,70 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableIdCommandResponseDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("IdCommandResponse{}", ImmutableIdCommandResponse.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + Optional optional = (new ImmutableIdCommandResponse.Json()).id; + assertEquals("Optional.empty", optional.toString()); + assertFalse(optional.isPresent()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableIdCommandResponse.fromJson(new ImmutableIdCommandResponse.Json()).equals("IdCommandResponse{")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("IdCommandResponse{}", + ImmutableIdCommandResponse.fromJson(new ImmutableIdCommandResponse.Json()).toString()); + } + + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, ImmutableIdCommandResponse.fromJson(new ImmutableIdCommandResponse.Json()).hashCode()); + } + + @Test + public void idTest() { + // Arrange + ImmutableIdCommandResponse.Json json = new ImmutableIdCommandResponse.Json(); + + // Act and Assert + assertSame(json.id, ImmutableIdCommandResponse.fromJson(json).id()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("IdCommandResponse{}", + ImmutableIdCommandResponse.fromJson(new ImmutableIdCommandResponse.Json()).toString()); + } + + @Test + public void withIdTest() { + // Arrange, Act and Assert + assertEquals("IdCommandResponse{id=42}", + ImmutableIdCommandResponse.fromJson(new ImmutableIdCommandResponse.Json()).withId(42L).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdGroupDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdGroupDiffblueTest.java new file mode 100644 index 0000000000..f30719fa42 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdGroupDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableIdGroupDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableIdGroup.Json()).values.size()); + } + + + @Test + public void setKeyTest() { + // Arrange + ImmutableIdGroup.Json json = new ImmutableIdGroup.Json(); + + // Act + json.setKey(1L); + + // Assert + assertEquals(Long.valueOf(1L), json.key); + } + + @Test + public void setValuesTest() { + // Arrange + ImmutableIdGroup.Json json = new ImmutableIdGroup.Json(); + ArrayList resultLongList = new ArrayList(); + resultLongList.add(1L); + + // Act + json.setValues(resultLongList); + + // Assert + assertSame(resultLongList, json.values); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdSelectionOptionsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdSelectionOptionsDiffblueTest.java new file mode 100644 index 0000000000..95fd69515a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableIdSelectionOptionsDiffblueTest.java @@ -0,0 +1,65 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableIdSelectionOptionsDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableIdSelectionOptions.Json()).entityLifecycleStatuses.size()); + } + @Test + public void setEntityLifecycleStatusesTest() { + // Arrange + ImmutableIdSelectionOptions.Json json = new ImmutableIdSelectionOptions.Json(); + HashSet entityLifecycleStatusSet = new HashSet(); + entityLifecycleStatusSet.add(EntityLifecycleStatus.ACTIVE); + + // Act + json.setEntityLifecycleStatuses(entityLifecycleStatusSet); + + // Assert + assertSame(entityLifecycleStatusSet, json.entityLifecycleStatuses); + assertTrue(json.entityLifecycleStatusesIsSet); + } + @Test + public void setEntityReferenceTest() { + // Arrange + ImmutableIdSelectionOptions.Json json = new ImmutableIdSelectionOptions.Json(); + ImmutableEntityReference.Json json1 = new ImmutableEntityReference.Json(); + + // Act + json.setEntityReference(json1); + + // Assert + assertSame(json1, json.entityReference); + } + @Test + public void setFiltersTest() { + // Arrange + ImmutableIdSelectionOptions.Json json = new ImmutableIdSelectionOptions.Json(); + ImmutableSelectionFilters.Json json1 = new ImmutableSelectionFilters.Json(); + + // Act + json.setFilters(json1); + + // Assert + assertSame(json1, json.filters); + } + @Test + public void setScopeTest() { + // Arrange + ImmutableIdSelectionOptions.Json json = new ImmutableIdSelectionOptions.Json(); + + // Act + json.setScope(HierarchyQueryScope.EXACT); + + // Assert + assertEquals(HierarchyQueryScope.EXACT, json.scope); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableLeveledEntityReferenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableLeveledEntityReferenceDiffblueTest.java new file mode 100644 index 0000000000..3b9ef88dd4 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableLeveledEntityReferenceDiffblueTest.java @@ -0,0 +1,46 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableLeveledEntityReferenceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLeveledEntityReference.Json actualJson = new ImmutableLeveledEntityReference.Json(); + + // Assert + assertNull(actualJson.entityReference); + assertFalse(actualJson.levelIsSet); + assertEquals(0, actualJson.level); + } + @Test + public void setEntityReferenceTest() { + // Arrange + ImmutableLeveledEntityReference.Json json = new ImmutableLeveledEntityReference.Json(); + ImmutableEntityReference.Json json1 = new ImmutableEntityReference.Json(); + + // Act + json.setEntityReference(json1); + + // Assert + assertSame(json1, json.entityReference); + } + @Test + public void setLevelTest() { + // Arrange + ImmutableLeveledEntityReference.Json json = new ImmutableLeveledEntityReference.Json(); + + // Act + json.setLevel(1); + + // Assert + assertTrue(json.levelIsSet); + assertEquals(1, json.level); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableReleaseLifecycleStatusChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableReleaseLifecycleStatusChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..9debeca5a9 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableReleaseLifecycleStatusChangeCommandDiffblueTest.java @@ -0,0 +1,27 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableReleaseLifecycleStatusChangeCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableReleaseLifecycleStatusChangeCommand.Json()).newStatus); + } + + @Test + public void setNewStatusTest() { + // Arrange + ImmutableReleaseLifecycleStatusChangeCommand.Json json = new ImmutableReleaseLifecycleStatusChangeCommand.Json(); + + // Act + json.setNewStatus(ReleaseLifecycleStatus.DRAFT); + + // Assert + assertEquals(ReleaseLifecycleStatus.DRAFT, json.newStatus); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSelectionFiltersDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSelectionFiltersDiffblueTest.java new file mode 100644 index 0000000000..ae926cb31d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSelectionFiltersDiffblueTest.java @@ -0,0 +1,94 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.application.ApplicationKind; +import java.util.ArrayList; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableSelectionFiltersDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("SelectionFilters{omitApplicationKinds=[]}", ImmutableSelectionFilters.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableSelectionFilters.Json()).omitApplicationKinds.size()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()).equals("element")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("SelectionFilters{omitApplicationKinds=[]}", + ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()).hashCode()); + } + + @Test + public void omitApplicationKindsTest2() { + // Arrange, Act and Assert + assertEquals(0, + ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()).omitApplicationKinds().size()); + } + + @Test + public void setOmitApplicationKindsTest() { + // Arrange + ImmutableSelectionFilters.Json json = new ImmutableSelectionFilters.Json(); + HashSet applicationKindSet = new HashSet(); + applicationKindSet.add(ApplicationKind.IN_HOUSE); + + // Act + json.setOmitApplicationKinds(applicationKindSet); + + // Assert + assertSame(applicationKindSet, json.omitApplicationKinds); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("SelectionFilters{omitApplicationKinds=[]}", + ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()).toString()); + } + + @Test + public void withOmitApplicationKindsTest() { + // Arrange, Act and Assert + assertEquals("SelectionFilters{omitApplicationKinds=[IN_HOUSE]}", + ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()) + .withOmitApplicationKinds(ApplicationKind.IN_HOUSE, ApplicationKind.IN_HOUSE, ApplicationKind.IN_HOUSE) + .toString()); + } + + @Test + public void withOmitApplicationKindsTest2() { + // Arrange + ImmutableSelectionFilters fromJsonResult = ImmutableSelectionFilters.fromJson(new ImmutableSelectionFilters.Json()); + ArrayList applicationKindList = new ArrayList(); + applicationKindList.add(ApplicationKind.IN_HOUSE); + + // Act and Assert + assertEquals("SelectionFilters{omitApplicationKinds=[IN_HOUSE]}", + fromJsonResult.withOmitApplicationKinds(applicationKindList).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSetAttributeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSetAttributeCommandDiffblueTest.java new file mode 100644 index 0000000000..db37c68b1d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSetAttributeCommandDiffblueTest.java @@ -0,0 +1,60 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableSetAttributeCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSetAttributeCommand.Json actualJson = new ImmutableSetAttributeCommand.Json(); + + // Assert + assertNull(actualJson.value); + assertNull(actualJson.entityReference); + assertNull(actualJson.name); + } + + + + @Test + public void setEntityReferenceTest() { + // Arrange + ImmutableSetAttributeCommand.Json json = new ImmutableSetAttributeCommand.Json(); + ImmutableEntityReference.Json json1 = new ImmutableEntityReference.Json(); + + // Act + json.setEntityReference(json1); + + // Assert + assertSame(json1, json.entityReference); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableSetAttributeCommand.Json json = new ImmutableSetAttributeCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setValueTest() { + // Arrange + ImmutableSetAttributeCommand.Json json = new ImmutableSetAttributeCommand.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSimpleDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSimpleDiffblueTest.java new file mode 100644 index 0000000000..e475bfe858 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableSimpleDiffblueTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSimpleDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableSimple.Json()).message); + } + @Test + public void setMessageTest() { + // Arrange + ImmutableSimple.Json json = new ImmutableSimple.Json(); + + // Act + json.setMessage("message"); + + // Assert + assertEquals("message", json.message); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableStringChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableStringChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..34eaadea06 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableStringChangeCommandDiffblueTest.java @@ -0,0 +1,69 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableStringChangeCommandDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("StringChangeCommand{}", ImmutableStringChangeCommand.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + Optional optional = (new ImmutableStringChangeCommand.Json()).newStringVal; + assertEquals("Optional.empty", optional.toString()); + assertFalse(optional.isPresent()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableStringChangeCommand.fromJson(new ImmutableStringChangeCommand.Json()).equals("StringChangeCommand{")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("StringChangeCommand{}", + ImmutableStringChangeCommand.fromJson(new ImmutableStringChangeCommand.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, ImmutableStringChangeCommand.fromJson(new ImmutableStringChangeCommand.Json()).hashCode()); + } + + @Test + public void newStringValTest2() { + // Arrange + ImmutableStringChangeCommand.Json json = new ImmutableStringChangeCommand.Json(); + + // Act and Assert + assertSame(json.newStringVal, ImmutableStringChangeCommand.fromJson(json).newStringVal()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("StringChangeCommand{}", + ImmutableStringChangeCommand.fromJson(new ImmutableStringChangeCommand.Json()).toString()); + } + + @Test + public void withNewStringValTest() { + // Arrange, Act and Assert + assertEquals("StringChangeCommand{newStringVal=value}", ImmutableStringChangeCommand + .fromJson(new ImmutableStringChangeCommand.Json()).withNewStringVal("value").toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateDescriptionCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateDescriptionCommandDiffblueTest.java new file mode 100644 index 0000000000..82eddc78cf --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateDescriptionCommandDiffblueTest.java @@ -0,0 +1,78 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUpdateDescriptionCommandDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("UpdateDescriptionCommand{newDescription=null}", + ImmutableUpdateDescriptionCommand.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableUpdateDescriptionCommand.Json()).newDescription); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableUpdateDescriptionCommand.fromJson(new ImmutableUpdateDescriptionCommand.Json()).equals("another")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("UpdateDescriptionCommand{newDescription=null}", + ImmutableUpdateDescriptionCommand.fromJson(new ImmutableUpdateDescriptionCommand.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, + ImmutableUpdateDescriptionCommand.fromJson(new ImmutableUpdateDescriptionCommand.Json()).hashCode()); + } + + @Test + public void newDescriptionTest2() { + // Arrange, Act and Assert + assertNull( + ImmutableUpdateDescriptionCommand.fromJson(new ImmutableUpdateDescriptionCommand.Json()).newDescription()); + } + + @Test + public void setNewDescriptionTest() { + // Arrange + ImmutableUpdateDescriptionCommand.Json json = new ImmutableUpdateDescriptionCommand.Json(); + + // Act + json.setNewDescription("newDescription"); + + // Assert + assertEquals("newDescription", json.newDescription); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("UpdateDescriptionCommand{newDescription=null}", + ImmutableUpdateDescriptionCommand.fromJson(new ImmutableUpdateDescriptionCommand.Json()).toString()); + } + + @Test + public void withNewDescriptionTest() { + // Arrange, Act and Assert + assertEquals("UpdateDescriptionCommand{newDescription=value}", ImmutableUpdateDescriptionCommand + .fromJson(new ImmutableUpdateDescriptionCommand.Json()).withNewDescription("value").toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateNameCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateNameCommandDiffblueTest.java new file mode 100644 index 0000000000..223a4bacda --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUpdateNameCommandDiffblueTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUpdateNameCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableUpdateNameCommand.Json()).newName); + } + @Test + public void setNewNameTest() { + // Arrange + ImmutableUpdateNameCommand.Json json = new ImmutableUpdateNameCommand.Json(); + + // Act + json.setNewName("newName"); + + // Assert + assertEquals("newName", json.newName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUserTimestampDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUserTimestampDiffblueTest.java new file mode 100644 index 0000000000..7694fc0ca7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableUserTimestampDiffblueTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUserTimestampDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUserTimestamp.Json actualJson = new ImmutableUserTimestamp.Json(); + + // Assert + assertNull(actualJson.by); + assertNull(actualJson.at); + } + + + @Test + public void setByTest() { + // Arrange + ImmutableUserTimestamp.Json json = new ImmutableUserTimestamp.Json(); + + // Act + json.setBy("by"); + + // Assert + assertEquals("by", json.by); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWaltzVersionInfoDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWaltzVersionInfoDiffblueTest.java new file mode 100644 index 0000000000..8343cb7c70 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWaltzVersionInfoDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableWaltzVersionInfoDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableWaltzVersionInfo.Json actualJson = new ImmutableWaltzVersionInfo.Json(); + + // Assert + assertNull(actualJson.pomVersion); + assertNull(actualJson.revision); + assertNull(actualJson.timestamp); + } + @Test + public void setPomVersionTest() { + // Arrange + ImmutableWaltzVersionInfo.Json json = new ImmutableWaltzVersionInfo.Json(); + + // Act + json.setPomVersion("pomVersion"); + + // Assert + assertEquals("pomVersion", json.pomVersion); + } + @Test + public void setRevisionTest() { + // Arrange + ImmutableWaltzVersionInfo.Json json = new ImmutableWaltzVersionInfo.Json(); + + // Act + json.setRevision("revision"); + + // Assert + assertEquals("revision", json.revision); + } + @Test + public void setTimestampTest() { + // Arrange + ImmutableWaltzVersionInfo.Json json = new ImmutableWaltzVersionInfo.Json(); + + // Act + json.setTimestamp("timestamp"); + + // Assert + assertEquals("timestamp", json.timestamp); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWebErrorDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWebErrorDiffblueTest.java new file mode 100644 index 0000000000..9eb171ef73 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/ImmutableWebErrorDiffblueTest.java @@ -0,0 +1,28 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableWebErrorDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableWebError.Json()).message); + } + + + @Test + public void setMessageTest() { + // Arrange + ImmutableWebError.Json json = new ImmutableWebError.Json(); + + // Act + json.setMessage("message"); + + // Assert + assertEquals("message", json.message); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/QuarterDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/QuarterDiffblueTest.java new file mode 100644 index 0000000000..f79dcf72a1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/QuarterDiffblueTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class QuarterDiffblueTest { + + @Test + public void fromIntTest() { + // Arrange + Quarter actualFromIntResult = Quarter.fromInt(1); + Quarter actualFromIntResult1 = Quarter.fromInt(2); + Quarter actualFromIntResult2 = Quarter.fromInt(3); + + // Act and Assert + assertEquals(Quarter.Q1, actualFromIntResult); + assertEquals(Quarter.Q2, actualFromIntResult1); + assertEquals(Quarter.Q3, actualFromIntResult2); + assertEquals(Quarter.Q4, Quarter.fromInt(4)); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessLogDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessLogDiffblueTest.java new file mode 100644 index 0000000000..5d1508e7ec --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessLogDiffblueTest.java @@ -0,0 +1,53 @@ +package com.khartec.waltz.model.accesslog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableAccessLogDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAccessLog.Json actualJson = new ImmutableAccessLog.Json(); + + // Assert + assertNull(actualJson.state); + assertNull(actualJson.createdAt); + assertNull(actualJson.params); + assertNull(actualJson.userId); + } + @Test + public void setParamsTest() { + // Arrange + ImmutableAccessLog.Json json = new ImmutableAccessLog.Json(); + + // Act + json.setParams("params"); + + // Assert + assertEquals("params", json.params); + } + @Test + public void setStateTest() { + // Arrange + ImmutableAccessLog.Json json = new ImmutableAccessLog.Json(); + + // Act + json.setState("state"); + + // Assert + assertEquals("state", json.state); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutableAccessLog.Json json = new ImmutableAccessLog.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessTimeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessTimeDiffblueTest.java new file mode 100644 index 0000000000..863b285269 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/accesslog/ImmutableAccessTimeDiffblueTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model.accesslog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableAccessTimeDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAccessTime.Json actualJson = new ImmutableAccessTime.Json(); + + // Assert + assertNull(actualJson.userId); + assertNull(actualJson.createdAt); + } + + + @Test + public void setUserIdTest() { + // Arrange + ImmutableAccessTime.Json json = new ImmutableAccessTime.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..0937612024 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorChangeCommandDiffblueTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.model.actor; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.command.EntityChangeCommand; +import com.khartec.waltz.model.command.FieldChange; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableActorChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableActorChangeCommand.Json actualJson = new ImmutableActorChangeCommand.Json(); + + // Assert + Optional> optional = actualJson.isExternal; + assertSame(actualJson.description, optional); + assertSame(optional, actualJson.lastUpdate); + assertSame(optional, actualJson.name); + assertSame(optional, actualJson.description); + } + @Test + public void setIdTest() { + // Arrange + ImmutableActorChangeCommand.Json json = new ImmutableActorChangeCommand.Json(); + + // Act + json.setId(123L); + + // Assert + assertEquals(123L, json.id); + assertTrue(json.idIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..930b0bc519 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorCreateCommandDiffblueTest.java @@ -0,0 +1,58 @@ +package com.khartec.waltz.model.actor; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableActorCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableActorCreateCommand.Json actualJson = new ImmutableActorCreateCommand.Json(); + + // Assert + assertFalse(actualJson.isExternalIsSet); + assertFalse(actualJson.isExternal); + assertNull(actualJson.name); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableActorCreateCommand.Json json = new ImmutableActorCreateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsExternalTest() { + // Arrange + ImmutableActorCreateCommand.Json json = new ImmutableActorCreateCommand.Json(); + + // Act + json.setIsExternal(true); + + // Assert + assertTrue(json.isExternalIsSet); + assertTrue(json.isExternal); + } + @Test + public void setNameTest() { + // Arrange + ImmutableActorCreateCommand.Json json = new ImmutableActorCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorDiffblueTest.java new file mode 100644 index 0000000000..1ac22b867a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/actor/ImmutableActorDiffblueTest.java @@ -0,0 +1,100 @@ +package com.khartec.waltz.model.actor; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableActorDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableActor.Json actualJson = new ImmutableActor.Json(); + + // Assert + assertNull(actualJson.lastUpdatedBy); + assertFalse(actualJson.isExternalIsSet); + assertNull(actualJson.name); + assertNull(actualJson.provenance); + assertFalse(actualJson.isExternal); + assertNull(actualJson.description); + assertNull(actualJson.kind); + assertNull(actualJson.lastUpdatedAt); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsExternalTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setIsExternal(true); + + // Assert + assertTrue(json.isExternalIsSet); + assertTrue(json.isExternal); + } + @Test + public void setKindTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableActor.Json json = new ImmutableActor.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableAllocationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableAllocationDiffblueTest.java new file mode 100644 index 0000000000..7010dd6714 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableAllocationDiffblueTest.java @@ -0,0 +1,89 @@ +package com.khartec.waltz.model.allocation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableAllocationDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAllocation.Json actualJson = new ImmutableAllocation.Json(); + + // Assert + assertNull(actualJson.lastUpdatedBy); + assertFalse(actualJson.measurableIdIsSet); + assertEquals(0L, actualJson.schemeId); + assertFalse(actualJson.schemeIdIsSet); + assertNull(actualJson.entityReference); + assertEquals(0L, actualJson.measurableId); + assertFalse(actualJson.percentageIsSet); + assertEquals(0, actualJson.percentage); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.provenance); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableAllocation.Json json = new ImmutableAllocation.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableAllocation.Json json = new ImmutableAllocation.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertTrue(json.measurableIdIsSet); + assertEquals(123L, json.measurableId); + } + @Test + public void setPercentageTest() { + // Arrange + ImmutableAllocation.Json json = new ImmutableAllocation.Json(); + + // Act + json.setPercentage(1); + + // Assert + assertTrue(json.percentageIsSet); + assertEquals(1, json.percentage); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAllocation.Json json = new ImmutableAllocation.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setSchemeIdTest() { + // Arrange + ImmutableAllocation.Json json = new ImmutableAllocation.Json(); + + // Act + json.setSchemeId(123L); + + // Assert + assertEquals(123L, json.schemeId); + assertTrue(json.schemeIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageChangeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageChangeDiffblueTest.java new file mode 100644 index 0000000000..f547e2fbb5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageChangeDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.allocation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.Operation; +import org.junit.Test; + +public class ImmutableMeasurablePercentageChangeDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurablePercentageChange.Json actualJson = new ImmutableMeasurablePercentageChange.Json(); + + // Assert + assertNull(actualJson.measurablePercentage); + assertNull(actualJson.operation); + } + + + @Test + public void setMeasurablePercentageTest() { + // Arrange + ImmutableMeasurablePercentageChange.Json json = new ImmutableMeasurablePercentageChange.Json(); + ImmutableMeasurablePercentage.Json json1 = new ImmutableMeasurablePercentage.Json(); + + // Act + json.setMeasurablePercentage(json1); + + // Assert + assertSame(json1, json.measurablePercentage); + } + + @Test + public void setOperationTest() { + // Arrange + ImmutableMeasurablePercentageChange.Json json = new ImmutableMeasurablePercentageChange.Json(); + + // Act + json.setOperation(Operation.ADD); + + // Assert + assertEquals(Operation.ADD, json.operation); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageDiffblueTest.java new file mode 100644 index 0000000000..30776aa79c --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation/ImmutableMeasurablePercentageDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.allocation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableMeasurablePercentageDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurablePercentage.Json actualJson = new ImmutableMeasurablePercentage.Json(); + + // Assert + assertEquals(0, actualJson.percentage); + assertFalse(actualJson.measurableIdIsSet); + assertFalse(actualJson.percentageIsSet); + assertEquals(0L, actualJson.measurableId); + } + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableMeasurablePercentage.Json json = new ImmutableMeasurablePercentage.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertTrue(json.measurableIdIsSet); + assertEquals(123L, json.measurableId); + } + @Test + public void setPercentageTest() { + // Arrange + ImmutableMeasurablePercentage.Json json = new ImmutableMeasurablePercentage.Json(); + + // Act + json.setPercentage(1); + + // Assert + assertEquals(1, json.percentage); + assertTrue(json.percentageIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation_scheme/ImmutableAllocationSchemeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation_scheme/ImmutableAllocationSchemeDiffblueTest.java new file mode 100644 index 0000000000..fbe8d24ff8 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/allocation_scheme/ImmutableAllocationSchemeDiffblueTest.java @@ -0,0 +1,67 @@ +package com.khartec.waltz.model.allocation_scheme; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableAllocationSchemeDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAllocationScheme.Json actualJson = new ImmutableAllocationScheme.Json(); + + // Assert + assertFalse(actualJson.measurableCategoryIdIsSet); + assertNull(actualJson.description); + assertEquals(0L, actualJson.measurableCategoryId); + assertNull(actualJson.name); + } + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAllocationScheme.Json json = new ImmutableAllocationScheme.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setMeasurableCategoryIdTest() { + // Arrange + ImmutableAllocationScheme.Json json = new ImmutableAllocationScheme.Json(); + + // Act + json.setMeasurableCategoryId(123L); + + // Assert + assertTrue(json.measurableCategoryIdIsSet); + assertEquals(123L, json.measurableCategoryId); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableAllocationScheme.Json json = new ImmutableAllocationScheme.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupBulkAddRequestDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupBulkAddRequestDiffblueTest.java new file mode 100644 index 0000000000..96004c3e45 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupBulkAddRequestDiffblueTest.java @@ -0,0 +1,161 @@ +package com.khartec.waltz.model.app_group; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.Test; + +public class ImmutableAppGroupBulkAddRequestDiffblueTest { + + @Test + public void applicationIdsTest2() { + // Arrange + ImmutableAppGroupBulkAddRequest.Json json = new ImmutableAppGroupBulkAddRequest.Json(); + + // Act + List actualApplicationIdsResult = ImmutableAppGroupBulkAddRequest.fromJson(json).applicationIds(); + + // Assert + assertSame(json.unknownIdentifiers, actualApplicationIdsResult); + assertEquals(0, actualApplicationIdsResult.size()); + } + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[]," + " unknownIdentifiers=[]}", + ImmutableAppGroupBulkAddRequest.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppGroupBulkAddRequest.Json actualJson = new ImmutableAppGroupBulkAddRequest.Json(); + + // Assert + List resultLongList = actualJson.applicationIds; + List actualStringList = actualJson.unknownIdentifiers; + assertEquals(0, resultLongList.size()); + assertSame(resultLongList, actualStringList); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableAppGroupBulkAddRequest.fromJson(new ImmutableAppGroupBulkAddRequest.Json()).equals("element")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[]," + " unknownIdentifiers=[]}", + ImmutableAppGroupBulkAddRequest.fromJson(new ImmutableAppGroupBulkAddRequest.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(5859943, + ImmutableAppGroupBulkAddRequest.fromJson(new ImmutableAppGroupBulkAddRequest.Json()).hashCode()); + } + + @Test + public void setApplicationIdsTest() { + // Arrange + ImmutableAppGroupBulkAddRequest.Json json = new ImmutableAppGroupBulkAddRequest.Json(); + ArrayList resultLongList = new ArrayList(); + resultLongList.add(1L); + + // Act + json.setApplicationIds(resultLongList); + + // Assert + assertSame(resultLongList, json.applicationIds); + } + + @Test + public void setUnknownIdentifiersTest() { + // Arrange + ImmutableAppGroupBulkAddRequest.Json json = new ImmutableAppGroupBulkAddRequest.Json(); + ArrayList stringList = new ArrayList(); + stringList.add("foo"); + + // Act + json.setUnknownIdentifiers(stringList); + + // Assert + assertSame(stringList, json.unknownIdentifiers); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[]," + " unknownIdentifiers=[]}", + ImmutableAppGroupBulkAddRequest.fromJson(new ImmutableAppGroupBulkAddRequest.Json()).toString()); + } + + @Test + public void unknownIdentifiersTest2() { + // Arrange + ImmutableAppGroupBulkAddRequest.Json json = new ImmutableAppGroupBulkAddRequest.Json(); + + // Act + List actualUnknownIdentifiersResult = ImmutableAppGroupBulkAddRequest.fromJson(json).unknownIdentifiers(); + + // Assert + assertSame(json.unknownIdentifiers, actualUnknownIdentifiersResult); + assertEquals(0, actualUnknownIdentifiersResult.size()); + } + + @Test + public void withApplicationIdsTest() { + // Arrange + ImmutableAppGroupBulkAddRequest fromJsonResult = ImmutableAppGroupBulkAddRequest + .fromJson(new ImmutableAppGroupBulkAddRequest.Json()); + ArrayList resultLongList = new ArrayList(); + resultLongList.add(1L); + + // Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[1]," + " unknownIdentifiers=[]}", + fromJsonResult.withApplicationIds(resultLongList).toString()); + } + + @Test + public void withApplicationIdsTest2() { + // Arrange + ImmutableAppGroupBulkAddRequest fromJsonResult = ImmutableAppGroupBulkAddRequest + .fromJson(new ImmutableAppGroupBulkAddRequest.Json()); + long[] longArray = new long[8]; + Arrays.fill(longArray, 1L); + + // Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[1, 1, 1, 1," + " 1, 1, 1, 1], unknownIdentifiers=[]}", + fromJsonResult.withApplicationIds(longArray).toString()); + } + + @Test + public void withUnknownIdentifiersTest() { + // Arrange + ImmutableAppGroupBulkAddRequest fromJsonResult = ImmutableAppGroupBulkAddRequest + .fromJson(new ImmutableAppGroupBulkAddRequest.Json()); + ArrayList stringList = new ArrayList(); + stringList.add("foo"); + + // Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[]," + " unknownIdentifiers=[foo]}", + fromJsonResult.withUnknownIdentifiers(stringList).toString()); + } + + @Test + public void withUnknownIdentifiersTest2() { + // Arrange, Act and Assert + assertEquals("AppGroupBulkAddRequest{applicationIds=[]," + " unknownIdentifiers=[foo, foo, foo]}", + ImmutableAppGroupBulkAddRequest.fromJson(new ImmutableAppGroupBulkAddRequest.Json()) + .withUnknownIdentifiers("foo", "foo", "foo").toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDetailDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDetailDiffblueTest.java new file mode 100644 index 0000000000..e590f29238 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDetailDiffblueTest.java @@ -0,0 +1,76 @@ +package com.khartec.waltz.model.app_group; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityReference; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableAppGroupDetailDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppGroupDetail.Json actualJson = new ImmutableAppGroupDetail.Json(); + + // Assert + List actualAppGroupMemberList = actualJson.members; + List actualEntityReferenceList = actualJson.applications; + List entityReferenceList = actualJson.organisationalUnits; + assertEquals(0, entityReferenceList.size()); + assertSame(entityReferenceList, actualEntityReferenceList); + assertSame(entityReferenceList, actualAppGroupMemberList); + } + @Test + public void setAppGroupTest() { + // Arrange + ImmutableAppGroupDetail.Json json = new ImmutableAppGroupDetail.Json(); + ImmutableAppGroup.Json json1 = new ImmutableAppGroup.Json(); + + // Act + json.setAppGroup(json1); + + // Assert + assertSame(json1, json.appGroup); + } + @Test + public void setApplicationsTest() { + // Arrange + ImmutableAppGroupDetail.Json json = new ImmutableAppGroupDetail.Json(); + ArrayList entityReferenceList = new ArrayList(); + entityReferenceList.add(null); + + // Act + json.setApplications(entityReferenceList); + + // Assert + assertSame(entityReferenceList, json.applications); + } + @Test + public void setMembersTest() { + // Arrange + ImmutableAppGroupDetail.Json json = new ImmutableAppGroupDetail.Json(); + ArrayList appGroupMemberList = new ArrayList(); + appGroupMemberList.add(new ImmutableAppGroupMember.Json()); + + // Act + json.setMembers(appGroupMemberList); + + // Assert + assertSame(appGroupMemberList, json.members); + } + @Test + public void setOrganisationalUnitsTest() { + // Arrange + ImmutableAppGroupDetail.Json json = new ImmutableAppGroupDetail.Json(); + ArrayList entityReferenceList = new ArrayList(); + entityReferenceList.add(null); + + // Act + json.setOrganisationalUnits(entityReferenceList); + + // Assert + assertSame(entityReferenceList, json.organisationalUnits); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDiffblueTest.java new file mode 100644 index 0000000000..5eaeac0321 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupDiffblueTest.java @@ -0,0 +1,81 @@ +package com.khartec.waltz.model.app_group; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.IsRemovedProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableAppGroupDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppGroup.Json actualJson = new ImmutableAppGroup.Json(); + + // Assert + assertSame(actualJson.externalId, actualJson.id); + } + @Test + public void setAppGroupKindTest() { + // Arrange + ImmutableAppGroup.Json json = new ImmutableAppGroup.Json(); + + // Act + json.setAppGroupKind(AppGroupKind.PUBLIC); + + // Assert + assertEquals(AppGroupKind.PUBLIC, json.appGroupKind); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAppGroup.Json json = new ImmutableAppGroup.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutableAppGroup.Json json = new ImmutableAppGroup.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemoved); + assertTrue(json.isRemovedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableAppGroup.Json json = new ImmutableAppGroup.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAppGroup.Json json = new ImmutableAppGroup.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupMemberDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupMemberDiffblueTest.java new file mode 100644 index 0000000000..1bb748ed4f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/app_group/ImmutableAppGroupMemberDiffblueTest.java @@ -0,0 +1,56 @@ +package com.khartec.waltz.model.app_group; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableAppGroupMemberDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppGroupMember.Json actualJson = new ImmutableAppGroupMember.Json(); + + // Assert + assertNull(actualJson.userId); + assertFalse(actualJson.groupIdIsSet); + assertEquals(0L, actualJson.groupId); + assertNull(actualJson.role); + } + @Test + public void setGroupIdTest() { + // Arrange + ImmutableAppGroupMember.Json json = new ImmutableAppGroupMember.Json(); + + // Act + json.setGroupId(123L); + + // Assert + assertTrue(json.groupIdIsSet); + assertEquals(123L, json.groupId); + } + @Test + public void setRoleTest() { + // Arrange + ImmutableAppGroupMember.Json json = new ImmutableAppGroupMember.Json(); + + // Act + json.setRole(AppGroupMemberRole.VIEWER); + + // Assert + assertEquals(AppGroupMemberRole.VIEWER, json.role); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutableAppGroupMember.Json json = new ImmutableAppGroupMember.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationRequestDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationRequestDiffblueTest.java new file mode 100644 index 0000000000..5c307ea56d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationRequestDiffblueTest.java @@ -0,0 +1,123 @@ +package com.khartec.waltz.model.application; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.rating.RagRating; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; +import org.junit.Test; + +public class ImmutableAppRegistrationRequestDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppRegistrationRequest.Json actualJson = new ImmutableAppRegistrationRequest.Json(); + + // Assert + Set actualStringSet = actualJson.tags; + Optional optional = actualJson.provenance; + assertSame(optional, actualJson.description); + assertSame(optional, actualJson.assetCode); + assertSame(optional, actualJson.parentAssetCode); + Set stringSet = actualJson.aliases; + assertEquals(0, stringSet.size()); + assertSame(stringSet, actualStringSet); + } + @Test + public void setAliasesTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + HashSet stringSet = new HashSet(); + stringSet.add("foo"); + + // Act + json.setAliases(stringSet); + + // Assert + assertSame(stringSet, json.aliases); + } + @Test + public void setApplicationKindTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setApplicationKind(ApplicationKind.IN_HOUSE); + + // Assert + assertEquals(ApplicationKind.IN_HOUSE, json.applicationKind); + } + @Test + public void setBusinessCriticalityTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setBusinessCriticality(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.businessCriticality); + } + @Test + public void setLifecyclePhaseTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setLifecyclePhase(LifecyclePhase.PRODUCTION); + + // Assert + assertEquals(LifecyclePhase.PRODUCTION, json.lifecyclePhase); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOrganisationalUnitIdTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setOrganisationalUnitId(123L); + + // Assert + assertTrue(json.organisationalUnitIdIsSet); + assertEquals(123L, json.organisationalUnitId); + } + @Test + public void setOverallRatingTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setOverallRating(RagRating.R); + + // Assert + assertEquals(RagRating.R, json.overallRating); + } + @Test + public void setTagsTest() { + // Arrange + ImmutableAppRegistrationRequest.Json json = new ImmutableAppRegistrationRequest.Json(); + HashSet stringSet = new HashSet(); + stringSet.add("foo"); + + // Act + json.setTags(stringSet); + + // Assert + assertSame(stringSet, json.tags); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationResponseDiffblueTest.java new file mode 100644 index 0000000000..340dc51b14 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableAppRegistrationResponseDiffblueTest.java @@ -0,0 +1,28 @@ +package com.khartec.waltz.model.application; + +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableAppRegistrationResponseDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAppRegistrationResponse.Json actualJson = new ImmutableAppRegistrationResponse.Json(); + + // Assert + assertSame(actualJson.message, actualJson.id); + } + @Test + public void setOriginalRequestTest() { + // Arrange + ImmutableAppRegistrationResponse.Json json = new ImmutableAppRegistrationResponse.Json(); + ImmutableAppRegistrationRequest.Json json1 = new ImmutableAppRegistrationRequest.Json(); + + // Act + json.setOriginalRequest(json1); + + // Assert + assertSame(json1, json.originalRequest); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationDiffblueTest.java new file mode 100644 index 0000000000..82075978b0 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationDiffblueTest.java @@ -0,0 +1,158 @@ +package com.khartec.waltz.model.application; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.IsRemovedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.OrganisationalUnitIdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.rating.RagRating; +import java.time.LocalDateTime; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableApplicationDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableApplication.Json actualJson = new ImmutableApplication.Json(); + + // Assert + Optional optional = actualJson.plannedRetirementDate; + assertSame(optional, actualJson.parentAssetCode); + assertSame(optional, actualJson.assetCode); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.actualRetirementDate); + } + @Test + public void setApplicationKindTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setApplicationKind(ApplicationKind.IN_HOUSE); + + // Assert + assertEquals(ApplicationKind.IN_HOUSE, json.applicationKind); + } + @Test + public void setBusinessCriticalityTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setBusinessCriticality(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.businessCriticality); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemoved); + assertTrue(json.isRemovedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLifecyclePhaseTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setLifecyclePhase(LifecyclePhase.PRODUCTION); + + // Assert + assertEquals(LifecyclePhase.PRODUCTION, json.lifecyclePhase); + } + @Test + public void setNameTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOrganisationalUnitIdTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setOrganisationalUnitId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.organisationalUnitId); + } + @Test + public void setOverallRatingTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setOverallRating(RagRating.R); + + // Assert + assertEquals(RagRating.R, json.overallRating); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableApplication.Json json = new ImmutableApplication.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationIdSelectionOptionsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationIdSelectionOptionsDiffblueTest.java new file mode 100644 index 0000000000..2389a73558 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/application/ImmutableApplicationIdSelectionOptionsDiffblueTest.java @@ -0,0 +1,65 @@ +package com.khartec.waltz.model.application; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.HierarchyQueryScope; +import com.khartec.waltz.model.IdSelectionOptions; +import java.util.HashSet; +import java.util.Set; +import org.junit.Test; + +public class ImmutableApplicationIdSelectionOptionsDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableApplicationIdSelectionOptions.Json actualJson = new ImmutableApplicationIdSelectionOptions.Json(); + + // Assert + Set actualApplicationKindSet = actualJson.applicationKinds; + Set entityLifecycleStatusSet = actualJson.entityLifecycleStatuses; + assertEquals(0, entityLifecycleStatusSet.size()); + assertSame(entityLifecycleStatusSet, actualApplicationKindSet); + } + @Test + public void setApplicationKindsTest() { + // Arrange + ImmutableApplicationIdSelectionOptions.Json json = new ImmutableApplicationIdSelectionOptions.Json(); + HashSet applicationKindSet = new HashSet(); + applicationKindSet.add(ApplicationKind.IN_HOUSE); + + // Act + json.setApplicationKinds(applicationKindSet); + + // Assert + assertTrue(json.applicationKindsIsSet); + assertSame(applicationKindSet, json.applicationKinds); + } + @Test + public void setEntityLifecycleStatusesTest() { + // Arrange + ImmutableApplicationIdSelectionOptions.Json json = new ImmutableApplicationIdSelectionOptions.Json(); + HashSet entityLifecycleStatusSet = new HashSet(); + entityLifecycleStatusSet.add(EntityLifecycleStatus.ACTIVE); + + // Act + json.setEntityLifecycleStatuses(entityLifecycleStatusSet); + + // Assert + assertTrue(json.entityLifecycleStatusesIsSet); + assertSame(entityLifecycleStatusSet, json.entityLifecycleStatuses); + } + @Test + public void setScopeTest() { + // Arrange + ImmutableApplicationIdSelectionOptions.Json json = new ImmutableApplicationIdSelectionOptions.Json(); + + // Act + json.setScope(HierarchyQueryScope.EXACT); + + // Assert + assertEquals(HierarchyQueryScope.EXACT, json.scope); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_definition/ImmutableAssessmentDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_definition/ImmutableAssessmentDefinitionDiffblueTest.java new file mode 100644 index 0000000000..a1adc6568a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_definition/ImmutableAssessmentDefinitionDiffblueTest.java @@ -0,0 +1,119 @@ +package com.khartec.waltz.model.assessment_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableAssessmentDefinitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAssessmentDefinition.Json actualJson = new ImmutableAssessmentDefinition.Json(); + + // Assert + Optional optional = actualJson.externalId; + assertSame(actualJson.permittedRole, optional); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.permittedRole); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityKindTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.entityKind); + } + @Test + public void setIsReadOnlyTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setIsReadOnly(true); + + // Assert + assertTrue(json.isReadOnlyIsSet); + assertTrue(json.isReadOnly); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRatingSchemeIdTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setRatingSchemeId(123L); + + // Assert + assertTrue(json.ratingSchemeIdIsSet); + assertEquals(123L, json.ratingSchemeId); + } + @Test + public void setVisibilityTest() { + // Arrange + ImmutableAssessmentDefinition.Json json = new ImmutableAssessmentDefinition.Json(); + + // Act + json.setVisibility(AssessmentVisibility.PRIMARY); + + // Assert + assertEquals(AssessmentVisibility.PRIMARY, json.visibility); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDetailDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDetailDiffblueTest.java new file mode 100644 index 0000000000..9d166c0216 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDetailDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.assessment_rating; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableAssessmentRatingDetailDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAssessmentRatingDetail.Json actualJson = new ImmutableAssessmentRatingDetail.Json(); + + // Assert + assertNull(actualJson.assessmentRating); + assertNull(actualJson.ratingDefinition); + } + @Test + public void setAssessmentRatingTest() { + // Arrange + ImmutableAssessmentRatingDetail.Json json = new ImmutableAssessmentRatingDetail.Json(); + ImmutableAssessmentRating.Json json1 = new ImmutableAssessmentRating.Json(); + + // Act + json.setAssessmentRating(json1); + + // Assert + assertSame(json1, json.assessmentRating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDiffblueTest.java new file mode 100644 index 0000000000..95287433ad --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableAssessmentRatingDiffblueTest.java @@ -0,0 +1,87 @@ +package com.khartec.waltz.model.assessment_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CommentProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableAssessmentRatingDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAssessmentRating.Json actualJson = new ImmutableAssessmentRating.Json(); + + // Assert + assertEquals(0L, actualJson.ratingId); + assertEquals(0L, actualJson.assessmentDefinitionId); + assertNull(actualJson.comment); + assertFalse(actualJson.ratingIdIsSet); + assertFalse(actualJson.assessmentDefinitionIdIsSet); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityReference); + } + @Test + public void setAssessmentDefinitionIdTest() { + // Arrange + ImmutableAssessmentRating.Json json = new ImmutableAssessmentRating.Json(); + + // Act + json.setAssessmentDefinitionId(123L); + + // Assert + assertEquals(123L, json.assessmentDefinitionId); + assertTrue(json.assessmentDefinitionIdIsSet); + } + @Test + public void setCommentTest() { + // Arrange + ImmutableAssessmentRating.Json json = new ImmutableAssessmentRating.Json(); + + // Act + json.setComment("comment"); + + // Assert + assertEquals("comment", json.comment); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableAssessmentRating.Json json = new ImmutableAssessmentRating.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAssessmentRating.Json json = new ImmutableAssessmentRating.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRatingIdTest() { + // Arrange + ImmutableAssessmentRating.Json json = new ImmutableAssessmentRating.Json(); + + // Act + json.setRatingId(123L); + + // Assert + assertEquals(123L, json.ratingId); + assertTrue(json.ratingIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableRemoveAssessmentRatingCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableRemoveAssessmentRatingCommandDiffblueTest.java new file mode 100644 index 0000000000..f698a2cccc --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableRemoveAssessmentRatingCommandDiffblueTest.java @@ -0,0 +1,46 @@ +package com.khartec.waltz.model.assessment_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableRemoveAssessmentRatingCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRemoveAssessmentRatingCommand.Json actualJson = new ImmutableRemoveAssessmentRatingCommand.Json(); + + // Assert + assertEquals(0L, actualJson.assessmentDefinitionId); + assertFalse(actualJson.assessmentDefinitionIdIsSet); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.entityReference); + assertNull(actualJson.lastUpdatedAt); + } + @Test + public void setAssessmentDefinitionIdTest() { + // Arrange + ImmutableRemoveAssessmentRatingCommand.Json json = new ImmutableRemoveAssessmentRatingCommand.Json(); + + // Act + json.setAssessmentDefinitionId(123L); + + // Assert + assertEquals(123L, json.assessmentDefinitionId); + assertTrue(json.assessmentDefinitionIdIsSet); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableRemoveAssessmentRatingCommand.Json json = new ImmutableRemoveAssessmentRatingCommand.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableSaveAssessmentRatingCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableSaveAssessmentRatingCommandDiffblueTest.java new file mode 100644 index 0000000000..60adb88f38 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/assessment_rating/ImmutableSaveAssessmentRatingCommandDiffblueTest.java @@ -0,0 +1,87 @@ +package com.khartec.waltz.model.assessment_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CommentProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableSaveAssessmentRatingCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSaveAssessmentRatingCommand.Json actualJson = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Assert + assertFalse(actualJson.ratingIdIsSet); + assertNull(actualJson.provenance); + assertFalse(actualJson.assessmentDefinitionIdIsSet); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.entityReference); + assertEquals(0L, actualJson.ratingId); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.comment); + assertEquals(0L, actualJson.assessmentDefinitionId); + } + @Test + public void setAssessmentDefinitionIdTest() { + // Arrange + ImmutableSaveAssessmentRatingCommand.Json json = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Act + json.setAssessmentDefinitionId(123L); + + // Assert + assertTrue(json.assessmentDefinitionIdIsSet); + assertEquals(123L, json.assessmentDefinitionId); + } + @Test + public void setCommentTest() { + // Arrange + ImmutableSaveAssessmentRatingCommand.Json json = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Act + json.setComment("comment"); + + // Assert + assertEquals("comment", json.comment); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableSaveAssessmentRatingCommand.Json json = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSaveAssessmentRatingCommand.Json json = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRatingIdTest() { + // Arrange + ImmutableSaveAssessmentRatingCommand.Json json = new ImmutableSaveAssessmentRatingCommand.Json(); + + // Act + json.setRatingId(123L); + + // Assert + assertTrue(json.ratingIdIsSet); + assertEquals(123L, json.ratingId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestEntityCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestEntityCommandDiffblueTest.java new file mode 100644 index 0000000000..9ff448fe3f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestEntityCommandDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.EntityKind; +import org.junit.Test; + +public class ImmutableAttestEntityCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestEntityCommand.Json actualJson = new ImmutableAttestEntityCommand.Json(); + + // Assert + assertNull(actualJson.attestedEntityKind); + assertNull(actualJson.entityReference); + } + @Test + public void setAttestedEntityKindTest() { + // Arrange + ImmutableAttestEntityCommand.Json json = new ImmutableAttestEntityCommand.Json(); + + // Act + json.setAttestedEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.attestedEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationCreateSummaryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationCreateSummaryDiffblueTest.java new file mode 100644 index 0000000000..16ffdd844d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationCreateSummaryDiffblueTest.java @@ -0,0 +1,59 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableAttestationCreateSummaryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestationCreateSummary.Json actualJson = new ImmutableAttestationCreateSummary.Json(); + + // Assert + assertFalse(actualJson.instanceCountIsSet); + assertEquals(0L, actualJson.recipientCount); + assertEquals(0, actualJson.entityCount); + assertEquals(0, actualJson.instanceCount); + assertFalse(actualJson.recipientCountIsSet); + assertFalse(actualJson.entityCountIsSet); + } + @Test + public void setEntityCountTest() { + // Arrange + ImmutableAttestationCreateSummary.Json json = new ImmutableAttestationCreateSummary.Json(); + + // Act + json.setEntityCount(3); + + // Assert + assertEquals(3, json.entityCount); + assertTrue(json.entityCountIsSet); + } + @Test + public void setInstanceCountTest() { + // Arrange + ImmutableAttestationCreateSummary.Json json = new ImmutableAttestationCreateSummary.Json(); + + // Act + json.setInstanceCount(3); + + // Assert + assertTrue(json.instanceCountIsSet); + assertEquals(3, json.instanceCount); + } + @Test + public void setRecipientCountTest() { + // Arrange + ImmutableAttestationCreateSummary.Json json = new ImmutableAttestationCreateSummary.Json(); + + // Act + json.setRecipientCount(3L); + + // Assert + assertEquals(3L, json.recipientCount); + assertTrue(json.recipientCountIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceDiffblueTest.java new file mode 100644 index 0000000000..a77f70cf54 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceDiffblueTest.java @@ -0,0 +1,49 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.IdProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableAttestationInstanceDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestationInstance.Json actualJson = new ImmutableAttestationInstance.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(optional, actualJson.attestedBy); + assertSame(optional, actualJson.attestedAt); + } + + + + @Test + public void setAttestationRunIdTest() { + // Arrange + ImmutableAttestationInstance.Json json = new ImmutableAttestationInstance.Json(); + + // Act + json.setAttestationRunId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.attestationRunId); + } + + @Test + public void setAttestedEntityKindTest() { + // Arrange + ImmutableAttestationInstance.Json json = new ImmutableAttestationInstance.Json(); + + // Act + json.setAttestedEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.attestedEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceRecipientDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceRecipientDiffblueTest.java new file mode 100644 index 0000000000..db730d6d94 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationInstanceRecipientDiffblueTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableAttestationInstanceRecipientDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestationInstanceRecipient.Json actualJson = new ImmutableAttestationInstanceRecipient.Json(); + + // Assert + assertNull(actualJson.attestationInstance); + assertNull(actualJson.userId); + } + @Test + public void setAttestationInstanceTest() { + // Arrange + ImmutableAttestationInstanceRecipient.Json json = new ImmutableAttestationInstanceRecipient.Json(); + ImmutableAttestationInstance.Json json1 = new ImmutableAttestationInstance.Json(); + + // Act + json.setAttestationInstance(json1); + + // Assert + assertSame(json1, json.attestationInstance); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutableAttestationInstanceRecipient.Json json = new ImmutableAttestationInstanceRecipient.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..5fcd124c4f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunCreateCommandDiffblueTest.java @@ -0,0 +1,75 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.NameProvider; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableAttestationRunCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableAttestationRunCreateCommand.Json()).involvementKindIds.size()); + } + @Test + public void setAttestedEntityKindTest() { + // Arrange + ImmutableAttestationRunCreateCommand.Json json = new ImmutableAttestationRunCreateCommand.Json(); + + // Act + json.setAttestedEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.attestedEntityKind); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAttestationRunCreateCommand.Json json = new ImmutableAttestationRunCreateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setInvolvementKindIdsTest() { + // Arrange + ImmutableAttestationRunCreateCommand.Json json = new ImmutableAttestationRunCreateCommand.Json(); + HashSet resultLongSet = new HashSet(); + resultLongSet.add(1L); + + // Act + json.setInvolvementKindIds(resultLongSet); + + // Assert + assertSame(resultLongSet, json.involvementKindIds); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAttestationRunCreateCommand.Json json = new ImmutableAttestationRunCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setTargetEntityKindTest() { + // Arrange + ImmutableAttestationRunCreateCommand.Json json = new ImmutableAttestationRunCreateCommand.Json(); + + // Act + json.setTargetEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.targetEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunDiffblueTest.java new file mode 100644 index 0000000000..ecb70a7336 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunDiffblueTest.java @@ -0,0 +1,91 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.WaltzEntity; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableAttestationRunDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestationRun.Json actualJson = new ImmutableAttestationRun.Json(); + + // Assert + assertSame(actualJson.id, actualJson.attestedEntityRef); + assertEquals(0, actualJson.involvementKindIds.size()); + } + @Test + public void setAttestedEntityKindTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + + // Act + json.setAttestedEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.attestedEntityKind); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setInvolvementKindIdsTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + HashSet resultLongSet = new HashSet(); + resultLongSet.add(1L); + + // Act + json.setInvolvementKindIds(resultLongSet); + + // Assert + assertSame(resultLongSet, json.involvementKindIds); + } + @Test + public void setIssuedByTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + + // Act + json.setIssuedBy("issuedBy"); + + // Assert + assertEquals("issuedBy", json.issuedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setTargetEntityKindTest() { + // Arrange + ImmutableAttestationRun.Json json = new ImmutableAttestationRun.Json(); + + // Act + json.setTargetEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.targetEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunResponseSummaryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunResponseSummaryDiffblueTest.java new file mode 100644 index 0000000000..5ad4dc4afe --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attestation/ImmutableAttestationRunResponseSummaryDiffblueTest.java @@ -0,0 +1,59 @@ +package com.khartec.waltz.model.attestation; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableAttestationRunResponseSummaryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttestationRunResponseSummary.Json actualJson = new ImmutableAttestationRunResponseSummary.Json(); + + // Assert + assertFalse(actualJson.pendingCountIsSet); + assertEquals(0L, actualJson.runId); + assertFalse(actualJson.completeCountIsSet); + assertEquals(0L, actualJson.completeCount); + assertFalse(actualJson.runIdIsSet); + assertEquals(0L, actualJson.pendingCount); + } + @Test + public void setCompleteCountTest() { + // Arrange + ImmutableAttestationRunResponseSummary.Json json = new ImmutableAttestationRunResponseSummary.Json(); + + // Act + json.setCompleteCount(3L); + + // Assert + assertTrue(json.completeCountIsSet); + assertEquals(3L, json.completeCount); + } + @Test + public void setPendingCountTest() { + // Arrange + ImmutableAttestationRunResponseSummary.Json json = new ImmutableAttestationRunResponseSummary.Json(); + + // Act + json.setPendingCount(3L); + + // Assert + assertTrue(json.pendingCountIsSet); + assertEquals(3L, json.pendingCount); + } + @Test + public void setRunIdTest() { + // Arrange + ImmutableAttestationRunResponseSummary.Json json = new ImmutableAttestationRunResponseSummary.Json(); + + // Act + json.setRunId(123L); + + // Assert + assertEquals(123L, json.runId); + assertTrue(json.runIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/attribute_change/ImmutableAttributeChangeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/attribute_change/ImmutableAttributeChangeDiffblueTest.java new file mode 100644 index 0000000000..acc42aa6c8 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/attribute_change/ImmutableAttributeChangeDiffblueTest.java @@ -0,0 +1,109 @@ +package com.khartec.waltz.model.attribute_change; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableAttributeChangeDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAttributeChange.Json actualJson = new ImmutableAttributeChange.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.oldValue); + assertEquals(0L, actualJson.changeUnitId); + assertNull(actualJson.newValue); + assertFalse(actualJson.changeUnitIdIsSet); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertNull(actualJson.type); + assertNull(actualJson.name); + } + @Test + public void setChangeUnitIdTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setChangeUnitId(123L); + + // Assert + assertEquals(123L, json.changeUnitId); + assertTrue(json.changeUnitIdIsSet); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setNewValueTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setNewValue("newValue"); + + // Assert + assertEquals("newValue", json.newValue); + } + @Test + public void setOldValueTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setOldValue("oldValue"); + + // Assert + assertEquals("oldValue", json.oldValue); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setTypeTest() { + // Arrange + ImmutableAttributeChange.Json json = new ImmutableAttributeChange.Json(); + + // Act + json.setType("type"); + + // Assert + assertEquals("type", json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeRatingVantagePointDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeRatingVantagePointDiffblueTest.java new file mode 100644 index 0000000000..95ea0575e0 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeRatingVantagePointDiffblueTest.java @@ -0,0 +1,84 @@ +package com.khartec.waltz.model.authoritativesource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableAuthoritativeRatingVantagePointDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAuthoritativeRatingVantagePoint.Json actualJson = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Assert + assertNull(actualJson.applicationId); + assertNull(actualJson.vantagePoint); + assertFalse(actualJson.dataTypeRankIsSet); + assertEquals(0, actualJson.vantagePointRank); + assertNull(actualJson.dataTypeCode); + assertEquals(0, actualJson.dataTypeRank); + assertNull(actualJson.rating); + assertFalse(actualJson.vantagePointRankIsSet); + } + @Test + public void setApplicationIdTest() { + // Arrange + ImmutableAuthoritativeRatingVantagePoint.Json json = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Act + json.setApplicationId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.applicationId); + } + @Test + public void setDataTypeCodeTest() { + // Arrange + ImmutableAuthoritativeRatingVantagePoint.Json json = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Act + json.setDataTypeCode("dataTypeCode"); + + // Assert + assertEquals("dataTypeCode", json.dataTypeCode); + } + @Test + public void setDataTypeRankTest() { + // Arrange + ImmutableAuthoritativeRatingVantagePoint.Json json = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Act + json.setDataTypeRank(1); + + // Assert + assertTrue(json.dataTypeRankIsSet); + assertEquals(1, json.dataTypeRank); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableAuthoritativeRatingVantagePoint.Json json = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } + @Test + public void setVantagePointRankTest() { + // Arrange + ImmutableAuthoritativeRatingVantagePoint.Json json = new ImmutableAuthoritativeRatingVantagePoint.Json(); + + // Act + json.setVantagePointRank(1); + + // Assert + assertEquals(1, json.vantagePointRank); + assertTrue(json.vantagePointRankIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..00b9bac290 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceCreateCommandDiffblueTest.java @@ -0,0 +1,85 @@ +package com.khartec.waltz.model.authoritativesource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableAuthoritativeSourceCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAuthoritativeSourceCreateCommand.Json actualJson = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Assert + assertNull(actualJson.description); + assertFalse(actualJson.dataTypeIdIsSet); + assertFalse(actualJson.orgUnitIdIsSet); + assertEquals(0L, actualJson.orgUnitId); + assertEquals(0L, actualJson.applicationId); + assertFalse(actualJson.applicationIdIsSet); + assertEquals(0L, actualJson.dataTypeId); + assertNull(actualJson.rating); + } + @Test + public void setApplicationIdTest() { + // Arrange + ImmutableAuthoritativeSourceCreateCommand.Json json = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Act + json.setApplicationId(123L); + + // Assert + assertEquals(123L, json.applicationId); + assertTrue(json.applicationIdIsSet); + } + @Test + public void setDataTypeIdTest() { + // Arrange + ImmutableAuthoritativeSourceCreateCommand.Json json = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Act + json.setDataTypeId(123L); + + // Assert + assertTrue(json.dataTypeIdIsSet); + assertEquals(123L, json.dataTypeId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAuthoritativeSourceCreateCommand.Json json = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setOrgUnitIdTest() { + // Arrange + ImmutableAuthoritativeSourceCreateCommand.Json json = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Act + json.setOrgUnitId(123L); + + // Assert + assertTrue(json.orgUnitIdIsSet); + assertEquals(123L, json.orgUnitId); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableAuthoritativeSourceCreateCommand.Json json = new ImmutableAuthoritativeSourceCreateCommand.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceDiffblueTest.java new file mode 100644 index 0000000000..c0a12fef0b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceDiffblueTest.java @@ -0,0 +1,71 @@ +package com.khartec.waltz.model.authoritativesource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableAuthoritativeSourceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAuthoritativeSource.Json actualJson = new ImmutableAuthoritativeSource.Json(); + + // Assert + assertNull(actualJson.appOrgUnitReference); + assertNull(actualJson.applicationReference); + assertNull(actualJson.dataType); + assertNull(actualJson.provenance); + assertNull(actualJson.description); + assertNull(actualJson.rating); + assertNull(actualJson.parentReference); + } + @Test + public void setDataTypeTest() { + // Arrange + ImmutableAuthoritativeSource.Json json = new ImmutableAuthoritativeSource.Json(); + + // Act + json.setDataType("dataType"); + + // Assert + assertEquals("dataType", json.dataType); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAuthoritativeSource.Json json = new ImmutableAuthoritativeSource.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAuthoritativeSource.Json json = new ImmutableAuthoritativeSource.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableAuthoritativeSource.Json json = new ImmutableAuthoritativeSource.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceUpdateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceUpdateCommandDiffblueTest.java new file mode 100644 index 0000000000..58150afb1d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableAuthoritativeSourceUpdateCommandDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.model.authoritativesource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableAuthoritativeSourceUpdateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAuthoritativeSourceUpdateCommand.Json actualJson = new ImmutableAuthoritativeSourceUpdateCommand.Json(); + + // Assert + assertNull(actualJson.description); + assertNull(actualJson.rating); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableAuthoritativeSourceUpdateCommand.Json json = new ImmutableAuthoritativeSourceUpdateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableAuthoritativeSourceUpdateCommand.Json json = new ImmutableAuthoritativeSourceUpdateCommand.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableNonAuthoritativeSourceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableNonAuthoritativeSourceDiffblueTest.java new file mode 100644 index 0000000000..4659e11519 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/authoritativesource/ImmutableNonAuthoritativeSourceDiffblueTest.java @@ -0,0 +1,51 @@ +package com.khartec.waltz.model.authoritativesource; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableNonAuthoritativeSourceDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableNonAuthoritativeSource.Json actualJson = new ImmutableNonAuthoritativeSource.Json(); + + // Assert + assertNull(actualJson.sourceReference); + assertEquals(0, actualJson.count); + assertEquals(0L, actualJson.dataTypeId); + assertFalse(actualJson.countIsSet); + assertFalse(actualJson.dataTypeIdIsSet); + } + + + @Test + public void setCountTest() { + // Arrange + ImmutableNonAuthoritativeSource.Json json = new ImmutableNonAuthoritativeSource.Json(); + + // Act + json.setCount(3); + + // Assert + assertEquals(3, json.count); + assertTrue(json.countIsSet); + } + + @Test + public void setDataTypeIdTest() { + // Arrange + ImmutableNonAuthoritativeSource.Json json = new ImmutableNonAuthoritativeSource.Json(); + + // Act + json.setDataTypeId(123L); + + // Assert + assertEquals(123L, json.dataTypeId); + assertTrue(json.dataTypeIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/bookmark/ImmutableBookmarkDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/bookmark/ImmutableBookmarkDiffblueTest.java new file mode 100644 index 0000000000..d5b1d60626 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/bookmark/ImmutableBookmarkDiffblueTest.java @@ -0,0 +1,108 @@ +package com.khartec.waltz.model.bookmark; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableBookmarkDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableBookmark.Json actualJson = new ImmutableBookmark.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(actualJson.url, optional); + assertSame(optional, actualJson.url); + assertSame(optional, actualJson.description); + assertSame(optional, actualJson.title); + } + @Test + public void setBookmarkKindTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setBookmarkKind("bookmarkKind"); + + // Assert + assertEquals("bookmarkKind", json.bookmarkKind); + } + @Test + public void setIsPrimaryTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setIsPrimary(true); + + // Assert + assertTrue(json.isPrimary); + assertTrue(json.isPrimaryIsSet); + } + @Test + public void setIsRequiredTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setIsRequired(true); + + // Assert + assertTrue(json.isRequired); + assertTrue(json.isRequiredIsSet); + } + @Test + public void setIsRestrictedTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setIsRestricted(true); + + // Assert + assertTrue(json.isRestricted); + assertTrue(json.isRestrictedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableBookmark.Json json = new ImmutableBookmark.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/change_initiative/ImmutableChangeInitiativeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_initiative/ImmutableChangeInitiativeDiffblueTest.java new file mode 100644 index 0000000000..959c31b261 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_initiative/ImmutableChangeInitiativeDiffblueTest.java @@ -0,0 +1,133 @@ +package com.khartec.waltz.model.change_initiative; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.OrganisationalUnitIdProvider; +import com.khartec.waltz.model.ParentIdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.application.LifecyclePhase; +import java.util.Date; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableChangeInitiativeDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableChangeInitiative.Json actualJson = new ImmutableChangeInitiative.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(optional, actualJson.parentId); + assertSame(optional, actualJson.lastUpdate); + assertSame(optional, actualJson.externalId); + } + @Test + public void setChangeInitiativeKindTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setChangeInitiativeKind(ChangeInitiativeKind.INITIATIVE); + + // Assert + assertEquals(ChangeInitiativeKind.INITIATIVE, json.changeInitiativeKind); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEndDateTest() { + // Arrange + Date date = new Date(1L); + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setEndDate(date); + + // Assert + assertSame(date, json.endDate); + } + @Test + public void setKindTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLifecyclePhaseTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setLifecyclePhase(LifecyclePhase.PRODUCTION); + + // Assert + assertEquals(LifecyclePhase.PRODUCTION, json.lifecyclePhase); + } + @Test + public void setNameTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOrganisationalUnitIdTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setOrganisationalUnitId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.organisationalUnitId); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setStartDateTest() { + // Arrange + Date date = new Date(1L); + ImmutableChangeInitiative.Json json = new ImmutableChangeInitiative.Json(); + + // Act + json.setStartDate(date); + + // Assert + assertSame(date, json.startDate); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/change_set/ImmutableChangeSetDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_set/ImmutableChangeSetDiffblueTest.java new file mode 100644 index 0000000000..93c100d79e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_set/ImmutableChangeSetDiffblueTest.java @@ -0,0 +1,98 @@ +package com.khartec.waltz.model.change_set; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.EntityReference; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableChangeSetDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableChangeSet.Json actualJson = new ImmutableChangeSet.Json(); + + // Assert + Optional optional = actualJson.parentEntity; + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.plannedDate); + assertSame(optional, actualJson.externalId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setKindTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableChangeSet.Json json = new ImmutableChangeSet.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableChangeUnitDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableChangeUnitDiffblueTest.java new file mode 100644 index 0000000000..6acc79da31 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableChangeUnitDiffblueTest.java @@ -0,0 +1,118 @@ +package com.khartec.waltz.model.change_unit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableChangeUnitDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableChangeUnit.Json actualJson = new ImmutableChangeUnit.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(actualJson.externalId, optional); + assertSame(optional, actualJson.changeSetId); + assertSame(optional, actualJson.externalId); + } + @Test + public void setActionTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setAction(ChangeAction.ACTIVATE); + + // Assert + assertEquals(ChangeAction.ACTIVATE, json.action); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setExecutionStatusTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setExecutionStatus(ExecutionStatus.PENDING); + + // Assert + assertEquals(ExecutionStatus.PENDING, json.executionStatus); + } + @Test + public void setKindTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setSubjectInitialStatusTest() { + // Arrange + ImmutableChangeUnit.Json json = new ImmutableChangeUnit.Json(); + + // Act + json.setSubjectInitialStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.subjectInitialStatus); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutablePhysicalFlowChangeUnitViewItemDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutablePhysicalFlowChangeUnitViewItemDiffblueTest.java new file mode 100644 index 0000000000..4487913cfd --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutablePhysicalFlowChangeUnitViewItemDiffblueTest.java @@ -0,0 +1,41 @@ +package com.khartec.waltz.model.change_unit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.assessment_rating.AssessmentRatingDetail; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutablePhysicalFlowChangeUnitViewItemDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutablePhysicalFlowChangeUnitViewItem.Json()).assessments.size()); + } + @Test + public void setAssessmentsTest() { + // Arrange + ImmutablePhysicalFlowChangeUnitViewItem.Json json = new ImmutablePhysicalFlowChangeUnitViewItem.Json(); + HashSet assessmentRatingDetailSet = new HashSet(); + assessmentRatingDetailSet.add(null); + + // Act + json.setAssessments(assessmentRatingDetailSet); + + // Assert + assertSame(assessmentRatingDetailSet, json.assessments); + } + @Test + public void setChangeUnitTest() { + // Arrange + ImmutablePhysicalFlowChangeUnitViewItem.Json json = new ImmutablePhysicalFlowChangeUnitViewItem.Json(); + ImmutableChangeUnit.Json json1 = new ImmutableChangeUnit.Json(); + + // Act + json.setChangeUnit(json1); + + // Assert + assertSame(json1, json.changeUnit); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableUpdateExecutionStatusCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableUpdateExecutionStatusCommandDiffblueTest.java new file mode 100644 index 0000000000..b529b96254 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/change_unit/ImmutableUpdateExecutionStatusCommandDiffblueTest.java @@ -0,0 +1,34 @@ +package com.khartec.waltz.model.change_unit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.command.EntityChangeCommand; +import org.junit.Test; + +public class ImmutableUpdateExecutionStatusCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUpdateExecutionStatusCommand.Json actualJson = new ImmutableUpdateExecutionStatusCommand.Json(); + + // Assert + assertEquals(0L, actualJson.id); + assertNull(actualJson.executionStatus); + assertFalse(actualJson.idIsSet); + } + @Test + public void setIdTest() { + // Arrange + ImmutableUpdateExecutionStatusCommand.Json json = new ImmutableUpdateExecutionStatusCommand.Json(); + + // Act + json.setId(123L); + + // Assert + assertEquals(123L, json.id); + assertTrue(json.idIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/changelog/ImmutableChangeLogDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/changelog/ImmutableChangeLogDiffblueTest.java new file mode 100644 index 0000000000..14a0959922 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/changelog/ImmutableChangeLogDiffblueTest.java @@ -0,0 +1,68 @@ +package com.khartec.waltz.model.changelog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.Operation; +import com.khartec.waltz.model.Severity; +import org.junit.Test; + +public class ImmutableChangeLogDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableChangeLog.Json actualJson = new ImmutableChangeLog.Json(); + + // Assert + assertNull(actualJson.parentReference); + assertNull(actualJson.message); + assertNull(actualJson.operation); + assertNull(actualJson.userId); + assertNull(actualJson.severity); + assertNull(actualJson.createdAt); + } + @Test + public void setMessageTest() { + // Arrange + ImmutableChangeLog.Json json = new ImmutableChangeLog.Json(); + + // Act + json.setMessage("message"); + + // Assert + assertEquals("message", json.message); + } + @Test + public void setOperationTest() { + // Arrange + ImmutableChangeLog.Json json = new ImmutableChangeLog.Json(); + + // Act + json.setOperation(Operation.ADD); + + // Assert + assertEquals(Operation.ADD, json.operation); + } + @Test + public void setSeverityTest() { + // Arrange + ImmutableChangeLog.Json json = new ImmutableChangeLog.Json(); + + // Act + json.setSeverity(Severity.INFORMATION); + + // Assert + assertEquals(Severity.INFORMATION, json.severity); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutableChangeLog.Json json = new ImmutableChangeLog.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointDiffblueTest.java new file mode 100644 index 0000000000..2df6a39ed6 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointDiffblueTest.java @@ -0,0 +1,72 @@ +package com.khartec.waltz.model.checkpoint; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.Quarter; +import org.junit.Test; + +public class ImmutableCheckpointDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableCheckpoint.Json actualJson = new ImmutableCheckpoint.Json(); + + // Assert + assertEquals(0, actualJson.year); + assertNull(actualJson.quarter); + assertNull(actualJson.description); + assertFalse(actualJson.yearIsSet); + assertNull(actualJson.name); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableCheckpoint.Json json = new ImmutableCheckpoint.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableCheckpoint.Json json = new ImmutableCheckpoint.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setQuarterTest() { + // Arrange + ImmutableCheckpoint.Json json = new ImmutableCheckpoint.Json(); + + // Act + json.setQuarter(Quarter.Q1); + + // Assert + assertEquals(Quarter.Q1, json.quarter); + } + @Test + public void setYearTest() { + // Arrange + ImmutableCheckpoint.Json json = new ImmutableCheckpoint.Json(); + + // Act + json.setYear(1); + + // Assert + assertEquals(1, json.year); + assertTrue(json.yearIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointGoalDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointGoalDiffblueTest.java new file mode 100644 index 0000000000..056d32f981 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/checkpoint/ImmutableCheckpointGoalDiffblueTest.java @@ -0,0 +1,63 @@ +package com.khartec.waltz.model.checkpoint; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableCheckpointGoalDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableCheckpointGoal.Json actualJson = new ImmutableCheckpointGoal.Json(); + + // Assert + assertEquals(0.0, actualJson.value, 0.0); + assertNull(actualJson.goalType); + assertFalse(actualJson.valueIsSet); + assertFalse(actualJson.checkpointIdIsSet); + assertEquals(0L, actualJson.checkpointId); + } + + + @Test + public void setCheckpointIdTest() { + // Arrange + ImmutableCheckpointGoal.Json json = new ImmutableCheckpointGoal.Json(); + + // Act + json.setCheckpointId(123L); + + // Assert + assertTrue(json.checkpointIdIsSet); + assertEquals(123L, json.checkpointId); + } + + @Test + public void setGoalTypeTest() { + // Arrange + ImmutableCheckpointGoal.Json json = new ImmutableCheckpointGoal.Json(); + + // Act + json.setGoalType(GoalType.ABOVE_THRESHOLD); + + // Assert + assertEquals(GoalType.ABOVE_THRESHOLD, json.goalType); + } + + @Test + public void setValueTest() { + // Arrange + ImmutableCheckpointGoal.Json json = new ImmutableCheckpointGoal.Json(); + + // Act + json.setValue(10.0); + + // Assert + assertEquals(10.0, json.value, 0.0); + assertTrue(json.valueIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/client_cache_key/ImmutableClientCacheKeyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/client_cache_key/ImmutableClientCacheKeyDiffblueTest.java new file mode 100644 index 0000000000..5299ed2fd6 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/client_cache_key/ImmutableClientCacheKeyDiffblueTest.java @@ -0,0 +1,41 @@ +package com.khartec.waltz.model.client_cache_key; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableClientCacheKeyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableClientCacheKey.Json actualJson = new ImmutableClientCacheKey.Json(); + + // Assert + assertNull(actualJson.key); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.guid); + } + @Test + public void setGuidTest() { + // Arrange + ImmutableClientCacheKey.Json json = new ImmutableClientCacheKey.Json(); + + // Act + json.setGuid("12345678"); + + // Assert + assertEquals("12345678", json.guid); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableClientCacheKey.Json json = new ImmutableClientCacheKey.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableCommandResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableCommandResponseDiffblueTest.java new file mode 100644 index 0000000000..70324c8046 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableCommandResponseDiffblueTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model.command; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableCommandResponseDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableCommandResponse.Json actualJson = new ImmutableCommandResponse.Json(); + + // Assert + assertNull(actualJson.entityReference); + assertNull(actualJson.outcome); + assertNull(actualJson.originalCommand); + } + + @Test + public void setOutcomeTest() { + // Arrange + ImmutableCommandResponse.Json json = new ImmutableCommandResponse.Json(); + + // Act + json.setOutcome(CommandOutcome.SUCCESS); + + // Assert + assertEquals(CommandOutcome.SUCCESS, json.outcome); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableDateFieldChangeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableDateFieldChangeDiffblueTest.java new file mode 100644 index 0000000000..66802552c5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableDateFieldChangeDiffblueTest.java @@ -0,0 +1,160 @@ +package com.khartec.waltz.model.command; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import java.util.Date; +import org.junit.Test; + +public class ImmutableDateFieldChangeDiffblueTest { + + @Test + public void buildTest() { + // Arrange and Act + ImmutableDateFieldChange actualBuildResult = ImmutableDateFieldChange.builder().build(); + + // Assert + assertEquals("DateFieldChange{newVal=null, oldVal=null," + " description=null}", actualBuildResult.toString()); + assertNull(actualBuildResult.description()); + } + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDateFieldChange.Json actualJson = new ImmutableDateFieldChange.Json(); + + // Assert + assertNull(actualJson.newVal); + assertNull(actualJson.oldVal); + assertNull(actualJson.description); + } + + @Test + public void descriptionTest2() { + // Arrange, Act and Assert + assertNull(ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).description()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).equals("another")); + } + + @Test + public void fromJsonTest() { + // Arrange and Act + ImmutableDateFieldChange actualFromJsonResult = ImmutableDateFieldChange + .fromJson(new ImmutableDateFieldChange.Json()); + + // Assert + assertEquals("DateFieldChange{newVal=null, oldVal=null," + " description=null}", actualFromJsonResult.toString()); + assertNull(actualFromJsonResult.description()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(193376997, ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).hashCode()); + } + + @Test + public void newValTest2() { + // Arrange, Act and Assert + assertNull(ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).newVal()); + } + + @Test + public void oldValTest2() { + // Arrange, Act and Assert + assertNull(ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).oldVal()); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableDateFieldChange.Json json = new ImmutableDateFieldChange.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setNewValTest() { + // Arrange + Date date = new Date(1L); + ImmutableDateFieldChange.Json json = new ImmutableDateFieldChange.Json(); + + // Act + json.setNewVal(date); + + // Assert + assertSame(date, json.newVal); + } + + @Test + public void setOldValTest() { + // Arrange + Date date = new Date(1L); + ImmutableDateFieldChange.Json json = new ImmutableDateFieldChange.Json(); + + // Act + json.setOldVal(date); + + // Assert + assertSame(date, json.oldVal); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("DateFieldChange{newVal=null, oldVal=null," + " description=null}", + ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()).toString()); + } + + @Test + public void withDescriptionTest() { + // Arrange and Act + ImmutableDateFieldChange actualWithDescriptionResult = ImmutableDateFieldChange + .fromJson(new ImmutableDateFieldChange.Json()).withDescription("value"); + + // Assert + assertEquals("DateFieldChange{newVal=null, oldVal=null," + " description=value}", + actualWithDescriptionResult.toString()); + assertEquals("value", actualWithDescriptionResult.description()); + } + + @Test + public void withNewValTest() { + // Arrange + ImmutableDateFieldChange fromJsonResult = ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()); + + // Act + ImmutableDateFieldChange actualWithNewValResult = fromJsonResult.withNewVal(new Date(1L)); + + // Assert + assertEquals("DateFieldChange{newVal=Thu Jan 01 01:00:00 GMT 1970," + " oldVal=null, description=null}", + actualWithNewValResult.toString()); + assertNull(actualWithNewValResult.description()); + } + + @Test + public void withOldValTest() { + // Arrange + ImmutableDateFieldChange fromJsonResult = ImmutableDateFieldChange.fromJson(new ImmutableDateFieldChange.Json()); + + // Act + ImmutableDateFieldChange actualWithOldValResult = fromJsonResult.withOldVal(new Date(1L)); + + // Assert + assertEquals("DateFieldChange{newVal=null, oldVal=Thu Jan 01" + " 01:00:00 GMT 1970, description=null}", + actualWithOldValResult.toString()); + assertNull(actualWithOldValResult.description()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableFieldChangeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableFieldChangeDiffblueTest.java new file mode 100644 index 0000000000..f7ec8fe885 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/command/ImmutableFieldChangeDiffblueTest.java @@ -0,0 +1,68 @@ +package com.khartec.waltz.model.command; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableFieldChangeDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableFieldChange.Json actualJson = new ImmutableFieldChange.Json(); + + // Assert + assertNull(actualJson.description); + assertNull(actualJson.oldVal); + assertNull(actualJson.newVal); + } + + @Test + public void fromJsonTest() { + // Arrange and Act + ImmutableFieldChange actualFromJsonResult = ImmutableFieldChange + .fromJson(new ImmutableFieldChange.Json()); + + // Assert + assertEquals("FieldChange{newVal=null, oldVal=null," + " description=null}", actualFromJsonResult.toString()); + assertNull(actualFromJsonResult.description()); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableFieldChange.Json json = new ImmutableFieldChange.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setNewValTest() { + // Arrange + ImmutableFieldChange.Json json = new ImmutableFieldChange.Json(); + + // Act + json.setNewVal("newVal"); + + // Assert + assertTrue(json.newVal instanceof String); + } + + @Test + public void setOldValTest() { + // Arrange + ImmutableFieldChange.Json json = new ImmutableFieldChange.Json(); + + // Act + json.setOldVal("oldVal"); + + // Assert + assertTrue(json.oldVal instanceof String); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityRatingDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityRatingDiffblueTest.java new file mode 100644 index 0000000000..9737139613 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityRatingDiffblueTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.model.complexity; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableComplexityRatingDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableComplexityRating.Json actualJson = new ImmutableComplexityRating.Json(); + + // Assert + Optional optional = actualJson.serverComplexity; + assertSame(actualJson.measurableComplexity, optional); + assertSame(optional, actualJson.connectionComplexity); + assertSame(optional, actualJson.measurableComplexity); + } + + + @Test + public void setIdTest() { + // Arrange + ImmutableComplexityRating.Json json = new ImmutableComplexityRating.Json(); + + // Act + json.setId(123L); + + // Assert + assertTrue(json.idIsSet); + assertEquals(123L, json.id); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityScoreDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityScoreDiffblueTest.java new file mode 100644 index 0000000000..896d7db39e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/complexity/ImmutableComplexityScoreDiffblueTest.java @@ -0,0 +1,63 @@ +package com.khartec.waltz.model.complexity; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableComplexityScoreDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableComplexityScore.Json actualJson = new ImmutableComplexityScore.Json(); + + // Assert + assertEquals(0L, actualJson.id); + assertFalse(actualJson.scoreIsSet); + assertNull(actualJson.kind); + assertEquals(0.0, actualJson.score, 0.0); + assertFalse(actualJson.idIsSet); + } + + + @Test + public void setIdTest() { + // Arrange + ImmutableComplexityScore.Json json = new ImmutableComplexityScore.Json(); + + // Act + json.setId(123L); + + // Assert + assertEquals(123L, json.id); + assertTrue(json.idIsSet); + } + + @Test + public void setKindTest() { + // Arrange + ImmutableComplexityScore.Json json = new ImmutableComplexityScore.Json(); + + // Act + json.setKind(ComplexityKind.CONNECTION); + + // Assert + assertEquals(ComplexityKind.CONNECTION, json.kind); + } + + @Test + public void setScoreTest() { + // Arrange + ImmutableComplexityScore.Json json = new ImmutableComplexityScore.Json(); + + // Act + json.setScore(10.0); + + // Assert + assertTrue(json.scoreIsSet); + assertEquals(10.0, json.score, 0.0); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableApplicationCostDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableApplicationCostDiffblueTest.java new file mode 100644 index 0000000000..da3c656e0a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableApplicationCostDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.cost; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableApplicationCostDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableApplicationCost.Json actualJson = new ImmutableApplicationCost.Json(); + + // Assert + assertNull(actualJson.cost); + assertNull(actualJson.application); + } + @Test + public void setCostTest() { + // Arrange + ImmutableApplicationCost.Json json = new ImmutableApplicationCost.Json(); + ImmutableCost.Json json1 = new ImmutableCost.Json(); + + // Act + json.setCost(json1); + + // Assert + assertSame(json1, json.cost); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostDiffblueTest.java new file mode 100644 index 0000000000..eaed41f4a4 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostDiffblueTest.java @@ -0,0 +1,61 @@ +package com.khartec.waltz.model.cost; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableAssetCostDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAssetCost.Json actualJson = new ImmutableAssetCost.Json(); + + // Assert + assertNull(actualJson.assetCode); + assertNull(actualJson.provenance); + assertNull(actualJson.cost); + } + + + + @Test + public void setAssetCodeTest() { + // Arrange + ImmutableAssetCost.Json json = new ImmutableAssetCost.Json(); + + // Act + json.setAssetCode("assetCode"); + + // Assert + assertEquals("assetCode", json.assetCode); + } + + @Test + public void setCostTest() { + // Arrange + ImmutableAssetCost.Json json = new ImmutableAssetCost.Json(); + ImmutableCost.Json json1 = new ImmutableCost.Json(); + + // Act + json.setCost(json1); + + // Assert + assertSame(json1, json.cost); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableAssetCost.Json json = new ImmutableAssetCost.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostQueryOptionsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostQueryOptionsDiffblueTest.java new file mode 100644 index 0000000000..2d74038866 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableAssetCostQueryOptionsDiffblueTest.java @@ -0,0 +1,33 @@ +package com.khartec.waltz.model.cost; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableAssetCostQueryOptionsDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAssetCostQueryOptions.Json actualJson = new ImmutableAssetCostQueryOptions.Json(); + + // Assert + assertEquals(0, actualJson.year); + assertNull(actualJson.idSelectionOptions); + assertFalse(actualJson.yearIsSet); + } + @Test + public void setYearTest() { + // Arrange + ImmutableAssetCostQueryOptions.Json json = new ImmutableAssetCostQueryOptions.Json(); + + // Act + json.setYear(1); + + // Assert + assertEquals(1, json.year); + assertTrue(json.yearIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableCostDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableCostDiffblueTest.java new file mode 100644 index 0000000000..c3229bffd5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/cost/ImmutableCostDiffblueTest.java @@ -0,0 +1,73 @@ +package com.khartec.waltz.model.cost; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import java.math.BigDecimal; +import org.junit.Test; + +public class ImmutableCostDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableCost.Json actualJson = new ImmutableCost.Json(); + + // Assert + assertNull(actualJson.costKind); + assertFalse(actualJson.yearIsSet); + assertEquals(0, actualJson.year); + assertNull(actualJson.kind); + assertNull(actualJson.amount); + } + @Test + public void setAmountTest() { + // Arrange + BigDecimal valueOfResult = BigDecimal.valueOf(1L); + ImmutableCost.Json json = new ImmutableCost.Json(); + + // Act + json.setAmount(valueOfResult); + + // Assert + assertSame(valueOfResult, json.amount); + } + @Test + public void setCostKindTest() { + // Arrange + ImmutableCost.Json json = new ImmutableCost.Json(); + + // Act + json.setCostKind("costKind"); + + // Assert + assertEquals("costKind", json.costKind); + } + @Test + public void setKindTest() { + // Arrange + ImmutableCost.Json json = new ImmutableCost.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setYearTest() { + // Arrange + ImmutableCost.Json json = new ImmutableCost.Json(); + + // Act + json.setYear(1); + + // Assert + assertTrue(json.yearIsSet); + assertEquals(1, json.year); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDataTypeDirectionKeyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDataTypeDirectionKeyDiffblueTest.java new file mode 100644 index 0000000000..878325a133 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDataTypeDirectionKeyDiffblueTest.java @@ -0,0 +1,41 @@ +package com.khartec.waltz.model.data_flow_decorator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.FlowDirection; +import org.junit.Test; + +public class ImmutableDataTypeDirectionKeyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDataTypeDirectionKey.Json actualJson = new ImmutableDataTypeDirectionKey.Json(); + + // Assert + assertNull(actualJson.flowDirection); + assertNull(actualJson.DatatypeId); + } + @Test + public void setDatatypeIdTest() { + // Arrange + ImmutableDataTypeDirectionKey.Json json = new ImmutableDataTypeDirectionKey.Json(); + + // Act + json.setDatatypeId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.DatatypeId); + } + @Test + public void setFlowDirectionTest() { + // Arrange + ImmutableDataTypeDirectionKey.Json json = new ImmutableDataTypeDirectionKey.Json(); + + // Act + json.setFlowDirection(FlowDirection.INBOUND); + + // Assert + assertEquals(FlowDirection.INBOUND, json.flowDirection); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDecoratorRatingSummaryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDecoratorRatingSummaryDiffblueTest.java new file mode 100644 index 0000000000..8dc104912a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableDecoratorRatingSummaryDiffblueTest.java @@ -0,0 +1,46 @@ +package com.khartec.waltz.model.data_flow_decorator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableDecoratorRatingSummaryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDecoratorRatingSummary.Json actualJson = new ImmutableDecoratorRatingSummary.Json(); + + // Assert + assertFalse(actualJson.countIsSet); + assertNull(actualJson.decoratorEntityReference); + assertEquals(0, actualJson.count); + assertNull(actualJson.rating); + } + @Test + public void setCountTest() { + // Arrange + ImmutableDecoratorRatingSummary.Json json = new ImmutableDecoratorRatingSummary.Json(); + + // Act + json.setCount(3); + + // Assert + assertTrue(json.countIsSet); + assertEquals(3, json.count); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableDecoratorRatingSummary.Json json = new ImmutableDecoratorRatingSummary.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorDiffblueTest.java new file mode 100644 index 0000000000..8e2753158c --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorDiffblueTest.java @@ -0,0 +1,81 @@ +package com.khartec.waltz.model.data_flow_decorator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.rating.AuthoritativenessRating; +import org.junit.Test; + +public class ImmutableLogicalFlowDecoratorDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLogicalFlowDecorator.Json actualJson = new ImmutableLogicalFlowDecorator.Json(); + + // Assert + assertEquals(0L, actualJson.dataFlowId); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.rating); + assertFalse(actualJson.dataFlowIdIsSet); + assertNull(actualJson.decoratorEntity); + } + + + + + @Test + public void setDataFlowIdTest() { + // Arrange + ImmutableLogicalFlowDecorator.Json json = new ImmutableLogicalFlowDecorator.Json(); + + // Act + json.setDataFlowId(123L); + + // Assert + assertEquals(123L, json.dataFlowId); + assertTrue(json.dataFlowIdIsSet); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableLogicalFlowDecorator.Json json = new ImmutableLogicalFlowDecorator.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableLogicalFlowDecorator.Json json = new ImmutableLogicalFlowDecorator.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setRatingTest() { + // Arrange + ImmutableLogicalFlowDecorator.Json json = new ImmutableLogicalFlowDecorator.Json(); + + // Act + json.setRating(AuthoritativenessRating.PRIMARY); + + // Assert + assertEquals(AuthoritativenessRating.PRIMARY, json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorStatDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorStatDiffblueTest.java new file mode 100644 index 0000000000..eb9f6437db --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableLogicalFlowDecoratorStatDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.data_flow_decorator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableLogicalFlowDecoratorStatDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLogicalFlowDecoratorStat.Json actualJson = new ImmutableLogicalFlowDecoratorStat.Json(); + + // Assert + assertFalse(actualJson.dataTypeIdIsSet); + assertEquals(0, actualJson.totalCount); + assertNull(actualJson.logicalFlowMeasures); + assertEquals(0L, actualJson.dataTypeId); + assertFalse(actualJson.totalCountIsSet); + } + @Test + public void setDataTypeIdTest() { + // Arrange + ImmutableLogicalFlowDecoratorStat.Json json = new ImmutableLogicalFlowDecoratorStat.Json(); + + // Act + json.setDataTypeId(123L); + + // Assert + assertTrue(json.dataTypeIdIsSet); + assertEquals(123L, json.dataTypeId); + } + @Test + public void setTotalCountTest() { + // Arrange + ImmutableLogicalFlowDecoratorStat.Json json = new ImmutableLogicalFlowDecoratorStat.Json(); + + // Act + json.setTotalCount(3); + + // Assert + assertEquals(3, json.totalCount); + assertTrue(json.totalCountIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableUpdateDataFlowDecoratorsActionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableUpdateDataFlowDecoratorsActionDiffblueTest.java new file mode 100644 index 0000000000..226430c333 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_flow_decorator/ImmutableUpdateDataFlowDecoratorsActionDiffblueTest.java @@ -0,0 +1,60 @@ +package com.khartec.waltz.model.data_flow_decorator; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityReference; +import java.util.HashSet; +import java.util.Set; +import org.junit.Test; + +public class ImmutableUpdateDataFlowDecoratorsActionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUpdateDataFlowDecoratorsAction.Json actualJson = new ImmutableUpdateDataFlowDecoratorsAction.Json(); + + // Assert + Set entityReferenceSet = actualJson.addedDecorators; + Set actualEntityReferenceSet = actualJson.removedDecorators; + assertEquals(0, entityReferenceSet.size()); + assertSame(entityReferenceSet, actualEntityReferenceSet); + } + @Test + public void setAddedDecoratorsTest() { + // Arrange + ImmutableUpdateDataFlowDecoratorsAction.Json json = new ImmutableUpdateDataFlowDecoratorsAction.Json(); + HashSet entityReferenceSet = new HashSet(); + entityReferenceSet.add(null); + + // Act + json.setAddedDecorators(entityReferenceSet); + + // Assert + assertSame(entityReferenceSet, json.addedDecorators); + } + @Test + public void setFlowIdTest() { + // Arrange + ImmutableUpdateDataFlowDecoratorsAction.Json json = new ImmutableUpdateDataFlowDecoratorsAction.Json(); + + // Act + json.setFlowId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.flowId); + } + @Test + public void setRemovedDecoratorsTest() { + // Arrange + ImmutableUpdateDataFlowDecoratorsAction.Json json = new ImmutableUpdateDataFlowDecoratorsAction.Json(); + HashSet entityReferenceSet = new HashSet(); + entityReferenceSet.add(null); + + // Act + json.setRemovedDecorators(entityReferenceSet); + + // Assert + assertSame(entityReferenceSet, json.removedDecorators); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/data_type_usage/ImmutableDataTypeUsageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_type_usage/ImmutableDataTypeUsageDiffblueTest.java new file mode 100644 index 0000000000..cb833aa4d6 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/data_type_usage/ImmutableDataTypeUsageDiffblueTest.java @@ -0,0 +1,48 @@ +package com.khartec.waltz.model.data_type_usage; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableDataTypeUsageDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDataTypeUsage.Json actualJson = new ImmutableDataTypeUsage.Json(); + + // Assert + assertNull(actualJson.dataTypeId); + assertNull(actualJson.usage); + assertNull(actualJson.entityReference); + assertNull(actualJson.provenance); + } + + + + @Test + public void setDataTypeIdTest() { + // Arrange + ImmutableDataTypeUsage.Json json = new ImmutableDataTypeUsage.Json(); + + // Act + json.setDataTypeId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.dataTypeId); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableDataTypeUsage.Json json = new ImmutableDataTypeUsage.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseInformationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseInformationDiffblueTest.java new file mode 100644 index 0000000000..a4440dc862 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseInformationDiffblueTest.java @@ -0,0 +1,143 @@ +package com.khartec.waltz.model.database_information; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.AssetCodeProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.LifecycleStatus; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Date; +import org.junit.Test; + +public class ImmutableDatabaseInformationDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDatabaseInformation.Json actualJson = new ImmutableDatabaseInformation.Json(); + + // Assert + assertNull(actualJson.databaseName); + assertNull(actualJson.endOfLifeDate); + assertNull(actualJson.lifecycleStatus); + assertNull(actualJson.environment); + assertNull(actualJson.dbmsVendor); + assertNull(actualJson.dbmsVersion); + assertNull(actualJson.dbmsName); + assertNull(actualJson.provenance); + assertNull(actualJson.assetCode); + assertNull(actualJson.instanceName); + } + @Test + public void setAssetCodeTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setAssetCode("assetCode"); + + // Assert + assertEquals("assetCode", json.assetCode); + } + @Test + public void setDatabaseNameTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setDatabaseName("databaseName"); + + // Assert + assertEquals("databaseName", json.databaseName); + } + @Test + public void setDbmsNameTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setDbmsName("dbmsName"); + + // Assert + assertEquals("dbmsName", json.dbmsName); + } + @Test + public void setDbmsVendorTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setDbmsVendor("dbmsVendor"); + + // Assert + assertEquals("dbmsVendor", json.dbmsVendor); + } + @Test + public void setDbmsVersionTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setDbmsVersion("dbmsVersion"); + + // Assert + assertEquals("dbmsVersion", json.dbmsVersion); + } + @Test + public void setEndOfLifeDateTest() { + // Arrange + Date date = new Date(1L); + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setEndOfLifeDate(date); + + // Assert + assertSame(date, json.endOfLifeDate); + } + @Test + public void setEnvironmentTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setEnvironment("environment"); + + // Assert + assertEquals("environment", json.environment); + } + @Test + public void setInstanceNameTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setInstanceName("instanceName"); + + // Assert + assertEquals("instanceName", json.instanceName); + } + @Test + public void setLifecycleStatusTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setLifecycleStatus(LifecycleStatus.ACTIVE); + + // Assert + assertEquals(LifecycleStatus.ACTIVE, json.lifecycleStatus); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableDatabaseInformation.Json json = new ImmutableDatabaseInformation.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseSummaryStatisticsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseSummaryStatisticsDiffblueTest.java new file mode 100644 index 0000000000..3c9de5322f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/database_information/ImmutableDatabaseSummaryStatisticsDiffblueTest.java @@ -0,0 +1,176 @@ +package com.khartec.waltz.model.database_information; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.tally.Tally; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableDatabaseSummaryStatisticsDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + ImmutableDatabaseSummaryStatistics.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDatabaseSummaryStatistics.Json actualJson = new ImmutableDatabaseSummaryStatistics.Json(); + + // Assert + List> tallyList = actualJson.environmentCounts; + List> actualTallyList = actualJson.vendorCounts; + List> actualTallyList1 = actualJson.endOfLifeStatusCounts; + assertEquals(0, tallyList.size()); + assertSame(tallyList, actualTallyList1); + assertSame(tallyList, actualTallyList); + } + + @Test + public void endOfLifeStatusCountsTest2() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + + // Act + List> actualEndOfLifeStatusCountsResult = ImmutableDatabaseSummaryStatistics.fromJson(json) + .endOfLifeStatusCounts(); + + // Assert + assertSame(json.endOfLifeStatusCounts, actualEndOfLifeStatusCountsResult); + assertEquals(0, actualEndOfLifeStatusCountsResult.size()); + } + + @Test + public void environmentCountsTest2() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + + // Act + List> actualEnvironmentCountsResult = ImmutableDatabaseSummaryStatistics.fromJson(json) + .environmentCounts(); + + // Assert + assertSame(json.endOfLifeStatusCounts, actualEnvironmentCountsResult); + assertEquals(0, actualEnvironmentCountsResult.size()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableDatabaseSummaryStatistics.fromJson(new ImmutableDatabaseSummaryStatistics.Json()).equals("element")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + ImmutableDatabaseSummaryStatistics.fromJson(new ImmutableDatabaseSummaryStatistics.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(193378120, + ImmutableDatabaseSummaryStatistics.fromJson(new ImmutableDatabaseSummaryStatistics.Json()).hashCode()); + } + + @Test + public void setEndOfLifeStatusCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setEndOfLifeStatusCounts(tallyList); + + // Assert + assertSame(tallyList, json.endOfLifeStatusCounts); + } + + @Test + public void setEnvironmentCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setEnvironmentCounts(tallyList); + + // Assert + assertSame(tallyList, json.environmentCounts); + } + + @Test + public void setVendorCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setVendorCounts(tallyList); + + // Assert + assertSame(tallyList, json.vendorCounts); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + ImmutableDatabaseSummaryStatistics.fromJson(new ImmutableDatabaseSummaryStatistics.Json()).toString()); + } + + @Test + public void vendorCountsTest2() { + // Arrange + ImmutableDatabaseSummaryStatistics.Json json = new ImmutableDatabaseSummaryStatistics.Json(); + + // Act + List> actualVendorCountsResult = ImmutableDatabaseSummaryStatistics.fromJson(json).vendorCounts(); + + // Assert + assertSame(json.endOfLifeStatusCounts, actualVendorCountsResult); + assertEquals(0, actualVendorCountsResult.size()); + } + + @Test + public void withEndOfLifeStatusCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics fromJsonResult = ImmutableDatabaseSummaryStatistics + .fromJson(new ImmutableDatabaseSummaryStatistics.Json()); + + // Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + fromJsonResult.withEndOfLifeStatusCounts(new ArrayList>()).toString()); + } + + @Test + public void withEnvironmentCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics fromJsonResult = ImmutableDatabaseSummaryStatistics + .fromJson(new ImmutableDatabaseSummaryStatistics.Json()); + + // Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + fromJsonResult.withEnvironmentCounts(new ArrayList>()).toString()); + } + + @Test + public void withVendorCountsTest() { + // Arrange + ImmutableDatabaseSummaryStatistics fromJsonResult = ImmutableDatabaseSummaryStatistics + .fromJson(new ImmutableDatabaseSummaryStatistics.Json()); + + // Act and Assert + assertEquals("DatabaseSummaryStatistics{environmentCounts=[]," + " vendorCounts=[], endOfLifeStatusCounts=[]}", + fromJsonResult.withVendorCounts(new ArrayList>()).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/datatype/ImmutableDataTypeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/datatype/ImmutableDataTypeDiffblueTest.java new file mode 100644 index 0000000000..b7018ed958 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/datatype/ImmutableDataTypeDiffblueTest.java @@ -0,0 +1,105 @@ +package com.khartec.waltz.model.datatype; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CodeProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ParentIdProvider; +import org.junit.Test; + +public class ImmutableDataTypeDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDataType.Json actualJson = new ImmutableDataType.Json(); + + // Assert + assertSame(actualJson.id, actualJson.parentId); + } + @Test + public void setCodeTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setCode("code"); + + // Assert + assertEquals("code", json.code); + } + @Test + public void setConcreteTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setConcrete(true); + + // Assert + assertTrue(json.concrete); + assertTrue(json.concreteIsSet); + } + @Test + public void setDeprecatedTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setDeprecated(true); + + // Assert + assertTrue(json.deprecatedIsSet); + assertTrue(json.deprecated); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setKindTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setUnknownTest() { + // Arrange + ImmutableDataType.Json json = new ImmutableDataType.Json(); + + // Act + json.setUnknown(true); + + // Assert + assertTrue(json.unknown); + assertTrue(json.unknownIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/drill_grid/ImmutableDrillGridDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/drill_grid/ImmutableDrillGridDefinitionDiffblueTest.java new file mode 100644 index 0000000000..a41f1161eb --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/drill_grid/ImmutableDrillGridDefinitionDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.drill_grid; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableDrillGridDefinitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableDrillGridDefinition.Json actualJson = new ImmutableDrillGridDefinition.Json(); + + // Assert + assertNull(actualJson.xAxis); + assertNull(actualJson.name); + assertNull(actualJson.yAxis); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableDrillGridDefinition.Json json = new ImmutableDrillGridDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableDrillGridDefinition.Json json = new ImmutableDrillGridDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/enduserapp/ImmutableEndUserApplicationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/enduserapp/ImmutableEndUserApplicationDiffblueTest.java new file mode 100644 index 0000000000..1617386d39 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/enduserapp/ImmutableEndUserApplicationDiffblueTest.java @@ -0,0 +1,142 @@ +package com.khartec.waltz.model.enduserapp; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.application.LifecyclePhase; +import org.junit.Test; + +public class ImmutableEndUserApplicationDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEndUserApplication.Json actualJson = new ImmutableEndUserApplication.Json(); + + // Assert + assertSame(actualJson.id, actualJson.externalId); + } + + + + + + + + + @Test + public void setApplicationKindTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setApplicationKind("applicationKind"); + + // Assert + assertEquals("applicationKind", json.applicationKind); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setIsPromotedTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setIsPromoted(true); + + // Assert + assertEquals(Boolean.valueOf(true), json.isPromoted); + } + + @Test + public void setKindTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + + @Test + public void setLifecyclePhaseTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setLifecyclePhase(LifecyclePhase.PRODUCTION); + + // Assert + assertEquals(LifecyclePhase.PRODUCTION, json.lifecyclePhase); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setOrganisationalUnitIdTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setOrganisationalUnitId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.organisationalUnitId); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setRiskRatingTest() { + // Arrange + ImmutableEndUserApplication.Json json = new ImmutableEndUserApplication.Json(); + + // Act + json.setRiskRating(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.riskRating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumDefinitionDiffblueTest.java new file mode 100644 index 0000000000..420aa1e907 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumDefinitionDiffblueTest.java @@ -0,0 +1,111 @@ +package com.khartec.waltz.model.entity_enum; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.IconProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableEntityEnumDefinitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityEnumDefinition.Json actualJson = new ImmutableEntityEnumDefinition.Json(); + + // Assert + assertFalse(actualJson.isEditable); + assertFalse(actualJson.isEditableIsSet); + assertFalse(actualJson.positionIsSet); + assertNull(actualJson.enumValueType); + assertEquals(0, actualJson.position); + assertNull(actualJson.icon); + assertNull(actualJson.entityKind); + assertNull(actualJson.name); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityKindTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.entityKind); + } + @Test + public void setEnumValueTypeTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setEnumValueType("enumValueType"); + + // Assert + assertEquals("enumValueType", json.enumValueType); + } + @Test + public void setIconTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setIcon("icon"); + + // Assert + assertEquals("icon", json.icon); + } + @Test + public void setIsEditableTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setIsEditable(true); + + // Assert + assertTrue(json.isEditable); + assertTrue(json.isEditableIsSet); + } + @Test + public void setNameTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableEntityEnumDefinition.Json json = new ImmutableEntityEnumDefinition.Json(); + + // Act + json.setPosition(1); + + // Assert + assertTrue(json.positionIsSet); + assertEquals(1, json.position); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumValueDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumValueDiffblueTest.java new file mode 100644 index 0000000000..664dec3f75 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_enum/ImmutableEntityEnumValueDiffblueTest.java @@ -0,0 +1,72 @@ +package com.khartec.waltz.model.entity_enum; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityEnumValueDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityEnumValue.Json actualJson = new ImmutableEntityEnumValue.Json(); + + // Assert + assertEquals(0L, actualJson.definitionId); + assertFalse(actualJson.definitionIdIsSet); + assertNull(actualJson.provenance); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.entityReference); + assertNull(actualJson.enumValueKey); + assertNull(actualJson.lastUpdatedAt); + } + @Test + public void setDefinitionIdTest() { + // Arrange + ImmutableEntityEnumValue.Json json = new ImmutableEntityEnumValue.Json(); + + // Act + json.setDefinitionId(123L); + + // Assert + assertEquals(123L, json.definitionId); + assertTrue(json.definitionIdIsSet); + } + @Test + public void setEnumValueKeyTest() { + // Arrange + ImmutableEntityEnumValue.Json json = new ImmutableEntityEnumValue.Json(); + + // Act + json.setEnumValueKey("enumValueKey"); + + // Assert + assertEquals("enumValueKey", json.enumValueKey); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableEntityEnumValue.Json json = new ImmutableEntityEnumValue.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityEnumValue.Json json = new ImmutableEntityEnumValue.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_hierarchy/ImmutableEntityHierarchyItemDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_hierarchy/ImmutableEntityHierarchyItemDiffblueTest.java new file mode 100644 index 0000000000..0b8b166e31 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_hierarchy/ImmutableEntityHierarchyItemDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model.entity_hierarchy; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LevelProvider; +import com.khartec.waltz.model.ParentIdProvider; +import org.junit.Test; + +public class ImmutableEntityHierarchyItemDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityHierarchyItem.Json actualJson = new ImmutableEntityHierarchyItem.Json(); + + // Assert + assertSame(actualJson.id, actualJson.parentId); + } + + + + + + @Test + public void setKindTest() { + // Arrange + ImmutableEntityHierarchyItem.Json json = new ImmutableEntityHierarchyItem.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + + @Test + public void setLevelTest() { + // Arrange + ImmutableEntityHierarchyItem.Json json = new ImmutableEntityHierarchyItem.Json(); + + // Act + json.setLevel(1); + + // Assert + assertEquals(1, json.level); + assertTrue(json.levelIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNodeTypeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNodeTypeDiffblueTest.java new file mode 100644 index 0000000000..007255a57f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNodeTypeDiffblueTest.java @@ -0,0 +1,79 @@ +package com.khartec.waltz.model.entity_named_note; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableEntityNamedNodeTypeDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableEntityNamedNodeType.Json()).applicableEntityKinds.size()); + } + @Test + public void setApplicableEntityKindsTest() { + // Arrange + ImmutableEntityNamedNodeType.Json json = new ImmutableEntityNamedNodeType.Json(); + HashSet entityKindSet = new HashSet(); + entityKindSet.add(EntityKind.ACTOR); + + // Act + json.setApplicableEntityKinds(entityKindSet); + + // Assert + assertSame(entityKindSet, json.applicableEntityKinds); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityNamedNodeType.Json json = new ImmutableEntityNamedNodeType.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsReadOnlyTest() { + // Arrange + ImmutableEntityNamedNodeType.Json json = new ImmutableEntityNamedNodeType.Json(); + + // Act + json.setIsReadOnly(true); + + // Assert + assertTrue(json.isReadOnly); + assertTrue(json.isReadOnlyIsSet); + } + @Test + public void setNameTest() { + // Arrange + ImmutableEntityNamedNodeType.Json json = new ImmutableEntityNamedNodeType.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableEntityNamedNodeType.Json json = new ImmutableEntityNamedNodeType.Json(); + + // Act + json.setPosition(1); + + // Assert + assertTrue(json.positionIsSet); + assertEquals(1, json.position); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteDiffblueTest.java new file mode 100644 index 0000000000..40e560d56d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteDiffblueTest.java @@ -0,0 +1,72 @@ +package com.khartec.waltz.model.entity_named_note; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityNamedNoteDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityNamedNote.Json actualJson = new ImmutableEntityNamedNote.Json(); + + // Assert + assertNull(actualJson.provenance); + assertFalse(actualJson.namedNoteTypeIdIsSet); + assertEquals(0L, actualJson.namedNoteTypeId); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityReference); + assertNull(actualJson.noteText); + assertNull(actualJson.lastUpdatedBy); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableEntityNamedNote.Json json = new ImmutableEntityNamedNote.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNamedNoteTypeIdTest() { + // Arrange + ImmutableEntityNamedNote.Json json = new ImmutableEntityNamedNote.Json(); + + // Act + json.setNamedNoteTypeId(123L); + + // Assert + assertTrue(json.namedNoteTypeIdIsSet); + assertEquals(123L, json.namedNoteTypeId); + } + @Test + public void setNoteTextTest() { + // Arrange + ImmutableEntityNamedNote.Json json = new ImmutableEntityNamedNote.Json(); + + // Act + json.setNoteText("noteText"); + + // Assert + assertEquals("noteText", json.noteText); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityNamedNote.Json json = new ImmutableEntityNamedNote.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteTypeChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteTypeChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..d7a0f82353 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_named_note/ImmutableEntityNamedNoteTypeChangeCommandDiffblueTest.java @@ -0,0 +1,148 @@ +package com.khartec.waltz.model.entity_named_note; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityKind; +import java.util.HashSet; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableEntityNamedNoteTypeChangeCommandDiffblueTest { + + @Test + public void applicableEntityKindsTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand.Json json = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Act and Assert + assertSame(json.position, ImmutableEntityNamedNoteTypeChangeCommand.fromJson(json).applicableEntityKinds()); + } + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{}", + ImmutableEntityNamedNoteTypeChangeCommand.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityNamedNoteTypeChangeCommand.Json actualJson = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Assert + Optional optional = actualJson.isReadOnly; + assertSame(actualJson.position, optional); + assertSame(optional, actualJson.position); + assertSame(optional, actualJson.description); + assertSame(optional, actualJson.name); + assertSame(optional, actualJson.applicableEntityKinds); + } + + @Test + public void descriptionTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand.Json json = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Act and Assert + assertSame(json.position, ImmutableEntityNamedNoteTypeChangeCommand.fromJson(json).description()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableEntityNamedNoteTypeChangeCommand.fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()) + .equals("EntityNamedNoteTypeChangeCommand{")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).toString()); + } + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(134152229, ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).hashCode()); + } + + @Test + public void isReadOnlyTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand.Json json = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Act and Assert + assertSame(json.position, ImmutableEntityNamedNoteTypeChangeCommand.fromJson(json).isReadOnly()); + } + + @Test + public void nameTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand.Json json = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Act and Assert + assertSame(json.position, ImmutableEntityNamedNoteTypeChangeCommand.fromJson(json).name()); + } + + @Test + public void positionTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand.Json json = new ImmutableEntityNamedNoteTypeChangeCommand.Json(); + + // Act and Assert + assertSame(json.position, ImmutableEntityNamedNoteTypeChangeCommand.fromJson(json).position()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).toString()); + } + + @Test + public void withApplicableEntityKindsTest() { + // Arrange + ImmutableEntityNamedNoteTypeChangeCommand fromJsonResult = ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()); + HashSet entityKindSet = new HashSet(); + entityKindSet.add(EntityKind.ACTOR); + + // Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{applicableEntityKinds" + "=[ACTOR]}", + fromJsonResult.withApplicableEntityKinds(entityKindSet).toString()); + } + + @Test + public void withDescriptionTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{description" + "=value}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).withDescription("value").toString()); + } + + @Test + public void withIsReadOnlyTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{isReadOnly=true}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).withIsReadOnly(true).toString()); + } + + @Test + public void withNameTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{name=value}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).withName("value").toString()); + } + + @Test + public void withPositionTest() { + // Arrange, Act and Assert + assertEquals("EntityNamedNoteTypeChangeCommand{position=42}", ImmutableEntityNamedNoteTypeChangeCommand + .fromJson(new ImmutableEntityNamedNoteTypeChangeCommand.Json()).withPosition(42).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..29d6d4cbbe --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipChangeCommandDiffblueTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.Operation; +import org.junit.Test; + +public class ImmutableEntityRelationshipChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityRelationshipChangeCommand.Json actualJson = new ImmutableEntityRelationshipChangeCommand.Json(); + + // Assert + assertNull(actualJson.entityReference); + assertNull(actualJson.relationship); + assertNull(actualJson.operation); + } + @Test + public void setOperationTest() { + // Arrange + ImmutableEntityRelationshipChangeCommand.Json json = new ImmutableEntityRelationshipChangeCommand.Json(); + + // Act + json.setOperation(Operation.ADD); + + // Assert + assertEquals(Operation.ADD, json.operation); + } + @Test + public void setRelationshipTest() { + // Arrange + ImmutableEntityRelationshipChangeCommand.Json json = new ImmutableEntityRelationshipChangeCommand.Json(); + + // Act + json.setRelationship(RelationshipKind.HAS); + + // Assert + assertEquals(RelationshipKind.HAS, json.relationship); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipDiffblueTest.java new file mode 100644 index 0000000000..6c356c27ba --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipDiffblueTest.java @@ -0,0 +1,70 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityRelationshipDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityRelationship.Json actualJson = new ImmutableEntityRelationship.Json(); + + // Assert + assertNull(actualJson.relationship); + assertNull(actualJson.b); + assertNull(actualJson.provenance); + assertNull(actualJson.a); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityRelationship.Json json = new ImmutableEntityRelationship.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableEntityRelationship.Json json = new ImmutableEntityRelationship.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityRelationship.Json json = new ImmutableEntityRelationship.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRelationshipTest() { + // Arrange + ImmutableEntityRelationship.Json json = new ImmutableEntityRelationship.Json(); + + // Act + json.setRelationship(RelationshipKind.HAS); + + // Assert + assertEquals(RelationshipKind.HAS, json.relationship); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipKeyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipKeyDiffblueTest.java new file mode 100644 index 0000000000..b878cc2919 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableEntityRelationshipKeyDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableEntityRelationshipKeyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityRelationshipKey.Json actualJson = new ImmutableEntityRelationshipKey.Json(); + + // Assert + assertNull(actualJson.b); + assertNull(actualJson.relationshipKind); + assertNull(actualJson.a); + } + @Test + public void setRelationshipKindTest() { + // Arrange + ImmutableEntityRelationshipKey.Json json = new ImmutableEntityRelationshipKey.Json(); + + // Act + json.setRelationshipKind(RelationshipKind.HAS); + + // Assert + assertEquals(RelationshipKind.HAS, json.relationshipKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableUpdateEntityRelationshipParamsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableUpdateEntityRelationshipParamsDiffblueTest.java new file mode 100644 index 0000000000..f57176ed03 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_relationship/ImmutableUpdateEntityRelationshipParamsDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUpdateEntityRelationshipParamsDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUpdateEntityRelationshipParams.Json actualJson = new ImmutableUpdateEntityRelationshipParams.Json(); + + // Assert + assertNull(actualJson.relationshipKind); + assertNull(actualJson.description); + } + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableUpdateEntityRelationshipParams.Json json = new ImmutableUpdateEntityRelationshipParams.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setRelationshipKindTest() { + // Arrange + ImmutableUpdateEntityRelationshipParams.Json json = new ImmutableUpdateEntityRelationshipParams.Json(); + + // Act + json.setRelationshipKind(RelationshipKind.HAS); + + // Assert + assertEquals(RelationshipKind.HAS, json.relationshipKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_search/ImmutableEntitySearchOptionsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_search/ImmutableEntitySearchOptionsDiffblueTest.java new file mode 100644 index 0000000000..4332973a40 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_search/ImmutableEntitySearchOptionsDiffblueTest.java @@ -0,0 +1,86 @@ +package com.khartec.waltz.model.entity_search; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityLifecycleStatus; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableEntitySearchOptionsDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntitySearchOptions.Json actualJson = new ImmutableEntitySearchOptions.Json(); + + // Assert + List actualEntityKindList = actualJson.entityKinds; + List entityLifecycleStatusList = actualJson.entityLifecycleStatuses; + assertEquals(0, entityLifecycleStatusList.size()); + assertSame(entityLifecycleStatusList, actualEntityKindList); + } + @Test + public void setEntityKindsTest() { + // Arrange + ImmutableEntitySearchOptions.Json json = new ImmutableEntitySearchOptions.Json(); + ArrayList entityKindList = new ArrayList(); + entityKindList.add(EntityKind.ACTOR); + + // Act + json.setEntityKinds(entityKindList); + + // Assert + assertSame(entityKindList, json.entityKinds); + } + @Test + public void setEntityLifecycleStatusesTest() { + // Arrange + ImmutableEntitySearchOptions.Json json = new ImmutableEntitySearchOptions.Json(); + ArrayList entityLifecycleStatusList = new ArrayList(); + entityLifecycleStatusList.add(EntityLifecycleStatus.ACTIVE); + + // Act + json.setEntityLifecycleStatuses(entityLifecycleStatusList); + + // Assert + assertTrue(json.entityLifecycleStatusesIsSet); + assertSame(entityLifecycleStatusList, json.entityLifecycleStatuses); + } + @Test + public void setLimitTest() { + // Arrange + ImmutableEntitySearchOptions.Json json = new ImmutableEntitySearchOptions.Json(); + + // Act + json.setLimit(1); + + // Assert + assertTrue(json.limitIsSet); + assertEquals(1, json.limit); + } + @Test + public void setSearchQueryTest() { + // Arrange + ImmutableEntitySearchOptions.Json json = new ImmutableEntitySearchOptions.Json(); + + // Act + json.setSearchQuery("searchQuery"); + + // Assert + assertEquals("searchQuery", json.searchQuery); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutableEntitySearchOptions.Json json = new ImmutableEntitySearchOptions.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDefinitionDiffblueTest.java new file mode 100644 index 0000000000..3300889040 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDefinitionDiffblueTest.java @@ -0,0 +1,163 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ParentIdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityStatisticDefinitionDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityStatisticDefinition.Json actualJson = new ImmutableEntityStatisticDefinition.Json(); + + // Assert + assertSame(actualJson.id, actualJson.parentId); + } + + + + + + + + @Test + public void setActiveTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setActive(true); + + // Assert + assertTrue(json.active); + assertTrue(json.activeIsSet); + } + + @Test + public void setCategoryTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setCategory(StatisticCategory.COMPLIANCE); + + // Assert + assertEquals(StatisticCategory.COMPLIANCE, json.category); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setEntityVisibilityTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setEntityVisibility(true); + + // Assert + assertEquals(Boolean.valueOf(true), json.entityVisibility); + } + + @Test + public void setHistoricRendererTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setHistoricRenderer("historicRenderer"); + + // Assert + assertEquals("historicRenderer", json.historicRenderer); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setRendererTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setRenderer("renderer"); + + // Assert + assertEquals("renderer", json.renderer); + } + + @Test + public void setRollupKindTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setRollupKind(RollupKind.COUNT_BY_ENTITY); + + // Assert + assertEquals(RollupKind.COUNT_BY_ENTITY, json.rollupKind); + } + + @Test + public void setRollupVisibilityTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setRollupVisibility(true); + + // Assert + assertEquals(Boolean.valueOf(true), json.rollupVisibility); + } + + @Test + public void setTypeTest() { + // Arrange + ImmutableEntityStatisticDefinition.Json json = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setType(StatisticType.BOOLEAN); + + // Assert + assertEquals(StatisticType.BOOLEAN, json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDiffblueTest.java new file mode 100644 index 0000000000..15440c0b2b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticDiffblueTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableEntityStatisticDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityStatistic.Json actualJson = new ImmutableEntityStatistic.Json(); + + // Assert + assertNull(actualJson.value); + assertNull(actualJson.definition); + } + @Test + public void setDefinitionTest() { + // Arrange + ImmutableEntityStatistic.Json json = new ImmutableEntityStatistic.Json(); + ImmutableEntityStatisticDefinition.Json json1 = new ImmutableEntityStatisticDefinition.Json(); + + // Act + json.setDefinition(json1); + + // Assert + assertSame(json1, json.definition); + } + @Test + public void setValueTest() { + // Arrange + ImmutableEntityStatistic.Json json = new ImmutableEntityStatistic.Json(); + ImmutableEntityStatisticValue.Json json1 = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setValue(json1); + + // Assert + assertSame(json1, json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticValueDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticValueDiffblueTest.java new file mode 100644 index 0000000000..4ae7c15c8d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_statistic/ImmutableEntityStatisticValueDiffblueTest.java @@ -0,0 +1,121 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityStatisticValueDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityStatisticValue.Json actualJson = new ImmutableEntityStatisticValue.Json(); + + // Assert + assertNull(actualJson.reason); + assertFalse(actualJson.statisticIdIsSet); + assertNull(actualJson.state); + assertFalse(actualJson.currentIsSet); + assertNull(actualJson.createdAt); + assertEquals(0L, actualJson.statisticId); + assertNull(actualJson.outcome); + assertNull(actualJson.entity); + assertNull(actualJson.value); + assertFalse(actualJson.current); + assertNull(actualJson.provenance); + } + + + + + @Test + public void setCurrentTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setCurrent(true); + + // Assert + assertTrue(json.currentIsSet); + assertTrue(json.current); + } + + @Test + public void setOutcomeTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setOutcome("outcome"); + + // Assert + assertEquals("outcome", json.outcome); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setReasonTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setReason("because"); + + // Assert + assertEquals("because", json.reason); + } + + @Test + public void setStateTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setState(StatisticValueState.EXEMPT); + + // Assert + assertEquals(StatisticValueState.EXEMPT, json.state); + } + + @Test + public void setStatisticIdTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setStatisticId(123L); + + // Assert + assertTrue(json.statisticIdIsSet); + assertEquals(123L, json.statisticId); + } + + @Test + public void setValueTest() { + // Arrange + ImmutableEntityStatisticValue.Json json = new ImmutableEntityStatisticValue.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_svg_diagram/ImmutableEntitySvgDiagramDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_svg_diagram/ImmutableEntitySvgDiagramDiffblueTest.java new file mode 100644 index 0000000000..6f4087e44b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_svg_diagram/ImmutableEntitySvgDiagramDiffblueTest.java @@ -0,0 +1,77 @@ +package com.khartec.waltz.model.entity_svg_diagram; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntitySvgDiagramDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntitySvgDiagram.Json actualJson = new ImmutableEntitySvgDiagram.Json(); + + // Assert + assertSame(actualJson.id, actualJson.externalId); + } + + + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntitySvgDiagram.Json json = new ImmutableEntitySvgDiagram.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableEntitySvgDiagram.Json json = new ImmutableEntitySvgDiagram.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntitySvgDiagram.Json json = new ImmutableEntitySvgDiagram.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setSvgTest() { + // Arrange + ImmutableEntitySvgDiagram.Json json = new ImmutableEntitySvgDiagram.Json(); + + // Act + json.setSvg("svg"); + + // Assert + assertEquals("svg", json.svg); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowDefinitionDiffblueTest.java new file mode 100644 index 0000000000..e44ac2c501 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowDefinitionDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.model.entity_workflow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableEntityWorkflowDefinitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityWorkflowDefinition.Json actualJson = new ImmutableEntityWorkflowDefinition.Json(); + + // Assert + assertNull(actualJson.description); + assertNull(actualJson.name); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityWorkflowDefinition.Json json = new ImmutableEntityWorkflowDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableEntityWorkflowDefinition.Json json = new ImmutableEntityWorkflowDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowStateDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowStateDiffblueTest.java new file mode 100644 index 0000000000..d168a8d89f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowStateDiffblueTest.java @@ -0,0 +1,94 @@ +package com.khartec.waltz.model.entity_workflow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityWorkflowStateDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityWorkflowState.Json actualJson = new ImmutableEntityWorkflowState.Json(); + + // Assert + assertNull(actualJson.entityReference); + assertNull(actualJson.description); + assertNull(actualJson.state); + assertEquals(0L, actualJson.workflowId); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertFalse(actualJson.workflowIdIsSet); + assertNull(actualJson.lastUpdatedAt); + } + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableEntityWorkflowState.Json json = new ImmutableEntityWorkflowState.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableEntityWorkflowState.Json json = new ImmutableEntityWorkflowState.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityWorkflowState.Json json = new ImmutableEntityWorkflowState.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setStateTest() { + // Arrange + ImmutableEntityWorkflowState.Json json = new ImmutableEntityWorkflowState.Json(); + + // Act + json.setState("state"); + + // Assert + assertEquals("state", json.state); + } + + @Test + public void setWorkflowIdTest() { + // Arrange + ImmutableEntityWorkflowState.Json json = new ImmutableEntityWorkflowState.Json(); + + // Act + json.setWorkflowId(123L); + + // Assert + assertEquals(123L, json.workflowId); + assertTrue(json.workflowIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowTransitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowTransitionDiffblueTest.java new file mode 100644 index 0000000000..ceb516ec37 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/entity_workflow/ImmutableEntityWorkflowTransitionDiffblueTest.java @@ -0,0 +1,96 @@ +package com.khartec.waltz.model.entity_workflow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableEntityWorkflowTransitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityWorkflowTransition.Json actualJson = new ImmutableEntityWorkflowTransition.Json(); + + // Assert + assertNull(actualJson.fromState); + assertEquals(0L, actualJson.workflowId); + assertNull(actualJson.lastUpdatedAt); + assertFalse(actualJson.workflowIdIsSet); + assertNull(actualJson.entityReference); + assertNull(actualJson.reason); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertNull(actualJson.toState); + } + @Test + public void setFromStateTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setFromState("fromState"); + + // Assert + assertEquals("fromState", json.fromState); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setReasonTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setReason("because"); + + // Assert + assertEquals("because", json.reason); + } + @Test + public void setToStateTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setToState("toState"); + + // Assert + assertEquals("toState", json.toState); + } + @Test + public void setWorkflowIdTest() { + // Arrange + ImmutableEntityWorkflowTransition.Json json = new ImmutableEntityWorkflowTransition.Json(); + + // Act + json.setWorkflowId(123L); + + // Assert + assertEquals(123L, json.workflowId); + assertTrue(json.workflowIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/enum_value/EnumValueKindDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/enum_value/EnumValueKindDiffblueTest.java new file mode 100644 index 0000000000..a45e3f8fe8 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/enum_value/EnumValueKindDiffblueTest.java @@ -0,0 +1,13 @@ +package com.khartec.waltz.model.enum_value; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class EnumValueKindDiffblueTest { + @Test + public void dbValueTest() { + // Arrange, Act and Assert + assertEquals("TransportKind", EnumValueKind.TRANSPORT_KIND.dbValue()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionDiffblueTest.java new file mode 100644 index 0000000000..b0af3db961 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionDiffblueTest.java @@ -0,0 +1,36 @@ +package com.khartec.waltz.model.exceptions; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class NotAuthorizedExceptionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + NotAuthorizedException actualNotAuthorizedException = new NotAuthorizedException(); + + // Assert + assertEquals("com.khartec.waltz.model.exceptions.NotAuthorize" + "dException: User is not authorized to perform" + + " that action", actualNotAuthorizedException.toString()); + assertEquals("User is not authorized to perform that action", actualNotAuthorizedException.getLocalizedMessage()); + assertNull(actualNotAuthorizedException.getCause()); + assertEquals("User is not authorized to perform that action", actualNotAuthorizedException.getMessage()); + assertEquals(0, actualNotAuthorizedException.getSuppressed().length); + } + + @Test + public void constructorTest2() { + // Arrange and Act + NotAuthorizedException actualNotAuthorizedException = new NotAuthorizedException("An error occurred"); + + // Assert + assertEquals("com.khartec.waltz.model.exceptions.NotAuthorizedException:" + " An error occurred", + actualNotAuthorizedException.toString()); + assertEquals("An error occurred", actualNotAuthorizedException.getLocalizedMessage()); + assertNull(actualNotAuthorizedException.getCause()); + assertEquals("An error occurred", actualNotAuthorizedException.getMessage()); + assertEquals(0, actualNotAuthorizedException.getSuppressed().length); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/external_identifier/ImmutableExternalIdentifierDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/external_identifier/ImmutableExternalIdentifierDiffblueTest.java new file mode 100644 index 0000000000..6ba77816a7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/external_identifier/ImmutableExternalIdentifierDiffblueTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.external_identifier; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.WaltzEntity; +import org.junit.Test; + +public class ImmutableExternalIdentifierDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableExternalIdentifier.Json actualJson = new ImmutableExternalIdentifier.Json(); + + // Assert + assertNull(actualJson.externalId); + assertNull(actualJson.system); + assertNull(actualJson.entityReference); + } + @Test + public void setExternalIdTest() { + // Arrange + ImmutableExternalIdentifier.Json json = new ImmutableExternalIdentifier.Json(); + + // Act + json.setExternalId("123"); + + // Assert + assertEquals("123", json.externalId); + } + @Test + public void setSystemTest() { + // Arrange + ImmutableExternalIdentifier.Json json = new ImmutableExternalIdentifier.Json(); + + // Act + json.setSystem("system"); + + // Assert + assertEquals("system", json.system); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramAnnotationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramAnnotationDiffblueTest.java new file mode 100644 index 0000000000..dba7a405ca --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramAnnotationDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.flow_diagram; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableFlowDiagramAnnotationDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableFlowDiagramAnnotation.Json actualJson = new ImmutableFlowDiagramAnnotation.Json(); + + // Assert + assertNull(actualJson.annotationId); + assertNull(actualJson.entityReference); + assertNull(actualJson.note); + } + + + @Test + public void setAnnotationIdTest() { + // Arrange + ImmutableFlowDiagramAnnotation.Json json = new ImmutableFlowDiagramAnnotation.Json(); + + // Act + json.setAnnotationId("123"); + + // Assert + assertEquals("123", json.annotationId); + } + + @Test + public void setNoteTest() { + // Arrange + ImmutableFlowDiagramAnnotation.Json json = new ImmutableFlowDiagramAnnotation.Json(); + + // Act + json.setNote("note"); + + // Assert + assertEquals("note", json.note); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramDiffblueTest.java new file mode 100644 index 0000000000..4399e5df13 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramDiffblueTest.java @@ -0,0 +1,100 @@ +package com.khartec.waltz.model.flow_diagram; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.IsRemovedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableFlowDiagramDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableFlowDiagram.Json actualJson = new ImmutableFlowDiagram.Json(); + + // Assert + assertNull(actualJson.kind); + assertNull(actualJson.description); + assertNull(actualJson.name); + assertNull(actualJson.layoutData); + assertFalse(actualJson.isRemovedIsSet); + assertFalse(actualJson.isRemoved); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.lastUpdatedAt); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemovedIsSet); + assertTrue(json.isRemoved); + } + @Test + public void setKindTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setLayoutDataTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setLayoutData("layoutData"); + + // Assert + assertEquals("layoutData", json.layoutData); + } + @Test + public void setNameTest() { + // Arrange + ImmutableFlowDiagram.Json json = new ImmutableFlowDiagram.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramEntityDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramEntityDiffblueTest.java new file mode 100644 index 0000000000..029bd4406a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableFlowDiagramEntityDiffblueTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model.flow_diagram; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableFlowDiagramEntityDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableFlowDiagramEntity.Json actualJson = new ImmutableFlowDiagramEntity.Json(); + + // Assert + assertFalse(actualJson.isNotable); + assertNull(actualJson.entityReference); + assertFalse(actualJson.isNotableIsSet); + } + @Test + public void setIsNotableTest() { + // Arrange + ImmutableFlowDiagramEntity.Json json = new ImmutableFlowDiagramEntity.Json(); + + // Act + json.setIsNotable(true); + + // Assert + assertTrue(json.isNotable); + assertTrue(json.isNotableIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableSaveDiagramCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableSaveDiagramCommandDiffblueTest.java new file mode 100644 index 0000000000..70105bed0c --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/flow_diagram/ImmutableSaveDiagramCommandDiffblueTest.java @@ -0,0 +1,83 @@ +package com.khartec.waltz.model.flow_diagram; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableSaveDiagramCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSaveDiagramCommand.Json actualJson = new ImmutableSaveDiagramCommand.Json(); + + // Assert + List actualFlowDiagramAnnotationList = actualJson.annotations; + List flowDiagramEntityList = actualJson.entities; + assertEquals(0, flowDiagramEntityList.size()); + assertSame(flowDiagramEntityList, actualFlowDiagramAnnotationList); + } + @Test + public void setAnnotationsTest() { + // Arrange + ImmutableSaveDiagramCommand.Json json = new ImmutableSaveDiagramCommand.Json(); + ArrayList flowDiagramAnnotationList = new ArrayList(); + flowDiagramAnnotationList.add(new ImmutableFlowDiagramAnnotation.Json()); + + // Act + json.setAnnotations(flowDiagramAnnotationList); + + // Assert + assertSame(flowDiagramAnnotationList, json.annotations); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSaveDiagramCommand.Json json = new ImmutableSaveDiagramCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntitiesTest() { + // Arrange + ImmutableSaveDiagramCommand.Json json = new ImmutableSaveDiagramCommand.Json(); + ArrayList flowDiagramEntityList = new ArrayList(); + flowDiagramEntityList.add(new ImmutableFlowDiagramEntity.Json()); + + // Act + json.setEntities(flowDiagramEntityList); + + // Assert + assertSame(flowDiagramEntityList, json.entities); + } + @Test + public void setLayoutDataTest() { + // Arrange + ImmutableSaveDiagramCommand.Json json = new ImmutableSaveDiagramCommand.Json(); + + // Act + json.setLayoutData("layoutData"); + + // Assert + assertEquals("layoutData", json.layoutData); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSaveDiagramCommand.Json json = new ImmutableSaveDiagramCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/immediate_hierarchy/ImmutableImmediateHierarchyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/immediate_hierarchy/ImmutableImmediateHierarchyDiffblueTest.java new file mode 100644 index 0000000000..f9a680bb58 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/immediate_hierarchy/ImmutableImmediateHierarchyDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model.immediate_hierarchy; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableImmediateHierarchyDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableImmediateHierarchy.Json()).children.size()); + } + @Test + public void setChildrenTest() { + // Arrange + ImmutableImmediateHierarchy.Json json = new ImmutableImmediateHierarchy.Json(); + ArrayList objectList = new ArrayList(); + objectList.add("foo"); + + // Act + json.setChildren(objectList); + + // Assert + assertSame(objectList, json.children); + } + @Test + public void setSelfTest() { + // Arrange + ImmutableImmediateHierarchy.Json json = new ImmutableImmediateHierarchy.Json(); + + // Act + json.setSelf("self"); + + // Assert + assertTrue(json.self instanceof String); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableApplicationInvolvementDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableApplicationInvolvementDiffblueTest.java new file mode 100644 index 0000000000..89e992adc3 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableApplicationInvolvementDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.involvement; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableApplicationInvolvementDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableApplicationInvolvement.Json actualJson = new ImmutableApplicationInvolvement.Json(); + + // Assert + assertNull(actualJson.involvement); + assertNull(actualJson.application); + } + @Test + public void setInvolvementTest() { + // Arrange + ImmutableApplicationInvolvement.Json json = new ImmutableApplicationInvolvement.Json(); + ImmutableInvolvement.Json json1 = new ImmutableInvolvement.Json(); + + // Act + json.setInvolvement(json1); + + // Assert + assertSame(json1, json.involvement); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableEntityInvolvementChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableEntityInvolvementChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..a06f642fb1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableEntityInvolvementChangeCommandDiffblueTest.java @@ -0,0 +1,46 @@ +package com.khartec.waltz.model.involvement; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.Operation; +import org.junit.Test; + +public class ImmutableEntityInvolvementChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableEntityInvolvementChangeCommand.Json actualJson = new ImmutableEntityInvolvementChangeCommand.Json(); + + // Assert + assertNull(actualJson.operation); + assertNull(actualJson.personEntityRef); + assertEquals(0, actualJson.involvementKindId); + assertFalse(actualJson.involvementKindIdIsSet); + } + @Test + public void setInvolvementKindIdTest() { + // Arrange + ImmutableEntityInvolvementChangeCommand.Json json = new ImmutableEntityInvolvementChangeCommand.Json(); + + // Act + json.setInvolvementKindId(123); + + // Assert + assertEquals(123, json.involvementKindId); + assertTrue(json.involvementKindIdIsSet); + } + @Test + public void setOperationTest() { + // Arrange + ImmutableEntityInvolvementChangeCommand.Json json = new ImmutableEntityInvolvementChangeCommand.Json(); + + // Act + json.setOperation(Operation.ADD); + + // Assert + assertEquals(Operation.ADD, json.operation); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableInvolvementDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableInvolvementDiffblueTest.java new file mode 100644 index 0000000000..1d82fb7e14 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement/ImmutableInvolvementDiffblueTest.java @@ -0,0 +1,72 @@ +package com.khartec.waltz.model.involvement; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableInvolvementDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableInvolvement.Json actualJson = new ImmutableInvolvement.Json(); + + // Assert + assertEquals(0L, actualJson.kindId); + assertFalse(actualJson.kindIdIsSet); + assertNull(actualJson.provenance); + assertFalse(actualJson.isReadOnly); + assertNull(actualJson.entityReference); + assertFalse(actualJson.isReadOnlyIsSet); + assertNull(actualJson.employeeId); + } + @Test + public void setEmployeeIdTest() { + // Arrange + ImmutableInvolvement.Json json = new ImmutableInvolvement.Json(); + + // Act + json.setEmployeeId("123"); + + // Assert + assertEquals("123", json.employeeId); + } + @Test + public void setIsReadOnlyTest() { + // Arrange + ImmutableInvolvement.Json json = new ImmutableInvolvement.Json(); + + // Act + json.setIsReadOnly(true); + + // Assert + assertTrue(json.isReadOnly); + assertTrue(json.isReadOnlyIsSet); + } + @Test + public void setKindIdTest() { + // Arrange + ImmutableInvolvement.Json json = new ImmutableInvolvement.Json(); + + // Act + json.setKindId(123L); + + // Assert + assertEquals(123L, json.kindId); + assertTrue(json.kindIdIsSet); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableInvolvement.Json json = new ImmutableInvolvement.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..40f9441502 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindChangeCommandDiffblueTest.java @@ -0,0 +1,36 @@ +package com.khartec.waltz.model.involvement_kind; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.command.EntityChangeCommand; +import com.khartec.waltz.model.command.FieldChange; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableInvolvementKindChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableInvolvementKindChangeCommand.Json actualJson = new ImmutableInvolvementKindChangeCommand.Json(); + + // Assert + Optional> optional = actualJson.description; + assertSame(actualJson.lastUpdate, optional); + assertSame(optional, actualJson.name); + assertSame(optional, actualJson.lastUpdate); + } + @Test + public void setIdTest() { + // Arrange + ImmutableInvolvementKindChangeCommand.Json json = new ImmutableInvolvementKindChangeCommand.Json(); + + // Act + json.setId(123L); + + // Assert + assertTrue(json.idIsSet); + assertEquals(123L, json.id); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..26dc948c1e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindCreateCommandDiffblueTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.involvement_kind; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableInvolvementKindCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableInvolvementKindCreateCommand.Json actualJson = new ImmutableInvolvementKindCreateCommand.Json(); + + // Assert + assertNull(actualJson.name); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableInvolvementKindCreateCommand.Json json = new ImmutableInvolvementKindCreateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableInvolvementKindCreateCommand.Json json = new ImmutableInvolvementKindCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindDiffblueTest.java new file mode 100644 index 0000000000..921a246088 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/involvement_kind/ImmutableInvolvementKindDiffblueTest.java @@ -0,0 +1,66 @@ +package com.khartec.waltz.model.involvement_kind; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableInvolvementKindDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableInvolvementKind.Json actualJson = new ImmutableInvolvementKind.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.description); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.name); + } + + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableInvolvementKind.Json json = new ImmutableInvolvementKind.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableInvolvementKind.Json json = new ImmutableInvolvementKind.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableInvolvementKind.Json json = new ImmutableInvolvementKind.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/licence/ImmutableLicenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/licence/ImmutableLicenceDiffblueTest.java new file mode 100644 index 0000000000..d18324f396 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/licence/ImmutableLicenceDiffblueTest.java @@ -0,0 +1,88 @@ +package com.khartec.waltz.model.licence; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.ApprovalStatus; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedUserTimestampProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.UserTimestamp; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableLicenceDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLicence.Json actualJson = new ImmutableLicence.Json(); + + // Assert + Optional optional = actualJson.created; + assertSame(actualJson.id, optional); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.lastUpdated); + assertSame(optional, actualJson.externalId); + } + + + + + + + + + + @Test + public void setApprovalStatusTest() { + // Arrange + ImmutableLicence.Json json = new ImmutableLicence.Json(); + + // Act + json.setApprovalStatus(ApprovalStatus.PENDING_APPROVAL); + + // Assert + assertEquals(ApprovalStatus.PENDING_APPROVAL, json.approvalStatus); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableLicence.Json json = new ImmutableLicence.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableLicence.Json json = new ImmutableLicence.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableLicence.Json json = new ImmutableLicence.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..f20daba843 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementChangeCommandDiffblueTest.java @@ -0,0 +1,66 @@ +package com.khartec.waltz.model.logical_data_element; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityReference; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableLogicalDataElementChangeCommandDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("LogicalDataElementChangeCommand{}", + ImmutableLogicalDataElementChangeCommand.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange, Act and Assert + Optional optional = (new ImmutableLogicalDataElementChangeCommand.Json()).newLogicalDataElement; + assertEquals("Optional.empty", optional.toString()); + assertFalse(optional.isPresent()); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableLogicalDataElementChangeCommand.fromJson(new ImmutableLogicalDataElementChangeCommand.Json()) + .equals("LogicalDataElementChangeCommand{")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("LogicalDataElementChangeCommand{}", ImmutableLogicalDataElementChangeCommand + .fromJson(new ImmutableLogicalDataElementChangeCommand.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(177573, ImmutableLogicalDataElementChangeCommand + .fromJson(new ImmutableLogicalDataElementChangeCommand.Json()).hashCode()); + } + + @Test + public void newLogicalDataElementTest() { + // Arrange + ImmutableLogicalDataElementChangeCommand.Json json = new ImmutableLogicalDataElementChangeCommand.Json(); + + // Act and Assert + assertSame(json.newLogicalDataElement, + ImmutableLogicalDataElementChangeCommand.fromJson(json).newLogicalDataElement()); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("LogicalDataElementChangeCommand{}", ImmutableLogicalDataElementChangeCommand + .fromJson(new ImmutableLogicalDataElementChangeCommand.Json()).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementDiffblueTest.java new file mode 100644 index 0000000000..ddb2d356f8 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_data_element/ImmutableLogicalDataElementDiffblueTest.java @@ -0,0 +1,106 @@ +package com.khartec.waltz.model.logical_data_element; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.FieldDataType; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableLogicalDataElementDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLogicalDataElement.Json actualJson = new ImmutableLogicalDataElement.Json(); + + // Assert + assertSame(actualJson.id, actualJson.externalId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setKindTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setParentDataTypeIdTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setParentDataTypeId(123L); + + // Assert + assertEquals(123L, json.parentDataTypeId); + assertTrue(json.parentDataTypeIdIsSet); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setTypeTest() { + // Arrange + ImmutableLogicalDataElement.Json json = new ImmutableLogicalDataElement.Json(); + + // Act + json.setType(FieldDataType.DATE); + + // Assert + assertEquals(FieldDataType.DATE, json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableAddLogicalFlowCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableAddLogicalFlowCommandDiffblueTest.java new file mode 100644 index 0000000000..b80958fd36 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableAddLogicalFlowCommandDiffblueTest.java @@ -0,0 +1,19 @@ +package com.khartec.waltz.model.logical_flow; + +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableAddLogicalFlowCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAddLogicalFlowCommand.Json actualJson = new ImmutableAddLogicalFlowCommand.Json(); + + // Assert + assertNull(actualJson.target); + assertNull(actualJson.source); + } + +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowDiffblueTest.java new file mode 100644 index 0000000000..22da8a941e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowDiffblueTest.java @@ -0,0 +1,63 @@ +package com.khartec.waltz.model.logical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastAttestedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.UserTimestamp; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableLogicalFlowDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLogicalFlow.Json actualJson = new ImmutableLogicalFlow.Json(); + + // Assert + Optional optional = actualJson.created; + assertSame(actualJson.lastAttestedBy, optional); + assertSame(optional, actualJson.lastAttestedBy); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.lastAttestedAt); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableLogicalFlow.Json json = new ImmutableLogicalFlow.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableLogicalFlow.Json json = new ImmutableLogicalFlow.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableLogicalFlow.Json json = new ImmutableLogicalFlow.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowMeasuresDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowMeasuresDiffblueTest.java new file mode 100644 index 0000000000..034e708983 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowMeasuresDiffblueTest.java @@ -0,0 +1,64 @@ +package com.khartec.waltz.model.logical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableLogicalFlowMeasuresDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLogicalFlowMeasures.Json actualJson = new ImmutableLogicalFlowMeasures.Json(); + + // Assert + assertFalse(actualJson.inboundIsSet); + assertEquals(0.0, actualJson.intra, 0.0); + assertEquals(0.0, actualJson.inbound, 0.0); + assertEquals(0.0, actualJson.outbound, 0.0); + assertFalse(actualJson.outboundIsSet); + assertFalse(actualJson.intraIsSet); + } + + + @Test + public void setInboundTest() { + // Arrange + ImmutableLogicalFlowMeasures.Json json = new ImmutableLogicalFlowMeasures.Json(); + + // Act + json.setInbound(10.0); + + // Assert + assertTrue(json.inboundIsSet); + assertEquals(10.0, json.inbound, 0.0); + } + + @Test + public void setIntraTest() { + // Arrange + ImmutableLogicalFlowMeasures.Json json = new ImmutableLogicalFlowMeasures.Json(); + + // Act + json.setIntra(10.0); + + // Assert + assertEquals(10.0, json.intra, 0.0); + assertTrue(json.intraIsSet); + } + + @Test + public void setOutboundTest() { + // Arrange + ImmutableLogicalFlowMeasures.Json json = new ImmutableLogicalFlowMeasures.Json(); + + // Act + json.setOutbound(10.0); + + // Assert + assertEquals(10.0, json.outbound, 0.0); + assertTrue(json.outboundIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowStatisticsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowStatisticsDiffblueTest.java new file mode 100644 index 0000000000..59dd924d57 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/logical_flow/ImmutableLogicalFlowStatisticsDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model.logical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.tally.TallyPack; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableLogicalFlowStatisticsDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableLogicalFlowStatistics.Json()).dataTypeCounts.size()); + } + @Test + public void setAppCountsTest() { + // Arrange + ImmutableLogicalFlowStatistics.Json json = new ImmutableLogicalFlowStatistics.Json(); + ImmutableLogicalFlowMeasures.Json json1 = new ImmutableLogicalFlowMeasures.Json(); + + // Act + json.setAppCounts(json1); + + // Assert + assertSame(json1, json.appCounts); + } + @Test + public void setDataTypeCountsTest() { + // Arrange + ImmutableLogicalFlowStatistics.Json json = new ImmutableLogicalFlowStatistics.Json(); + ArrayList> tallyPackList = new ArrayList>(); + + // Act + json.setDataTypeCounts(tallyPackList); + + // Assert + assertSame(tallyPackList, json.dataTypeCounts); + } + @Test + public void setFlowCountsTest() { + // Arrange + ImmutableLogicalFlowStatistics.Json json = new ImmutableLogicalFlowStatistics.Json(); + ImmutableLogicalFlowMeasures.Json json1 = new ImmutableLogicalFlowMeasures.Json(); + + // Act + json.setFlowCounts(json1); + + // Assert + assertSame(json1, json.flowCounts); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable/ImmutableMeasurableDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable/ImmutableMeasurableDiffblueTest.java new file mode 100644 index 0000000000..1630d372c5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable/ImmutableMeasurableDiffblueTest.java @@ -0,0 +1,124 @@ +package com.khartec.waltz.model.measurable; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.ExternalParentIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ParentIdProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableMeasurableDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurable.Json actualJson = new ImmutableMeasurable.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(optional, actualJson.externalId); + assertSame(optional, actualJson.externalParentId); + assertSame(optional, actualJson.parentId); + } + @Test + public void setCategoryIdTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setCategoryId(123L); + + // Assert + assertTrue(json.categoryIdIsSet); + assertEquals(123L, json.categoryId); + } + @Test + public void setConcreteTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setConcrete(true); + + // Assert + assertTrue(json.concreteIsSet); + assertTrue(json.concrete); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setKindTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableMeasurable.Json json = new ImmutableMeasurable.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_category/ImmutableMeasurableCategoryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_category/ImmutableMeasurableCategoryDiffblueTest.java new file mode 100644 index 0000000000..6cdd2ede3b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_category/ImmutableMeasurableCategoryDiffblueTest.java @@ -0,0 +1,110 @@ +package com.khartec.waltz.model.measurable_category; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.RagNamesProvider; +import com.khartec.waltz.model.rating.RagName; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableMeasurableCategoryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableCategory.Json actualJson = new ImmutableMeasurableCategory.Json(); + + // Assert + assertSame(actualJson.externalId, actualJson.id); + assertEquals(0, actualJson.ragNames.size()); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEditableTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setEditable(true); + + // Assert + assertTrue(json.editable); + assertTrue(json.editableIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setRagNamesTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + ArrayList ragNameList = new ArrayList(); + ragNameList.add(null); + + // Act + json.setRagNames(ragNameList); + + // Assert + assertSame(ragNameList, json.ragNames); + } + @Test + public void setRatingSchemeIdTest() { + // Arrange + ImmutableMeasurableCategory.Json json = new ImmutableMeasurableCategory.Json(); + + // Act + json.setRatingSchemeId(123L); + + // Assert + assertEquals(123L, json.ratingSchemeId); + assertTrue(json.ratingSchemeIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableMeasurableRatingDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableMeasurableRatingDiffblueTest.java new file mode 100644 index 0000000000..30f5d2425a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableMeasurableRatingDiffblueTest.java @@ -0,0 +1,97 @@ +package com.khartec.waltz.model.measurable_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableMeasurableRatingDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableRating.Json actualJson = new ImmutableMeasurableRating.Json(); + + // Assert + assertEquals('\u0000', actualJson.rating); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityReference); + assertEquals(0L, actualJson.measurableId); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertFalse(actualJson.ratingIsSet); + assertFalse(actualJson.measurableIdIsSet); + assertNull(actualJson.description); + } + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableMeasurableRating.Json json = new ImmutableMeasurableRating.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurableRating.Json json = new ImmutableMeasurableRating.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableMeasurableRating.Json json = new ImmutableMeasurableRating.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertEquals(123L, json.measurableId); + assertTrue(json.measurableIdIsSet); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableMeasurableRating.Json json = new ImmutableMeasurableRating.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setRatingTest() { + // Arrange + ImmutableMeasurableRating.Json json = new ImmutableMeasurableRating.Json(); + + // Act + json.setRating('A'); + + // Assert + assertEquals('A', json.rating); + assertTrue(json.ratingIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableRemoveMeasurableRatingCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableRemoveMeasurableRatingCommandDiffblueTest.java new file mode 100644 index 0000000000..5670ac2e7f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableRemoveMeasurableRatingCommandDiffblueTest.java @@ -0,0 +1,34 @@ +package com.khartec.waltz.model.measurable_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableRemoveMeasurableRatingCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRemoveMeasurableRatingCommand.Json actualJson = new ImmutableRemoveMeasurableRatingCommand.Json(); + + // Assert + assertFalse(actualJson.measurableIdIsSet); + assertNull(actualJson.entityReference); + assertNull(actualJson.lastUpdate); + assertEquals(0L, actualJson.measurableId); + } + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableRemoveMeasurableRatingCommand.Json json = new ImmutableRemoveMeasurableRatingCommand.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertTrue(json.measurableIdIsSet); + assertEquals(123L, json.measurableId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableSaveMeasurableRatingCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableSaveMeasurableRatingCommandDiffblueTest.java new file mode 100644 index 0000000000..6cc77e975d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating/ImmutableSaveMeasurableRatingCommandDiffblueTest.java @@ -0,0 +1,83 @@ +package com.khartec.waltz.model.measurable_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableSaveMeasurableRatingCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSaveMeasurableRatingCommand.Json actualJson = new ImmutableSaveMeasurableRatingCommand.Json(); + + // Assert + assertNull(actualJson.provenance); + assertFalse(actualJson.ratingIsSet); + assertFalse(actualJson.measurableIdIsSet); + assertNull(actualJson.description); + assertEquals('\u0000', actualJson.rating); + assertNull(actualJson.lastUpdate); + assertNull(actualJson.entityReference); + assertEquals(0L, actualJson.measurableId); + } + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSaveMeasurableRatingCommand.Json json = new ImmutableSaveMeasurableRatingCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableSaveMeasurableRatingCommand.Json json = new ImmutableSaveMeasurableRatingCommand.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertTrue(json.measurableIdIsSet); + assertEquals(123L, json.measurableId); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSaveMeasurableRatingCommand.Json json = new ImmutableSaveMeasurableRatingCommand.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setRatingTest() { + // Arrange + ImmutableSaveMeasurableRatingCommand.Json json = new ImmutableSaveMeasurableRatingCommand.Json(); + + // Act + json.setRating('A'); + + // Assert + assertTrue(json.ratingIsSet); + assertEquals('A', json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_planned_decommission/ImmutableMeasurableRatingPlannedDecommissionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_planned_decommission/ImmutableMeasurableRatingPlannedDecommissionDiffblueTest.java new file mode 100644 index 0000000000..2663ea0ec1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_planned_decommission/ImmutableMeasurableRatingPlannedDecommissionDiffblueTest.java @@ -0,0 +1,70 @@ +package com.khartec.waltz.model.measurable_rating_planned_decommission; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.CreatedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import org.junit.Test; + +public class ImmutableMeasurableRatingPlannedDecommissionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableRatingPlannedDecommission.Json actualJson = new ImmutableMeasurableRatingPlannedDecommission.Json(); + + // Assert + assertNull(actualJson.id); + assertNull(actualJson.plannedDecommissionDate); + assertNull(actualJson.measurableId); + assertNull(actualJson.createdAt); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.createdBy); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityReference); + } + @Test + public void setCreatedByTest() { + // Arrange + ImmutableMeasurableRatingPlannedDecommission.Json json = new ImmutableMeasurableRatingPlannedDecommission.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + @Test + public void setIdTest() { + // Arrange + ImmutableMeasurableRatingPlannedDecommission.Json json = new ImmutableMeasurableRatingPlannedDecommission.Json(); + + // Act + json.setId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.id); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurableRatingPlannedDecommission.Json json = new ImmutableMeasurableRatingPlannedDecommission.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setMeasurableIdTest() { + // Arrange + ImmutableMeasurableRatingPlannedDecommission.Json json = new ImmutableMeasurableRatingPlannedDecommission.Json(); + + // Act + json.setMeasurableId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.measurableId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_replacement/ImmutableMeasurableRatingReplacementDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_replacement/ImmutableMeasurableRatingReplacementDiffblueTest.java new file mode 100644 index 0000000000..1516a314f1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_rating_replacement/ImmutableMeasurableRatingReplacementDiffblueTest.java @@ -0,0 +1,70 @@ +package com.khartec.waltz.model.measurable_rating_replacement; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.CreatedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import org.junit.Test; + +public class ImmutableMeasurableRatingReplacementDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableRatingReplacement.Json actualJson = new ImmutableMeasurableRatingReplacement.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.id); + assertNull(actualJson.decommissionId); + assertNull(actualJson.createdAt); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.entityReference); + assertNull(actualJson.plannedCommissionDate); + assertNull(actualJson.createdBy); + } + @Test + public void setCreatedByTest() { + // Arrange + ImmutableMeasurableRatingReplacement.Json json = new ImmutableMeasurableRatingReplacement.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + @Test + public void setDecommissionIdTest() { + // Arrange + ImmutableMeasurableRatingReplacement.Json json = new ImmutableMeasurableRatingReplacement.Json(); + + // Act + json.setDecommissionId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.decommissionId); + } + @Test + public void setIdTest() { + // Arrange + ImmutableMeasurableRatingReplacement.Json json = new ImmutableMeasurableRatingReplacement.Json(); + + // Act + json.setId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.id); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurableRatingReplacement.Json json = new ImmutableMeasurableRatingReplacement.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_relationship/ImmutableMeasurableRelationshipDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_relationship/ImmutableMeasurableRelationshipDiffblueTest.java new file mode 100644 index 0000000000..f940f95b77 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/measurable_relationship/ImmutableMeasurableRelationshipDiffblueTest.java @@ -0,0 +1,98 @@ +package com.khartec.waltz.model.measurable_relationship; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableMeasurableRelationshipDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableRelationship.Json actualJson = new ImmutableMeasurableRelationship.Json(); + + // Assert + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.relationshipKind); + assertFalse(actualJson.measurableBIsSet); + assertNull(actualJson.description); + assertEquals(0L, actualJson.measurableB); + assertEquals(0L, actualJson.measurableA); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.provenance); + assertFalse(actualJson.measurableAIsSet); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setMeasurableATest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setMeasurableA(1L); + + // Assert + assertEquals(1L, json.measurableA); + assertTrue(json.measurableAIsSet); + } + @Test + public void setMeasurableBTest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setMeasurableB(1L); + + // Assert + assertTrue(json.measurableBIsSet); + assertEquals(1L, json.measurableB); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setRelationshipKindTest() { + // Arrange + ImmutableMeasurableRelationship.Json json = new ImmutableMeasurableRelationship.Json(); + + // Act + json.setRelationshipKind(MeasurableRelationshipKind.WEAKLY_RELATES_TO); + + // Assert + assertEquals(MeasurableRelationshipKind.WEAKLY_RELATES_TO, json.relationshipKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/notification/ImmutableNotificationSummaryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/notification/ImmutableNotificationSummaryDiffblueTest.java new file mode 100644 index 0000000000..a460116c42 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/notification/ImmutableNotificationSummaryDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.notification; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import org.junit.Test; + +public class ImmutableNotificationSummaryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableNotificationSummary.Json actualJson = new ImmutableNotificationSummary.Json(); + + // Assert + assertNull(actualJson.kind); + assertEquals(0, actualJson.count); + assertFalse(actualJson.countIsSet); + } + @Test + public void setCountTest() { + // Arrange + ImmutableNotificationSummary.Json json = new ImmutableNotificationSummary.Json(); + + // Act + json.setCount(3); + + // Assert + assertEquals(3, json.count); + assertTrue(json.countIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableNotificationSummary.Json json = new ImmutableNotificationSummary.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitDiffblueTest.java new file mode 100644 index 0000000000..d96407a8b7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitDiffblueTest.java @@ -0,0 +1,56 @@ +package com.khartec.waltz.model.orgunit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ParentIdProvider; +import org.junit.Test; + +public class ImmutableOrganisationalUnitDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableOrganisationalUnit.Json actualJson = new ImmutableOrganisationalUnit.Json(); + + // Assert + assertSame(actualJson.parentId, actualJson.id); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableOrganisationalUnit.Json json = new ImmutableOrganisationalUnit.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setKindTest() { + // Arrange + ImmutableOrganisationalUnit.Json json = new ImmutableOrganisationalUnit.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableOrganisationalUnit.Json json = new ImmutableOrganisationalUnit.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitHierarchyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitHierarchyDiffblueTest.java new file mode 100644 index 0000000000..5e06cb7da9 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/orgunit/ImmutableOrganisationalUnitHierarchyDiffblueTest.java @@ -0,0 +1,60 @@ +package com.khartec.waltz.model.orgunit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableOrganisationalUnitHierarchyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableOrganisationalUnitHierarchy.Json actualJson = new ImmutableOrganisationalUnitHierarchy.Json(); + + // Assert + List organisationalUnitList = actualJson.children; + List actualOrganisationalUnitList = actualJson.parents; + assertEquals(0, organisationalUnitList.size()); + assertSame(organisationalUnitList, actualOrganisationalUnitList); + } + @Test + public void setChildrenTest() { + // Arrange + ImmutableOrganisationalUnitHierarchy.Json json = new ImmutableOrganisationalUnitHierarchy.Json(); + ArrayList organisationalUnitList = new ArrayList(); + organisationalUnitList.add(new ImmutableOrganisationalUnit.Json()); + + // Act + json.setChildren(organisationalUnitList); + + // Assert + assertSame(organisationalUnitList, json.children); + } + @Test + public void setParentsTest() { + // Arrange + ImmutableOrganisationalUnitHierarchy.Json json = new ImmutableOrganisationalUnitHierarchy.Json(); + ArrayList organisationalUnitList = new ArrayList(); + organisationalUnitList.add(new ImmutableOrganisationalUnit.Json()); + + // Act + json.setParents(organisationalUnitList); + + // Assert + assertSame(organisationalUnitList, json.parents); + } + @Test + public void setUnitTest() { + // Arrange + ImmutableOrganisationalUnitHierarchy.Json json = new ImmutableOrganisationalUnitHierarchy.Json(); + ImmutableOrganisationalUnit.Json json1 = new ImmutableOrganisationalUnit.Json(); + + // Act + json.setUnit(json1); + + // Assert + assertSame(json1, json.unit); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/orphan/ImmutableOrphanRelationshipDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/orphan/ImmutableOrphanRelationshipDiffblueTest.java new file mode 100644 index 0000000000..3bae0b29d5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/orphan/ImmutableOrphanRelationshipDiffblueTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.orphan; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableOrphanRelationshipDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableOrphanRelationship.Json actualJson = new ImmutableOrphanRelationship.Json(); + + // Assert + assertNull(actualJson.entityB); + assertNull(actualJson.orphanSide); + assertNull(actualJson.entityA); + } + @Test + public void setOrphanSideTest() { + // Arrange + ImmutableOrphanRelationship.Json json = new ImmutableOrphanRelationship.Json(); + + // Act + json.setOrphanSide(OrphanSide.A); + + // Assert + assertEquals(OrphanSide.A, json.orphanSide); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/ImmutablePerformanceMetricDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/ImmutablePerformanceMetricDefinitionDiffblueTest.java new file mode 100644 index 0000000000..7d408e574d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/ImmutablePerformanceMetricDefinitionDiffblueTest.java @@ -0,0 +1,67 @@ +package com.khartec.waltz.model.performance_metric; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutablePerformanceMetricDefinitionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePerformanceMetricDefinition.Json actualJson = new ImmutablePerformanceMetricDefinition.Json(); + + // Assert + assertNull(actualJson.categoryName); + assertNull(actualJson.name); + assertNull(actualJson.categoryDescription); + assertNull(actualJson.description); + } + @Test + public void setCategoryDescriptionTest() { + // Arrange + ImmutablePerformanceMetricDefinition.Json json = new ImmutablePerformanceMetricDefinition.Json(); + + // Act + json.setCategoryDescription("categoryDescription"); + + // Assert + assertEquals("categoryDescription", json.categoryDescription); + } + @Test + public void setCategoryNameTest() { + // Arrange + ImmutablePerformanceMetricDefinition.Json json = new ImmutablePerformanceMetricDefinition.Json(); + + // Act + json.setCategoryName("categoryName"); + + // Assert + assertEquals("categoryName", json.categoryName); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePerformanceMetricDefinition.Json json = new ImmutablePerformanceMetricDefinition.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePerformanceMetricDefinition.Json json = new ImmutablePerformanceMetricDefinition.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackDiffblueTest.java new file mode 100644 index 0000000000..39f71b0845 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackDiffblueTest.java @@ -0,0 +1,90 @@ +package com.khartec.waltz.model.performance_metric.pack; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityReference; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.checkpoint.Checkpoint; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableMetricPackDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMetricPack.Json actualJson = new ImmutableMetricPack.Json(); + + // Assert + List actualCheckpointList = actualJson.checkpoints; + List actualMetricPackItemList = actualJson.items; + List entityReferenceList = actualJson.relatedReferences; + assertEquals(0, entityReferenceList.size()); + assertSame(entityReferenceList, actualCheckpointList); + assertSame(entityReferenceList, actualMetricPackItemList); + } + @Test + public void setCheckpointsTest() { + // Arrange + ImmutableMetricPack.Json json = new ImmutableMetricPack.Json(); + ArrayList checkpointList = new ArrayList(); + checkpointList.add(null); + + // Act + json.setCheckpoints(checkpointList); + + // Assert + assertSame(checkpointList, json.checkpoints); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableMetricPack.Json json = new ImmutableMetricPack.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setItemsTest() { + // Arrange + ImmutableMetricPack.Json json = new ImmutableMetricPack.Json(); + ArrayList metricPackItemList = new ArrayList(); + metricPackItemList.add(new ImmutableMetricPackItem.Json()); + + // Act + json.setItems(metricPackItemList); + + // Assert + assertSame(metricPackItemList, json.items); + } + @Test + public void setNameTest() { + // Arrange + ImmutableMetricPack.Json json = new ImmutableMetricPack.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setRelatedReferencesTest() { + // Arrange + ImmutableMetricPack.Json json = new ImmutableMetricPack.Json(); + ArrayList entityReferenceList = new ArrayList(); + entityReferenceList.add(null); + + // Act + json.setRelatedReferences(entityReferenceList); + + // Assert + assertSame(entityReferenceList, json.relatedReferences); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackItemDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackItemDiffblueTest.java new file mode 100644 index 0000000000..d1d210752b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/pack/ImmutableMetricPackItemDiffblueTest.java @@ -0,0 +1,65 @@ +package com.khartec.waltz.model.performance_metric.pack; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.checkpoint.CheckpointGoal; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableMetricPackItemDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableMetricPackItem.Json()).goals.size()); + } + @Test + public void setBaseLineTest() { + // Arrange + ImmutableMetricPackItem.Json json = new ImmutableMetricPackItem.Json(); + + // Act + json.setBaseLine(10.0); + + // Assert + assertTrue(json.baseLineIsSet); + assertEquals(10.0, json.baseLine, 0.0); + } + @Test + public void setDefinitionIdTest() { + // Arrange + ImmutableMetricPackItem.Json json = new ImmutableMetricPackItem.Json(); + + // Act + json.setDefinitionId(123L); + + // Assert + assertTrue(json.definitionIdIsSet); + assertEquals(123L, json.definitionId); + } + @Test + public void setGoalsTest() { + // Arrange + ImmutableMetricPackItem.Json json = new ImmutableMetricPackItem.Json(); + ArrayList checkpointGoalList = new ArrayList(); + checkpointGoalList.add(null); + + // Act + json.setGoals(checkpointGoalList); + + // Assert + assertSame(checkpointGoalList, json.goals); + } + @Test + public void setSectionNameTest() { + // Arrange + ImmutableMetricPackItem.Json json = new ImmutableMetricPackItem.Json(); + + // Act + json.setSectionName("sectionName"); + + // Assert + assertEquals("sectionName", json.sectionName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/sample/ImmutableMetricSampleDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/sample/ImmutableMetricSampleDiffblueTest.java new file mode 100644 index 0000000000..f748cd1709 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/performance_metric/sample/ImmutableMetricSampleDiffblueTest.java @@ -0,0 +1,76 @@ +package com.khartec.waltz.model.performance_metric.sample; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableMetricSampleDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMetricSample.Json actualJson = new ImmutableMetricSample.Json(); + + // Assert + assertNull(actualJson.effectiveDate); + assertEquals(0L, actualJson.metricId); + assertNull(actualJson.createdBy); + assertNull(actualJson.provenance); + assertNull(actualJson.sampleType); + assertFalse(actualJson.metricIdIsSet); + assertNull(actualJson.collectionDate); + } + + + @Test + public void setCreatedByTest() { + // Arrange + ImmutableMetricSample.Json json = new ImmutableMetricSample.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + + @Test + public void setMetricIdTest() { + // Arrange + ImmutableMetricSample.Json json = new ImmutableMetricSample.Json(); + + // Act + json.setMetricId(123L); + + // Assert + assertEquals(123L, json.metricId); + assertTrue(json.metricIdIsSet); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableMetricSample.Json json = new ImmutableMetricSample.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setSampleTypeTest() { + // Arrange + ImmutableMetricSample.Json json = new ImmutableMetricSample.Json(); + + // Act + json.setSampleType(SampleType.MANUAL); + + // Assert + assertEquals(SampleType.MANUAL, json.sampleType); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/person/ImmutablePersonDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/person/ImmutablePersonDiffblueTest.java new file mode 100644 index 0000000000..36099cbbd1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/person/ImmutablePersonDiffblueTest.java @@ -0,0 +1,107 @@ +package com.khartec.waltz.model.person; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.IdProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutablePersonDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePerson.Json actualJson = new ImmutablePerson.Json(); + + // Assert + Optional optional = actualJson.officePhone; + assertSame(optional, actualJson.mobilePhone); + assertSame(optional, actualJson.title); + assertSame(optional, actualJson.departmentName); + assertSame(optional, actualJson.managerEmployeeId); + assertSame(optional, actualJson.organisationalUnitId); + assertSame(optional, actualJson.userPrincipalName); + assertSame(optional, actualJson.id); + } + @Test + public void setDisplayNameTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setDisplayName("displayName"); + + // Assert + assertEquals("displayName", json.displayName); + } + @Test + public void setEmailTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setEmail("email"); + + // Assert + assertEquals("email", json.email); + } + @Test + public void setEmployeeIdTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setEmployeeId("123"); + + // Assert + assertEquals("123", json.employeeId); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemoved); + assertTrue(json.isRemovedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setPersonKindTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setPersonKind(PersonKind.EMPLOYEE); + + // Assert + assertEquals(PersonKind.EMPLOYEE, json.personKind); + } + @Test + public void setUserIdTest() { + // Arrange + ImmutablePerson.Json json = new ImmutablePerson.Json(); + + // Act + json.setUserId("123"); + + // Assert + assertEquals("123", json.userId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutableFlowAttributesDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutableFlowAttributesDiffblueTest.java new file mode 100644 index 0000000000..3a45855a2e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutableFlowAttributesDiffblueTest.java @@ -0,0 +1,90 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.DescriptionProvider; +import org.junit.Test; + +public class ImmutableFlowAttributesDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableFlowAttributes.Json actualJson = new ImmutableFlowAttributes.Json(); + + // Assert + assertEquals(0, actualJson.basisOffset); + assertNull(actualJson.criticality); + assertNull(actualJson.description); + assertNull(actualJson.transport); + assertFalse(actualJson.basisOffsetIsSet); + assertNull(actualJson.frequency); + } + + + + @Test + public void setBasisOffsetTest() { + // Arrange + ImmutableFlowAttributes.Json json = new ImmutableFlowAttributes.Json(); + + // Act + json.setBasisOffset(1); + + // Assert + assertEquals(1, json.basisOffset); + assertTrue(json.basisOffsetIsSet); + } + + @Test + public void setCriticalityTest() { + // Arrange + ImmutableFlowAttributes.Json json = new ImmutableFlowAttributes.Json(); + + // Act + json.setCriticality(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.criticality); + } + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableFlowAttributes.Json json = new ImmutableFlowAttributes.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setFrequencyTest() { + // Arrange + ImmutableFlowAttributes.Json json = new ImmutableFlowAttributes.Json(); + + // Act + json.setFrequency(FrequencyKind.ON_DEMAND); + + // Assert + assertEquals(FrequencyKind.ON_DEMAND, json.frequency); + } + + @Test + public void setTransportTest() { + // Arrange + ImmutableFlowAttributes.Json json = new ImmutableFlowAttributes.Json(); + + // Act + json.setTransport("transport"); + + // Assert + assertEquals("transport", json.transport); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..2ac6e5dd07 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutablePhysicalFlowCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowCreateCommand.Json actualJson = new ImmutablePhysicalFlowCreateCommand.Json(); + + // Assert + assertNull(actualJson.specification); + assertFalse(actualJson.logicalFlowIdIsSet); + assertEquals(0L, actualJson.logicalFlowId); + assertNull(actualJson.flowAttributes); + } + @Test + public void setFlowAttributesTest() { + // Arrange + ImmutablePhysicalFlowCreateCommand.Json json = new ImmutablePhysicalFlowCreateCommand.Json(); + ImmutableFlowAttributes.Json json1 = new ImmutableFlowAttributes.Json(); + + // Act + json.setFlowAttributes(json1); + + // Assert + assertSame(json1, json.flowAttributes); + } + @Test + public void setLogicalFlowIdTest() { + // Arrange + ImmutablePhysicalFlowCreateCommand.Json json = new ImmutablePhysicalFlowCreateCommand.Json(); + + // Act + json.setLogicalFlowId(123L); + + // Assert + assertTrue(json.logicalFlowIdIsSet); + assertEquals(123L, json.logicalFlowId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandResponseDiffblueTest.java new file mode 100644 index 0000000000..d2a9ccd140 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowCreateCommandResponseDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.command.CommandOutcome; +import org.junit.Test; + +public class ImmutablePhysicalFlowCreateCommandResponseDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowCreateCommandResponse.Json actualJson = new ImmutablePhysicalFlowCreateCommandResponse.Json(); + + // Assert + assertNull(actualJson.outcome); + assertNull(actualJson.entityReference); + assertNull(actualJson.originalCommand); + } + + @Test + public void setOriginalCommandTest() { + // Arrange + ImmutablePhysicalFlowCreateCommandResponse.Json json = new ImmutablePhysicalFlowCreateCommandResponse.Json(); + ImmutablePhysicalFlowCreateCommand.Json json1 = new ImmutablePhysicalFlowCreateCommand.Json(); + + // Act + json.setOriginalCommand(json1); + + // Assert + assertSame(json1, json.originalCommand); + } + + @Test + public void setOutcomeTest() { + // Arrange + ImmutablePhysicalFlowCreateCommandResponse.Json json = new ImmutablePhysicalFlowCreateCommandResponse.Json(); + + // Act + json.setOutcome(CommandOutcome.SUCCESS); + + // Assert + assertEquals(CommandOutcome.SUCCESS, json.outcome); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandDiffblueTest.java new file mode 100644 index 0000000000..b926db2720 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandDiffblueTest.java @@ -0,0 +1,31 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutablePhysicalFlowDeleteCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowDeleteCommand.Json actualJson = new ImmutablePhysicalFlowDeleteCommand.Json(); + + // Assert + assertFalse(actualJson.flowIdIsSet); + assertEquals(0L, actualJson.flowId); + } + @Test + public void setFlowIdTest() { + // Arrange + ImmutablePhysicalFlowDeleteCommand.Json json = new ImmutablePhysicalFlowDeleteCommand.Json(); + + // Act + json.setFlowId(123L); + + // Assert + assertTrue(json.flowIdIsSet); + assertEquals(123L, json.flowId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandResponseDiffblueTest.java new file mode 100644 index 0000000000..cc5f1275ae --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDeleteCommandResponseDiffblueTest.java @@ -0,0 +1,79 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.command.CommandOutcome; +import org.junit.Test; + +public class ImmutablePhysicalFlowDeleteCommandResponseDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowDeleteCommandResponse.Json actualJson = new ImmutablePhysicalFlowDeleteCommandResponse.Json(); + + // Assert + assertFalse(actualJson.isSpecificationUnusedIsSet); + assertNull(actualJson.originalCommand); + assertFalse(actualJson.isSpecificationUnused); + assertFalse(actualJson.isLastPhysicalFlow); + assertNull(actualJson.outcome); + assertNull(actualJson.entityReference); + assertFalse(actualJson.isLastPhysicalFlowIsSet); + } + + @Test + public void setIsLastPhysicalFlowTest() { + // Arrange + ImmutablePhysicalFlowDeleteCommandResponse.Json json = new ImmutablePhysicalFlowDeleteCommandResponse.Json(); + + // Act + json.setIsLastPhysicalFlow(true); + + // Assert + assertTrue(json.isLastPhysicalFlow); + assertTrue(json.isLastPhysicalFlowIsSet); + } + + @Test + public void setIsSpecificationUnusedTest() { + // Arrange + ImmutablePhysicalFlowDeleteCommandResponse.Json json = new ImmutablePhysicalFlowDeleteCommandResponse.Json(); + + // Act + json.setIsSpecificationUnused(true); + + // Assert + assertTrue(json.isSpecificationUnusedIsSet); + assertTrue(json.isSpecificationUnused); + } + + @Test + public void setOriginalCommandTest() { + // Arrange + ImmutablePhysicalFlowDeleteCommandResponse.Json json = new ImmutablePhysicalFlowDeleteCommandResponse.Json(); + ImmutablePhysicalFlowDeleteCommand.Json json1 = new ImmutablePhysicalFlowDeleteCommand.Json(); + + // Act + json.setOriginalCommand(json1); + + // Assert + assertSame(json1, json.originalCommand); + } + + @Test + public void setOutcomeTest() { + // Arrange + ImmutablePhysicalFlowDeleteCommandResponse.Json json = new ImmutablePhysicalFlowDeleteCommandResponse.Json(); + + // Act + json.setOutcome(CommandOutcome.SUCCESS); + + // Assert + assertEquals(CommandOutcome.SUCCESS, json.outcome); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDiffblueTest.java new file mode 100644 index 0000000000..153d40f08d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowDiffblueTest.java @@ -0,0 +1,185 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.FreshnessIndicator; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.IsRemovedProvider; +import com.khartec.waltz.model.LastAttestedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.time.LocalDateTime; +import java.util.Optional; +import org.junit.Test; + +public class ImmutablePhysicalFlowDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlow.Json actualJson = new ImmutablePhysicalFlow.Json(); + + // Assert + Optional optional = actualJson.lastAttestedAt; + assertSame(optional, actualJson.lastAttestedBy); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.specificationDefinitionId); + assertSame(optional, actualJson.created); + assertSame(optional, actualJson.externalId); + } + @Test + public void setBasisOffsetTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setBasisOffset(1); + + // Assert + assertEquals(1, json.basisOffset); + assertTrue(json.basisOffsetIsSet); + } + @Test + public void setCriticalityTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setCriticality(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.criticality); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setFrequencyTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setFrequency(FrequencyKind.ON_DEMAND); + + // Assert + assertEquals(FrequencyKind.ON_DEMAND, json.frequency); + } + @Test + public void setFreshnessIndicatorTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setFreshnessIndicator(FreshnessIndicator.NEVER_OBSERVED); + + // Assert + assertEquals(FreshnessIndicator.NEVER_OBSERVED, json.freshnessIndicator); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemoved); + assertTrue(json.isRemovedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setLogicalFlowIdTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setLogicalFlowId(123L); + + // Assert + assertTrue(json.logicalFlowIdIsSet); + assertEquals(123L, json.logicalFlowId); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setSpecificationIdTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setSpecificationId(123L); + + // Assert + assertTrue(json.specificationIdIsSet); + assertEquals(123L, json.specificationId); + } + @Test + public void setTransportTest() { + // Arrange + ImmutablePhysicalFlow.Json json = new ImmutablePhysicalFlow.Json(); + + // Act + json.setTransport("transport"); + + // Assert + assertEquals("transport", json.transport); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowParsedDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowParsedDiffblueTest.java new file mode 100644 index 0000000000..3341ef2585 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowParsedDiffblueTest.java @@ -0,0 +1,142 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.Criticality; +import com.khartec.waltz.model.physical_specification.DataFormatKind; +import org.junit.Test; + +public class ImmutablePhysicalFlowParsedDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowParsed.Json actualJson = new ImmutablePhysicalFlowParsed.Json(); + + // Assert + assertNull(actualJson.owner); + assertNull(actualJson.specExternalId); + assertNull(actualJson.specDescription); + assertNull(actualJson.name); + assertNull(actualJson.basisOffset); + assertNull(actualJson.frequency); + assertNull(actualJson.target); + assertNull(actualJson.transport); + assertNull(actualJson.source); + assertNull(actualJson.criticality); + assertNull(actualJson.format); + assertNull(actualJson.externalId); + assertNull(actualJson.description); + assertNull(actualJson.dataType); + } + @Test + public void setBasisOffsetTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setBasisOffset(1); + + // Assert + assertEquals(Integer.valueOf(1), json.basisOffset); + } + @Test + public void setCriticalityTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setCriticality(Criticality.LOW); + + // Assert + assertEquals(Criticality.LOW, json.criticality); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setExternalIdTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setExternalId("123"); + + // Assert + assertEquals("123", json.externalId); + } + @Test + public void setFormatTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setFormat(DataFormatKind.BINARY); + + // Assert + assertEquals(DataFormatKind.BINARY, json.format); + } + @Test + public void setFrequencyTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setFrequency(FrequencyKind.ON_DEMAND); + + // Assert + assertEquals(FrequencyKind.ON_DEMAND, json.frequency); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setSpecDescriptionTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setSpecDescription("specDescription"); + + // Assert + assertEquals("specDescription", json.specDescription); + } + @Test + public void setSpecExternalIdTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setSpecExternalId("123"); + + // Assert + assertEquals("123", json.specExternalId); + } + @Test + public void setTransportTest() { + // Arrange + ImmutablePhysicalFlowParsed.Json json = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setTransport("transport"); + + // Assert + assertEquals("transport", json.transport); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowSpecDefinitionChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowSpecDefinitionChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..a40badd6ad --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowSpecDefinitionChangeCommandDiffblueTest.java @@ -0,0 +1,31 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutablePhysicalFlowSpecDefinitionChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowSpecDefinitionChangeCommand.Json actualJson = new ImmutablePhysicalFlowSpecDefinitionChangeCommand.Json(); + + // Assert + assertEquals(0L, actualJson.newSpecDefinitionId); + assertFalse(actualJson.newSpecDefinitionIdIsSet); + } + @Test + public void setNewSpecDefinitionIdTest() { + // Arrange + ImmutablePhysicalFlowSpecDefinitionChangeCommand.Json json = new ImmutablePhysicalFlowSpecDefinitionChangeCommand.Json(); + + // Act + json.setNewSpecDefinitionId(123L); + + // Assert + assertEquals(123L, json.newSpecDefinitionId); + assertTrue(json.newSpecDefinitionIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandDiffblueTest.java new file mode 100644 index 0000000000..01bb92cd40 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandDiffblueTest.java @@ -0,0 +1,184 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutablePhysicalFlowUploadCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowUploadCommand.Json actualJson = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Assert + assertNull(actualJson.target); + assertNull(actualJson.basisOffset); + assertNull(actualJson.name); + assertNull(actualJson.specDescription); + assertNull(actualJson.specExternalId); + assertNull(actualJson.owner); + assertNull(actualJson.dataType); + assertNull(actualJson.transport); + assertNull(actualJson.source); + assertNull(actualJson.externalId); + assertNull(actualJson.description); + assertNull(actualJson.criticality); + assertNull(actualJson.format); + assertNull(actualJson.frequency); + } + @Test + public void setBasisOffsetTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setBasisOffset("basisOffset"); + + // Assert + assertEquals("basisOffset", json.basisOffset); + } + @Test + public void setCriticalityTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setCriticality("criticality"); + + // Assert + assertEquals("criticality", json.criticality); + } + @Test + public void setDataTypeTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setDataType("dataType"); + + // Assert + assertEquals("dataType", json.dataType); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setExternalIdTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setExternalId("123"); + + // Assert + assertEquals("123", json.externalId); + } + @Test + public void setFormatTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setFormat("format"); + + // Assert + assertEquals("format", json.format); + } + @Test + public void setFrequencyTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setFrequency("frequency"); + + // Assert + assertEquals("frequency", json.frequency); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOwnerTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setOwner("owner"); + + // Assert + assertEquals("owner", json.owner); + } + @Test + public void setSourceTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setSource("source"); + + // Assert + assertEquals("source", json.source); + } + @Test + public void setSpecDescriptionTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setSpecDescription("specDescription"); + + // Assert + assertEquals("specDescription", json.specDescription); + } + @Test + public void setSpecExternalIdTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setSpecExternalId("123"); + + // Assert + assertEquals("123", json.specExternalId); + } + @Test + public void setTargetTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setTarget("target"); + + // Assert + assertEquals("target", json.target); + } + @Test + public void setTransportTest() { + // Arrange + ImmutablePhysicalFlowUploadCommand.Json json = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setTransport("transport"); + + // Assert + assertEquals("transport", json.transport); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandResponseDiffblueTest.java new file mode 100644 index 0000000000..7a1b1ddeb7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow/ImmutablePhysicalFlowUploadCommandResponseDiffblueTest.java @@ -0,0 +1,69 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.command.CommandOutcome; +import java.util.HashMap; +import org.junit.Test; + +public class ImmutablePhysicalFlowUploadCommandResponseDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutablePhysicalFlowUploadCommandResponse.Json()).errors.size()); + } + + @Test + public void setErrorsTest() { + // Arrange + ImmutablePhysicalFlowUploadCommandResponse.Json json = new ImmutablePhysicalFlowUploadCommandResponse.Json(); + HashMap stringStringMap = new HashMap(); + stringStringMap.put("foo", "foo"); + + // Act + json.setErrors(stringStringMap); + + // Assert + assertSame(stringStringMap, json.errors); + } + + @Test + public void setOriginalCommandTest() { + // Arrange + ImmutablePhysicalFlowUploadCommandResponse.Json json = new ImmutablePhysicalFlowUploadCommandResponse.Json(); + ImmutablePhysicalFlowUploadCommand.Json json1 = new ImmutablePhysicalFlowUploadCommand.Json(); + + // Act + json.setOriginalCommand(json1); + + // Assert + assertSame(json1, json.originalCommand); + } + + @Test + public void setOutcomeTest() { + // Arrange + ImmutablePhysicalFlowUploadCommandResponse.Json json = new ImmutablePhysicalFlowUploadCommandResponse.Json(); + + // Act + json.setOutcome(CommandOutcome.SUCCESS); + + // Assert + assertEquals(CommandOutcome.SUCCESS, json.outcome); + } + + @Test + public void setParsedFlowTest() { + // Arrange + ImmutablePhysicalFlowUploadCommandResponse.Json json = new ImmutablePhysicalFlowUploadCommandResponse.Json(); + ImmutablePhysicalFlowParsed.Json json1 = new ImmutablePhysicalFlowParsed.Json(); + + // Act + json.setParsedFlow(json1); + + // Assert + assertSame(json1, json.parsedFlow); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow_participant/ImmutablePhysicalFlowParticipantDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow_participant/ImmutablePhysicalFlowParticipantDiffblueTest.java new file mode 100644 index 0000000000..0f259dda37 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_flow_participant/ImmutablePhysicalFlowParticipantDiffblueTest.java @@ -0,0 +1,85 @@ +package com.khartec.waltz.model.physical_flow_participant; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutablePhysicalFlowParticipantDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalFlowParticipant.Json actualJson = new ImmutablePhysicalFlowParticipant.Json(); + + // Assert + assertNull(actualJson.participant); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.provenance); + assertNull(actualJson.lastUpdatedAt); + assertFalse(actualJson.physicalFlowIdIsSet); + assertNull(actualJson.kind); + assertEquals(0L, actualJson.physicalFlowId); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalFlowParticipant.Json json = new ImmutablePhysicalFlowParticipant.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setKindTest() { + // Arrange + ImmutablePhysicalFlowParticipant.Json json = new ImmutablePhysicalFlowParticipant.Json(); + + // Act + json.setKind(ParticipationKind.SOURCE); + + // Assert + assertEquals(ParticipationKind.SOURCE, json.kind); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalFlowParticipant.Json json = new ImmutablePhysicalFlowParticipant.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setPhysicalFlowIdTest() { + // Arrange + ImmutablePhysicalFlowParticipant.Json json = new ImmutablePhysicalFlowParticipant.Json(); + + // Act + json.setPhysicalFlowId(123L); + + // Assert + assertTrue(json.physicalFlowIdIsSet); + assertEquals(123L, json.physicalFlowId); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutablePhysicalFlowParticipant.Json json = new ImmutablePhysicalFlowParticipant.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationAddCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationAddCommandDiffblueTest.java new file mode 100644 index 0000000000..a8089332b6 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationAddCommandDiffblueTest.java @@ -0,0 +1,56 @@ +package com.khartec.waltz.model.physical_specification; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutablePhysicalSpecificationAddCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecificationAddCommand.Json actualJson = new ImmutablePhysicalSpecificationAddCommand.Json(); + + // Assert + assertNull(actualJson.owningEntity); + assertNull(actualJson.format); + assertNull(actualJson.name); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalSpecificationAddCommand.Json json = new ImmutablePhysicalSpecificationAddCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setFormatTest() { + // Arrange + ImmutablePhysicalSpecificationAddCommand.Json json = new ImmutablePhysicalSpecificationAddCommand.Json(); + + // Act + json.setFormat(DataFormatKind.BINARY); + + // Assert + assertEquals(DataFormatKind.BINARY, json.format); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecificationAddCommand.Json json = new ImmutablePhysicalSpecificationAddCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDeleteCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDeleteCommandDiffblueTest.java new file mode 100644 index 0000000000..3aa84c50e7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDeleteCommandDiffblueTest.java @@ -0,0 +1,31 @@ +package com.khartec.waltz.model.physical_specification; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutablePhysicalSpecificationDeleteCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecificationDeleteCommand.Json actualJson = new ImmutablePhysicalSpecificationDeleteCommand.Json(); + + // Assert + assertFalse(actualJson.specificationIdIsSet); + assertEquals(0L, actualJson.specificationId); + } + @Test + public void setSpecificationIdTest() { + // Arrange + ImmutablePhysicalSpecificationDeleteCommand.Json json = new ImmutablePhysicalSpecificationDeleteCommand.Json(); + + // Act + json.setSpecificationId(123L); + + // Assert + assertTrue(json.specificationIdIsSet); + assertEquals(123L, json.specificationId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDiffblueTest.java new file mode 100644 index 0000000000..35cb1a88c3 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification/ImmutablePhysicalSpecificationDiffblueTest.java @@ -0,0 +1,97 @@ +package com.khartec.waltz.model.physical_specification; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.IsRemovedProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.UserTimestamp; +import java.util.Optional; +import org.junit.Test; + +public class ImmutablePhysicalSpecificationDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecification.Json actualJson = new ImmutablePhysicalSpecification.Json(); + + // Assert + Optional optional = actualJson.created; + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.externalId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setFormatTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setFormat(DataFormatKind.BINARY); + + // Assert + assertEquals(DataFormatKind.BINARY, json.format); + } + @Test + public void setIsRemovedTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setIsRemoved(true); + + // Assert + assertTrue(json.isRemovedIsSet); + assertTrue(json.isRemoved); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutablePhysicalSpecification.Json json = new ImmutablePhysicalSpecification.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_data_type/ImmutablePhysicalSpecificationDataTypeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_data_type/ImmutablePhysicalSpecificationDataTypeDiffblueTest.java new file mode 100644 index 0000000000..e8c03485eb --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_data_type/ImmutablePhysicalSpecificationDataTypeDiffblueTest.java @@ -0,0 +1,73 @@ +package com.khartec.waltz.model.physical_specification_data_type; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutablePhysicalSpecificationDataTypeDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecificationDataType.Json actualJson = new ImmutablePhysicalSpecificationDataType.Json(); + + // Assert + assertEquals(0L, actualJson.dataTypeId); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.provenance); + assertFalse(actualJson.dataTypeIdIsSet); + assertNull(actualJson.lastUpdatedBy); + assertEquals(0L, actualJson.specificationId); + assertFalse(actualJson.specificationIdIsSet); + } + @Test + public void setDataTypeIdTest() { + // Arrange + ImmutablePhysicalSpecificationDataType.Json json = new ImmutablePhysicalSpecificationDataType.Json(); + + // Act + json.setDataTypeId(123L); + + // Assert + assertEquals(123L, json.dataTypeId); + assertTrue(json.dataTypeIdIsSet); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalSpecificationDataType.Json json = new ImmutablePhysicalSpecificationDataType.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutablePhysicalSpecificationDataType.Json json = new ImmutablePhysicalSpecificationDataType.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setSpecificationIdTest() { + // Arrange + ImmutablePhysicalSpecificationDataType.Json json = new ImmutablePhysicalSpecificationDataType.Json(); + + // Act + json.setSpecificationId(123L); + + // Assert + assertEquals(123L, json.specificationId); + assertTrue(json.specificationIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..2b370b2fbd --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionChangeCommandDiffblueTest.java @@ -0,0 +1,54 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.ReleaseLifecycleStatus; +import java.util.Optional; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinitionChangeCommand.Json actualJson = new ImmutablePhysicalSpecDefinitionChangeCommand.Json(); + + // Assert + Optional optional = actualJson.delimiter; + assertSame(actualJson.id, optional); + assertSame(optional, actualJson.id); + } + @Test + public void setStatusTest() { + // Arrange + ImmutablePhysicalSpecDefinitionChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionChangeCommand.Json(); + + // Act + json.setStatus(ReleaseLifecycleStatus.DRAFT); + + // Assert + assertEquals(ReleaseLifecycleStatus.DRAFT, json.status); + } + @Test + public void setTypeTest() { + // Arrange + ImmutablePhysicalSpecDefinitionChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionChangeCommand.Json(); + + // Act + json.setType(PhysicalSpecDefinitionType.DELIMITED); + + // Assert + assertEquals(PhysicalSpecDefinitionType.DELIMITED, json.type); + } + @Test + public void setVersionTest() { + // Arrange + ImmutablePhysicalSpecDefinitionChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionChangeCommand.Json(); + + // Act + json.setVersion("version"); + + // Assert + assertEquals("version", json.version); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionDiffblueTest.java new file mode 100644 index 0000000000..3e888c086d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionDiffblueTest.java @@ -0,0 +1,114 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.ReleaseLifecycleStatus; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinition.Json actualJson = new ImmutablePhysicalSpecDefinition.Json(); + + // Assert + assertSame(actualJson.id, actualJson.delimiter); + } + + + + + + + @Test + public void setCreatedByTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setSpecificationIdTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setSpecificationId(123L); + + // Assert + assertTrue(json.specificationIdIsSet); + assertEquals(123L, json.specificationId); + } + + @Test + public void setStatusTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setStatus(ReleaseLifecycleStatus.DRAFT); + + // Assert + assertEquals(ReleaseLifecycleStatus.DRAFT, json.status); + } + + @Test + public void setTypeTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setType(PhysicalSpecDefinitionType.DELIMITED); + + // Assert + assertEquals(PhysicalSpecDefinitionType.DELIMITED, json.type); + } + + @Test + public void setVersionTest() { + // Arrange + ImmutablePhysicalSpecDefinition.Json json = new ImmutablePhysicalSpecDefinition.Json(); + + // Act + json.setVersion("version"); + + // Assert + assertEquals("version", json.version); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..ccbfeb8a50 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldChangeCommandDiffblueTest.java @@ -0,0 +1,69 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.FieldDataType; +import com.khartec.waltz.model.NameProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionFieldChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json actualJson = new ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(actualJson.logicalDataElementId, optional); + assertSame(optional, actualJson.logicalDataElementId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json(); + + // Act + json.setPosition(1); + + // Assert + assertEquals(1, json.position); + assertTrue(json.positionIsSet); + } + @Test + public void setTypeTest() { + // Arrange + ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json json = new ImmutablePhysicalSpecDefinitionFieldChangeCommand.Json(); + + // Act + json.setType(FieldDataType.DATE); + + // Assert + assertEquals(FieldDataType.DATE, json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldDiffblueTest.java new file mode 100644 index 0000000000..ae0223ef75 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionFieldDiffblueTest.java @@ -0,0 +1,91 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.FieldDataType; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionFieldDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinitionField.Json actualJson = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Assert + assertSame(actualJson.id, actualJson.logicalDataElementId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setPosition(1); + + // Assert + assertTrue(json.positionIsSet); + assertEquals(1, json.position); + } + @Test + public void setSpecDefinitionIdTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setSpecDefinitionId(123L); + + // Assert + assertTrue(json.specDefinitionIdIsSet); + assertEquals(123L, json.specDefinitionId); + } + @Test + public void setTypeTest() { + // Arrange + ImmutablePhysicalSpecDefinitionField.Json json = new ImmutablePhysicalSpecDefinitionField.Json(); + + // Act + json.setType(FieldDataType.DATE); + + // Assert + assertEquals(FieldDataType.DATE, json.type); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..869a62fb36 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileCreateCommandDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionSampleFileCreateCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json actualJson = new ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json(); + + // Assert + assertNull(actualJson.fileData); + assertNull(actualJson.name); + } + + @Test + public void setFileDataTest() { + // Arrange + ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json json = new ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json(); + + // Act + json.setFileData("fileData"); + + // Assert + assertEquals("fileData", json.fileData); + } + + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json json = new ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileDiffblueTest.java new file mode 100644 index 0000000000..3d9c30cf52 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/physical_specification_definition/ImmutablePhysicalSpecDefinitionSampleFileDiffblueTest.java @@ -0,0 +1,57 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutablePhysicalSpecDefinitionSampleFileDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePhysicalSpecDefinitionSampleFile.Json actualJson = new ImmutablePhysicalSpecDefinitionSampleFile.Json(); + + // Assert + assertEquals(0L, actualJson.specDefinitionId); + assertNull(actualJson.name); + assertNull(actualJson.fileData); + assertFalse(actualJson.specDefinitionIdIsSet); + } + @Test + public void setFileDataTest() { + // Arrange + ImmutablePhysicalSpecDefinitionSampleFile.Json json = new ImmutablePhysicalSpecDefinitionSampleFile.Json(); + + // Act + json.setFileData("fileData"); + + // Assert + assertEquals("fileData", json.fileData); + } + @Test + public void setNameTest() { + // Arrange + ImmutablePhysicalSpecDefinitionSampleFile.Json json = new ImmutablePhysicalSpecDefinitionSampleFile.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setSpecDefinitionIdTest() { + // Arrange + ImmutablePhysicalSpecDefinitionSampleFile.Json json = new ImmutablePhysicalSpecDefinitionSampleFile.Json(); + + // Act + json.setSpecDefinitionId(123L); + + // Assert + assertEquals(123L, json.specDefinitionId); + assertTrue(json.specDefinitionIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRagNameDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRagNameDiffblueTest.java new file mode 100644 index 0000000000..97d093b34d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRagNameDiffblueTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.rating; + +import static org.junit.Assert.assertEquals; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.PositionProvider; +import org.junit.Test; + +public class ImmutableRagNameDiffblueTest { + @Test + public void setRatingTest() { + // Arrange + ImmutableRagName.Json json = new ImmutableRagName.Json(); + + // Act + json.setRating('A'); + + // Assert + assertEquals(Character.valueOf('A'), json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRatingSchemeDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRatingSchemeDiffblueTest.java new file mode 100644 index 0000000000..860f1e4129 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/rating/ImmutableRatingSchemeDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.rating; + +import static org.junit.Assert.assertEquals; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableRatingSchemeDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableRatingScheme.Json()).ratings.size()); + } + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableRatingScheme.Json json = new ImmutableRatingScheme.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableRatingScheme.Json json = new ImmutableRatingScheme.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapAndScenarioOverviewDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapAndScenarioOverviewDiffblueTest.java new file mode 100644 index 0000000000..52c27c2a87 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapAndScenarioOverviewDiffblueTest.java @@ -0,0 +1,49 @@ +package com.khartec.waltz.model.roadmap; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.scenario.Scenario; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableRoadmapAndScenarioOverviewDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRoadmapAndScenarioOverview.Json actualJson = new ImmutableRoadmapAndScenarioOverview.Json(); + + // Assert + assertNull(actualJson.roadmap); + assertNull(actualJson.scenarios); + } + + + @Test + public void setRoadmapTest() { + // Arrange + ImmutableRoadmapAndScenarioOverview.Json json = new ImmutableRoadmapAndScenarioOverview.Json(); + ImmutableRoadmap.Json json1 = new ImmutableRoadmap.Json(); + + // Act + json.setRoadmap(json1); + + // Assert + assertSame(json1, json.roadmap); + } + + @Test + public void setScenariosTest() { + // Arrange + ImmutableRoadmapAndScenarioOverview.Json json = new ImmutableRoadmapAndScenarioOverview.Json(); + ArrayList scenarioList = new ArrayList(); + scenarioList.add(null); + + // Act + json.setScenarios(scenarioList); + + // Assert + assertSame(scenarioList, json.scenarios); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..66ce4727eb --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapCreateCommandDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.roadmap; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableRoadmapCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRoadmapCreateCommand.Json actualJson = new ImmutableRoadmapCreateCommand.Json(); + + // Assert + assertNull(actualJson.name); + assertNull(actualJson.columnType); + assertNull(actualJson.rowType); + assertFalse(actualJson.ratingSchemeIdIsSet); + assertNull(actualJson.linkedEntity); + assertEquals(0L, actualJson.ratingSchemeId); + } + @Test + public void setNameTest() { + // Arrange + ImmutableRoadmapCreateCommand.Json json = new ImmutableRoadmapCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setRatingSchemeIdTest() { + // Arrange + ImmutableRoadmapCreateCommand.Json json = new ImmutableRoadmapCreateCommand.Json(); + + // Act + json.setRatingSchemeId(123L); + + // Assert + assertTrue(json.ratingSchemeIdIsSet); + assertEquals(123L, json.ratingSchemeId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapDiffblueTest.java new file mode 100644 index 0000000000..1cba379572 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/roadmap/ImmutableRoadmapDiffblueTest.java @@ -0,0 +1,101 @@ +package com.khartec.waltz.model.roadmap; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableRoadmapDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRoadmap.Json actualJson = new ImmutableRoadmap.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityLifecycleStatus); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.columnType); + assertNull(actualJson.description); + assertNull(actualJson.name); + assertFalse(actualJson.ratingSchemeIdIsSet); + assertEquals(0L, actualJson.ratingSchemeId); + assertNull(actualJson.rowType); + } + + + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableRoadmap.Json json = new ImmutableRoadmap.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableRoadmap.Json json = new ImmutableRoadmap.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableRoadmap.Json json = new ImmutableRoadmap.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableRoadmap.Json json = new ImmutableRoadmap.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setRatingSchemeIdTest() { + // Arrange + ImmutableRoadmap.Json json = new ImmutableRoadmap.Json(); + + // Act + json.setRatingSchemeId(123L); + + // Assert + assertTrue(json.ratingSchemeIdIsSet); + assertEquals(123L, json.ratingSchemeId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/role/ImmutableRoleDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/role/ImmutableRoleDiffblueTest.java new file mode 100644 index 0000000000..f9fe569d84 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/role/ImmutableRoleDiffblueTest.java @@ -0,0 +1,74 @@ +package com.khartec.waltz.model.role; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableRoleDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableRole.Json actualJson = new ImmutableRole.Json(); + + // Assert + assertNull(actualJson.description); + assertFalse(actualJson.isCustomIsSet); + assertNull(actualJson.key); + assertFalse(actualJson.isCustom); + assertNull(actualJson.name); + } + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableRole.Json json = new ImmutableRole.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setIsCustomTest() { + // Arrange + ImmutableRole.Json json = new ImmutableRole.Json(); + + // Act + json.setIsCustom(true); + + // Assert + assertTrue(json.isCustomIsSet); + assertTrue(json.isCustom); + } + + @Test + public void setKeyTest() { + // Arrange + ImmutableRole.Json json = new ImmutableRole.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableRole.Json json = new ImmutableRole.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioAxisItemDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioAxisItemDiffblueTest.java new file mode 100644 index 0000000000..352b63488f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioAxisItemDiffblueTest.java @@ -0,0 +1,60 @@ +package com.khartec.waltz.model.scenario; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.AxisOrientation; +import org.junit.Test; + +public class ImmutableScenarioAxisItemDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableScenarioAxisItem.Json actualJson = new ImmutableScenarioAxisItem.Json(); + + // Assert + assertNull(actualJson.domainItem); + assertEquals(0, actualJson.position); + assertFalse(actualJson.scenarioIdIsSet); + assertEquals(0L, actualJson.scenarioId); + assertNull(actualJson.axisOrientation); + assertFalse(actualJson.positionIsSet); + } + @Test + public void setAxisOrientationTest() { + // Arrange + ImmutableScenarioAxisItem.Json json = new ImmutableScenarioAxisItem.Json(); + + // Act + json.setAxisOrientation(AxisOrientation.ROW); + + // Assert + assertEquals(AxisOrientation.ROW, json.axisOrientation); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableScenarioAxisItem.Json json = new ImmutableScenarioAxisItem.Json(); + + // Act + json.setPosition(1); + + // Assert + assertEquals(1, json.position); + assertTrue(json.positionIsSet); + } + @Test + public void setScenarioIdTest() { + // Arrange + ImmutableScenarioAxisItem.Json json = new ImmutableScenarioAxisItem.Json(); + + // Act + json.setScenarioId(123L); + + // Assert + assertTrue(json.scenarioIdIsSet); + assertEquals(123L, json.scenarioId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioDiffblueTest.java new file mode 100644 index 0000000000..85a39e454b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioDiffblueTest.java @@ -0,0 +1,128 @@ +package com.khartec.waltz.model.scenario; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityLifecycleStatus; +import com.khartec.waltz.model.EntityLifecycleStatusProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.PositionProvider; +import com.khartec.waltz.model.ReleaseLifecycleStatus; +import org.junit.Test; + +public class ImmutableScenarioDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableScenario.Json actualJson = new ImmutableScenario.Json(); + + // Assert + assertFalse(actualJson.roadmapIdIsSet); + assertNull(actualJson.description); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.scenarioType); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.releaseStatus); + assertNull(actualJson.name); + assertFalse(actualJson.positionIsSet); + assertNull(actualJson.entityLifecycleStatus); + assertEquals(0, actualJson.position); + assertEquals(0L, actualJson.roadmapId); + assertNull(actualJson.effectiveDate); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityLifecycleStatusTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setEntityLifecycleStatus(EntityLifecycleStatus.ACTIVE); + + // Assert + assertEquals(EntityLifecycleStatus.ACTIVE, json.entityLifecycleStatus); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setNameTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setPosition(1); + + // Assert + assertTrue(json.positionIsSet); + assertEquals(1, json.position); + } + @Test + public void setReleaseStatusTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setReleaseStatus(ReleaseLifecycleStatus.DRAFT); + + // Assert + assertEquals(ReleaseLifecycleStatus.DRAFT, json.releaseStatus); + } + @Test + public void setRoadmapIdTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setRoadmapId(123L); + + // Assert + assertTrue(json.roadmapIdIsSet); + assertEquals(123L, json.roadmapId); + } + @Test + public void setScenarioTypeTest() { + // Arrange + ImmutableScenario.Json json = new ImmutableScenario.Json(); + + // Act + json.setScenarioType(ScenarioType.TARGET); + + // Assert + assertEquals(ScenarioType.TARGET, json.scenarioType); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioRatingItemDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioRatingItemDiffblueTest.java new file mode 100644 index 0000000000..d0e151fbb5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/scenario/ImmutableScenarioRatingItemDiffblueTest.java @@ -0,0 +1,76 @@ +package com.khartec.waltz.model.scenario; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import org.junit.Test; + +public class ImmutableScenarioRatingItemDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableScenarioRatingItem.Json actualJson = new ImmutableScenarioRatingItem.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.row); + assertNull(actualJson.column); + assertEquals('\u0000', actualJson.rating); + assertNull(actualJson.description); + assertFalse(actualJson.ratingIsSet); + assertFalse(actualJson.scenarioIdIsSet); + assertEquals(0L, actualJson.scenarioId); + assertNull(actualJson.item); + assertNull(actualJson.lastUpdatedBy); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableScenarioRatingItem.Json json = new ImmutableScenarioRatingItem.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableScenarioRatingItem.Json json = new ImmutableScenarioRatingItem.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableScenarioRatingItem.Json json = new ImmutableScenarioRatingItem.Json(); + + // Act + json.setRating('A'); + + // Assert + assertEquals('A', json.rating); + assertTrue(json.ratingIsSet); + } + @Test + public void setScenarioIdTest() { + // Arrange + ImmutableScenarioRatingItem.Json json = new ImmutableScenarioRatingItem.Json(); + + // Act + json.setScenarioId(123L); + + // Assert + assertTrue(json.scenarioIdIsSet); + assertEquals(123L, json.scenarioId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerInformationDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerInformationDiffblueTest.java new file mode 100644 index 0000000000..c652067606 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerInformationDiffblueTest.java @@ -0,0 +1,136 @@ +package com.khartec.waltz.model.server_information; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LifecycleStatus; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Date; +import org.junit.Test; + +public class ImmutableServerInformationDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableServerInformation.Json actualJson = new ImmutableServerInformation.Json(); + + // Assert + assertSame(actualJson.externalId, actualJson.id); + } + @Test + public void setCountryTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setCountry("country"); + + // Assert + assertEquals("country", json.country); + } + @Test + public void setHardwareEndOfLifeDateTest() { + // Arrange + Date date = new Date(1L); + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setHardwareEndOfLifeDate(date); + + // Assert + assertSame(date, json.hardwareEndOfLifeDate); + } + @Test + public void setHostnameTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setHostname("localhost"); + + // Assert + assertEquals("localhost", json.hostname); + } + @Test + public void setLifecycleStatusTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setLifecycleStatus(LifecycleStatus.ACTIVE); + + // Assert + assertEquals(LifecycleStatus.ACTIVE, json.lifecycleStatus); + } + @Test + public void setLocationTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setLocation("location"); + + // Assert + assertEquals("location", json.location); + } + @Test + public void setOperatingSystemEndOfLifeDateTest() { + // Arrange + Date date = new Date(1L); + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setOperatingSystemEndOfLifeDate(date); + + // Assert + assertSame(date, json.operatingSystemEndOfLifeDate); + } + @Test + public void setOperatingSystemTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setOperatingSystem("operatingSystem"); + + // Assert + assertEquals("operatingSystem", json.operatingSystem); + } + @Test + public void setOperatingSystemVersionTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setOperatingSystemVersion("operatingSystemVersion"); + + // Assert + assertEquals("operatingSystemVersion", json.operatingSystemVersion); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setVirtualTest() { + // Arrange + ImmutableServerInformation.Json json = new ImmutableServerInformation.Json(); + + // Act + json.setVirtual(true); + + // Assert + assertTrue(json.virtual); + assertTrue(json.virtualIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerSummaryStatisticsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerSummaryStatisticsDiffblueTest.java new file mode 100644 index 0000000000..3ed1ca0071 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_information/ImmutableServerSummaryStatisticsDiffblueTest.java @@ -0,0 +1,126 @@ +package com.khartec.waltz.model.server_information; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.tally.Tally; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableServerSummaryStatisticsDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableServerSummaryStatistics.Json actualJson = new ImmutableServerSummaryStatistics.Json(); + + // Assert + List> tallyList = actualJson.operatingSystemCounts; + List> actualTallyList = actualJson.operatingSystemEndOfLifeStatusCounts; + List> actualTallyList1 = actualJson.environmentCounts; + List> actualTallyList2 = actualJson.hardwareEndOfLifeStatusCounts; + List> actualTallyList3 = actualJson.locationCounts; + assertEquals(0, tallyList.size()); + assertSame(tallyList, actualTallyList3); + assertSame(tallyList, actualTallyList2); + assertSame(tallyList, actualTallyList1); + assertSame(tallyList, actualTallyList); + } + @Test + public void setEnvironmentCountsTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setEnvironmentCounts(tallyList); + + // Assert + assertSame(tallyList, json.environmentCounts); + } + @Test + public void setHardwareEndOfLifeStatusCountsTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setHardwareEndOfLifeStatusCounts(tallyList); + + // Assert + assertSame(tallyList, json.hardwareEndOfLifeStatusCounts); + } + @Test + public void setLocationCountsTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setLocationCounts(tallyList); + + // Assert + assertSame(tallyList, json.locationCounts); + } + @Test + public void setOperatingSystemCountsTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setOperatingSystemCounts(tallyList); + + // Assert + assertSame(tallyList, json.operatingSystemCounts); + } + @Test + public void setOperatingSystemEndOfLifeStatusCountsTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setOperatingSystemEndOfLifeStatusCounts(tallyList); + + // Assert + assertSame(tallyList, json.operatingSystemEndOfLifeStatusCounts); + } + @Test + public void setPhysicalCountTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + + // Act + json.setPhysicalCount(3L); + + // Assert + assertTrue(json.physicalCountIsSet); + assertEquals(3L, json.physicalCount); + } + @Test + public void setTotalCountTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + + // Act + json.setTotalCount(3L); + + // Assert + assertTrue(json.totalCountIsSet); + assertEquals(3L, json.totalCount); + } + @Test + public void setVirtualCountTest() { + // Arrange + ImmutableServerSummaryStatistics.Json json = new ImmutableServerSummaryStatistics.Json(); + + // Act + json.setVirtualCount(3L); + + // Assert + assertTrue(json.virtualCountIsSet); + assertEquals(3L, json.virtualCount); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/server_usage/ImmutableServerUsageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_usage/ImmutableServerUsageDiffblueTest.java new file mode 100644 index 0000000000..558490d781 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/server_usage/ImmutableServerUsageDiffblueTest.java @@ -0,0 +1,72 @@ +package com.khartec.waltz.model.server_usage; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import org.junit.Test; + +public class ImmutableServerUsageDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableServerUsage.Json actualJson = new ImmutableServerUsage.Json(); + + // Assert + assertEquals(0L, actualJson.serverId); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.environment); + assertNull(actualJson.provenance); + assertFalse(actualJson.serverIdIsSet); + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.entityReference); + } + @Test + public void setEnvironmentTest() { + // Arrange + ImmutableServerUsage.Json json = new ImmutableServerUsage.Json(); + + // Act + json.setEnvironment("environment"); + + // Assert + assertEquals("environment", json.environment); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableServerUsage.Json json = new ImmutableServerUsage.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableServerUsage.Json json = new ImmutableServerUsage.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setServerIdTest() { + // Arrange + ImmutableServerUsage.Json json = new ImmutableServerUsage.Json(); + + // Act + json.setServerId(123L); + + // Assert + assertEquals(123L, json.serverId); + assertTrue(json.serverIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/settings/ImmutableSettingDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/settings/ImmutableSettingDiffblueTest.java new file mode 100644 index 0000000000..fb12d9541b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/settings/ImmutableSettingDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.settings; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableSettingDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSetting.Json actualJson = new ImmutableSetting.Json(); + + // Assert + assertFalse(actualJson.restricted); + assertNull(actualJson.name); + assertFalse(actualJson.restrictedIsSet); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSetting.Json json = new ImmutableSetting.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setRestrictedTest() { + // Arrange + ImmutableSetting.Json json = new ImmutableSetting.Json(); + + // Act + json.setRestricted(true); + + // Assert + assertTrue(json.restricted); + assertTrue(json.restrictedIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceDiffblueTest.java new file mode 100644 index 0000000000..e48d2711f6 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceDiffblueTest.java @@ -0,0 +1,66 @@ +package com.khartec.waltz.model.shared_preference; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.LastUpdatedProvider; +import org.junit.Test; + +public class ImmutableSharedPreferenceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSharedPreference.Json actualJson = new ImmutableSharedPreference.Json(); + + // Assert + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.category); + assertNull(actualJson.value); + assertNull(actualJson.key); + assertNull(actualJson.lastUpdatedAt); + } + @Test + public void setCategoryTest() { + // Arrange + ImmutableSharedPreference.Json json = new ImmutableSharedPreference.Json(); + + // Act + json.setCategory("category"); + + // Assert + assertEquals("category", json.category); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableSharedPreference.Json json = new ImmutableSharedPreference.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableSharedPreference.Json json = new ImmutableSharedPreference.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setValueTest() { + // Arrange + ImmutableSharedPreference.Json json = new ImmutableSharedPreference.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceSaveCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceSaveCommandDiffblueTest.java new file mode 100644 index 0000000000..dbb7c7aac5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/shared_preference/ImmutableSharedPreferenceSaveCommandDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model.shared_preference; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSharedPreferenceSaveCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSharedPreferenceSaveCommand.Json actualJson = new ImmutableSharedPreferenceSaveCommand.Json(); + + // Assert + assertNull(actualJson.key); + assertNull(actualJson.value); + assertNull(actualJson.category); + } + @Test + public void setCategoryTest() { + // Arrange + ImmutableSharedPreferenceSaveCommand.Json json = new ImmutableSharedPreferenceSaveCommand.Json(); + + // Act + json.setCategory("category"); + + // Assert + assertEquals("category", json.category); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableSharedPreferenceSaveCommand.Json json = new ImmutableSharedPreferenceSaveCommand.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } + @Test + public void setValueTest() { + // Arrange + ImmutableSharedPreferenceSaveCommand.Json json = new ImmutableSharedPreferenceSaveCommand.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareCatalogDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareCatalogDiffblueTest.java new file mode 100644 index 0000000000..cc889b3693 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareCatalogDiffblueTest.java @@ -0,0 +1,141 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableSoftwareCatalogDiffblueTest { + + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("SoftwareCatalog{packages=[], usages=[]," + " versions=[]}", + ImmutableSoftwareCatalog.builder().build().toString()); + } + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwareCatalog.Json actualJson = new ImmutableSoftwareCatalog.Json(); + + // Assert + List softwareUsageList = actualJson.usages; + List actualSoftwarePackageList = actualJson.packages; + List actualSoftwareVersionList = actualJson.versions; + assertEquals(0, softwareUsageList.size()); + assertSame(softwareUsageList, actualSoftwareVersionList); + assertSame(softwareUsageList, actualSoftwarePackageList); + } + + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse(ImmutableSoftwareCatalog.fromJson(new ImmutableSoftwareCatalog.Json()).equals("element")); + } + + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("SoftwareCatalog{packages=[], usages=[]," + " versions=[]}", + ImmutableSoftwareCatalog.fromJson(new ImmutableSoftwareCatalog.Json()).toString()); + } + + + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(193378120, ImmutableSoftwareCatalog.fromJson(new ImmutableSoftwareCatalog.Json()).hashCode()); + } + + @Test + public void packagesTest2() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + + // Act + List actualPackagesResult = ImmutableSoftwareCatalog.fromJson(json).packages(); + + // Assert + assertSame(json.versions, actualPackagesResult); + assertEquals(0, actualPackagesResult.size()); + } + + @Test + public void setPackagesTest() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + ArrayList softwarePackageList = new ArrayList(); + softwarePackageList.add(new ImmutableSoftwarePackage.Json()); + + // Act + json.setPackages(softwarePackageList); + + // Assert + assertSame(softwarePackageList, json.packages); + } + + @Test + public void setUsagesTest() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + ArrayList softwareUsageList = new ArrayList(); + softwareUsageList.add(new ImmutableSoftwareUsage.Json()); + + // Act + json.setUsages(softwareUsageList); + + // Assert + assertSame(softwareUsageList, json.usages); + } + + @Test + public void setVersionsTest() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + ArrayList softwareVersionList = new ArrayList(); + softwareVersionList.add(new ImmutableSoftwareVersion.Json()); + + // Act + json.setVersions(softwareVersionList); + + // Assert + assertSame(softwareVersionList, json.versions); + } + + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("SoftwareCatalog{packages=[], usages=[]," + " versions=[]}", + ImmutableSoftwareCatalog.fromJson(new ImmutableSoftwareCatalog.Json()).toString()); + } + + @Test + public void usagesTest2() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + + // Act + List actualUsagesResult = ImmutableSoftwareCatalog.fromJson(json).usages(); + + // Assert + assertSame(json.versions, actualUsagesResult); + assertEquals(0, actualUsagesResult.size()); + } + + @Test + public void versionsTest2() { + // Arrange + ImmutableSoftwareCatalog.Json json = new ImmutableSoftwareCatalog.Json(); + + // Act + List actualVersionsResult = ImmutableSoftwareCatalog.fromJson(json).versions(); + + // Assert + assertSame(json.versions, actualVersionsResult); + assertEquals(0, actualVersionsResult.size()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageDiffblueTest.java new file mode 100644 index 0000000000..87daf3368b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageDiffblueTest.java @@ -0,0 +1,125 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.UserTimestamp; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSoftwarePackageDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwarePackage.Json actualJson = new ImmutableSoftwarePackage.Json(); + + // Assert + Optional optional = actualJson.created; + assertSame(actualJson.id, optional); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.externalId); + } + + + + + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setGroupTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setGroup("group"); + + // Assert + assertEquals("group", json.group); + } + + @Test + public void setIsNotableTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setIsNotable(true); + + // Assert + assertTrue(json.isNotable); + assertTrue(json.isNotableIsSet); + } + + @Test + public void setKindTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setVendorTest() { + // Arrange + ImmutableSoftwarePackage.Json json = new ImmutableSoftwarePackage.Json(); + + // Act + json.setVendor("vendor"); + + // Assert + assertEquals("vendor", json.vendor); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageViewDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageViewDiffblueTest.java new file mode 100644 index 0000000000..eafd5cb996 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwarePackageViewDiffblueTest.java @@ -0,0 +1,119 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSoftwarePackageViewDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwarePackageView.Json actualJson = new ImmutableSoftwarePackageView.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(actualJson.created, optional); + assertSame(optional, actualJson.created); + assertSame(optional, actualJson.externalId); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setGroupTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setGroup("group"); + + // Assert + assertEquals("group", json.group); + } + @Test + public void setIsNotableTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setIsNotable(true); + + // Assert + assertTrue(json.isNotable); + assertTrue(json.isNotableIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setVendorTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setVendor("vendor"); + + // Assert + assertEquals("vendor", json.vendor); + } + @Test + public void setVersionTest() { + // Arrange + ImmutableSoftwarePackageView.Json json = new ImmutableSoftwarePackageView.Json(); + + // Act + json.setVersion("version"); + + // Assert + assertEquals("version", json.version); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareSummaryStatisticsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareSummaryStatisticsDiffblueTest.java new file mode 100644 index 0000000000..df9274123d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareSummaryStatisticsDiffblueTest.java @@ -0,0 +1,158 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.tally.Tally; +import java.util.ArrayList; +import java.util.List; +import org.junit.Test; + +public class ImmutableSoftwareSummaryStatisticsDiffblueTest { + @Test + public void buildTest() { + // Arrange, Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + ImmutableSoftwareSummaryStatistics.builder().build().toString()); + } + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwareSummaryStatistics.Json actualJson = new ImmutableSoftwareSummaryStatistics.Json(); + + // Assert + List> tallyList = actualJson.nameCounts; + List> actualTallyList = actualJson.groupCounts; + List> actualTallyList1 = actualJson.vendorCounts; + assertEquals(0, tallyList.size()); + assertSame(tallyList, actualTallyList1); + assertSame(tallyList, actualTallyList); + } + @Test + public void equalsTest() { + // Arrange, Act and Assert + assertFalse( + ImmutableSoftwareSummaryStatistics.fromJson(new ImmutableSoftwareSummaryStatistics.Json()).equals("element")); + } + @Test + public void fromJsonTest() { + // Arrange, Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + ImmutableSoftwareSummaryStatistics.fromJson(new ImmutableSoftwareSummaryStatistics.Json()).toString()); + } + @Test + public void groupCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + + // Act + List> actualGroupCountsResult = ImmutableSoftwareSummaryStatistics.fromJson(json).groupCounts(); + + // Assert + assertSame(json.vendorCounts, actualGroupCountsResult); + assertEquals(0, actualGroupCountsResult.size()); + } + @Test + public void hashCodeTest() { + // Arrange, Act and Assert + assertEquals(193378120, + ImmutableSoftwareSummaryStatistics.fromJson(new ImmutableSoftwareSummaryStatistics.Json()).hashCode()); + } + @Test + public void nameCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + + // Act + List> actualNameCountsResult = ImmutableSoftwareSummaryStatistics.fromJson(json).nameCounts(); + + // Assert + assertSame(json.vendorCounts, actualNameCountsResult); + assertEquals(0, actualNameCountsResult.size()); + } + @Test + public void setGroupCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setGroupCounts(tallyList); + + // Assert + assertSame(tallyList, json.groupCounts); + } + @Test + public void setNameCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setNameCounts(tallyList); + + // Assert + assertSame(tallyList, json.nameCounts); + } + @Test + public void setVendorCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + ArrayList> tallyList = new ArrayList>(); + + // Act + json.setVendorCounts(tallyList); + + // Assert + assertSame(tallyList, json.vendorCounts); + } + @Test + public void toStringTest() { + // Arrange, Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + ImmutableSoftwareSummaryStatistics.fromJson(new ImmutableSoftwareSummaryStatistics.Json()).toString()); + } + @Test + public void vendorCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics.Json json = new ImmutableSoftwareSummaryStatistics.Json(); + + // Act + List> actualVendorCountsResult = ImmutableSoftwareSummaryStatistics.fromJson(json).vendorCounts(); + + // Assert + assertSame(json.vendorCounts, actualVendorCountsResult); + assertEquals(0, actualVendorCountsResult.size()); + } + @Test + public void withGroupCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics fromJsonResult = ImmutableSoftwareSummaryStatistics + .fromJson(new ImmutableSoftwareSummaryStatistics.Json()); + + // Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + fromJsonResult.withGroupCounts(new ArrayList>()).toString()); + } + @Test + public void withNameCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics fromJsonResult = ImmutableSoftwareSummaryStatistics + .fromJson(new ImmutableSoftwareSummaryStatistics.Json()); + + // Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + fromJsonResult.withNameCounts(new ArrayList>()).toString()); + } + @Test + public void withVendorCountsTest() { + // Arrange + ImmutableSoftwareSummaryStatistics fromJsonResult = ImmutableSoftwareSummaryStatistics + .fromJson(new ImmutableSoftwareSummaryStatistics.Json()); + + // Act and Assert + assertEquals("SoftwareSummaryStatistics{vendorCounts=[], groupCounts=[]," + " nameCounts=[]}", + fromJsonResult.withVendorCounts(new ArrayList>()).toString()); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareUsageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareUsageDiffblueTest.java new file mode 100644 index 0000000000..13864fc8a1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareUsageDiffblueTest.java @@ -0,0 +1,84 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableSoftwareUsageDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwareUsage.Json actualJson = new ImmutableSoftwareUsage.Json(); + + // Assert + assertEquals(0L, actualJson.softwareVersionId); + assertNull(actualJson.licenceId); + assertEquals(0L, actualJson.softwarePackageId); + assertFalse(actualJson.softwarePackageIdIsSet); + assertNull(actualJson.provenance); + assertFalse(actualJson.applicationIdIsSet); + assertEquals(0L, actualJson.applicationId); + assertFalse(actualJson.softwareVersionIdIsSet); + } + @Test + public void setApplicationIdTest() { + // Arrange + ImmutableSoftwareUsage.Json json = new ImmutableSoftwareUsage.Json(); + + // Act + json.setApplicationId(123L); + + // Assert + assertTrue(json.applicationIdIsSet); + assertEquals(123L, json.applicationId); + } + @Test + public void setLicenceIdTest() { + // Arrange + ImmutableSoftwareUsage.Json json = new ImmutableSoftwareUsage.Json(); + + // Act + json.setLicenceId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.licenceId); + } + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSoftwareUsage.Json json = new ImmutableSoftwareUsage.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + @Test + public void setSoftwarePackageIdTest() { + // Arrange + ImmutableSoftwareUsage.Json json = new ImmutableSoftwareUsage.Json(); + + // Act + json.setSoftwarePackageId(123L); + + // Assert + assertEquals(123L, json.softwarePackageId); + assertTrue(json.softwarePackageIdIsSet); + } + @Test + public void setSoftwareVersionIdTest() { + // Arrange + ImmutableSoftwareUsage.Json json = new ImmutableSoftwareUsage.Json(); + + // Act + json.setSoftwareVersionId(123L); + + // Assert + assertEquals(123L, json.softwareVersionId); + assertTrue(json.softwareVersionIdIsSet); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareVersionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareVersionDiffblueTest.java new file mode 100644 index 0000000000..283487e6d0 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/software_catalog/ImmutableSoftwareVersionDiffblueTest.java @@ -0,0 +1,111 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedUserTimestampProvider; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.EntityKindProvider; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSoftwareVersionDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSoftwareVersion.Json actualJson = new ImmutableSoftwareVersion.Json(); + + // Assert + Optional optional = actualJson.id; + assertSame(optional, actualJson.externalId); + assertSame(optional, actualJson.created); + } + + + + + + + + + + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + + @Test + public void setKindTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.kind); + } + + @Test + public void setNameTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setSoftwarePackageIdTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setSoftwarePackageId(123L); + + // Assert + assertEquals(123L, json.softwarePackageId); + assertTrue(json.softwarePackageIdIsSet); + } + + @Test + public void setVersionTest() { + // Arrange + ImmutableSoftwareVersion.Json json = new ImmutableSoftwareVersion.Json(); + + // Act + json.setVersion("version"); + + // Assert + assertEquals("version", json.version); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/source_data_rating/ImmutableSourceDataRatingDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/source_data_rating/ImmutableSourceDataRatingDiffblueTest.java new file mode 100644 index 0000000000..3d27e1716e --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/source_data_rating/ImmutableSourceDataRatingDiffblueTest.java @@ -0,0 +1,85 @@ +package com.khartec.waltz.model.source_data_rating; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.rating.RagRating; +import org.junit.Test; + +public class ImmutableSourceDataRatingDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSourceDataRating.Json actualJson = new ImmutableSourceDataRating.Json(); + + // Assert + assertNull(actualJson.entityKind); + assertNull(actualJson.completeness); + assertNull(actualJson.sourceName); + assertNull(actualJson.accuracy); + assertNull(actualJson.authoritativeness); + } + + + @Test + public void setAccuracyTest() { + // Arrange + ImmutableSourceDataRating.Json json = new ImmutableSourceDataRating.Json(); + + // Act + json.setAccuracy(RagRating.R); + + // Assert + assertEquals(RagRating.R, json.accuracy); + } + + @Test + public void setAuthoritativenessTest() { + // Arrange + ImmutableSourceDataRating.Json json = new ImmutableSourceDataRating.Json(); + + // Act + json.setAuthoritativeness(RagRating.R); + + // Assert + assertEquals(RagRating.R, json.authoritativeness); + } + + @Test + public void setCompletenessTest() { + // Arrange + ImmutableSourceDataRating.Json json = new ImmutableSourceDataRating.Json(); + + // Act + json.setCompleteness(RagRating.R); + + // Assert + assertEquals(RagRating.R, json.completeness); + } + + @Test + public void setEntityKindTest() { + // Arrange + ImmutableSourceDataRating.Json json = new ImmutableSourceDataRating.Json(); + + // Act + json.setEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.entityKind); + } + + @Test + public void setSourceNameTest() { + // Arrange + ImmutableSourceDataRating.Json json = new ImmutableSourceDataRating.Json(); + + // Act + json.setSourceName("sourceName"); + + // Assert + assertEquals("sourceName", json.sourceName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/staticpanel/ImmutableStaticPanelDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/staticpanel/ImmutableStaticPanelDiffblueTest.java new file mode 100644 index 0000000000..68baa185c4 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/staticpanel/ImmutableStaticPanelDiffblueTest.java @@ -0,0 +1,107 @@ +package com.khartec.waltz.model.staticpanel; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.IdProvider; +import org.junit.Test; + +public class ImmutableStaticPanelDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableStaticPanel.Json actualJson = new ImmutableStaticPanel.Json(); + + // Assert + assertFalse(actualJson.widthIsSet); + assertFalse(actualJson.priorityIsSet); + assertEquals(0, actualJson.width); + assertNull(actualJson.title); + assertNull(actualJson.encoding); + assertNull(actualJson.icon); + assertNull(actualJson.content); + assertNull(actualJson.group); + assertEquals(0, actualJson.priority); + } + @Test + public void setContentTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setContent("content"); + + // Assert + assertEquals("content", json.content); + } + @Test + public void setEncodingTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setEncoding(ContentKind.HTML); + + // Assert + assertEquals(ContentKind.HTML, json.encoding); + } + @Test + public void setGroupTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setGroup("group"); + + // Assert + assertEquals("group", json.group); + } + @Test + public void setIconTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setIcon("icon"); + + // Assert + assertEquals("icon", json.icon); + } + @Test + public void setPriorityTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setPriority(1); + + // Assert + assertTrue(json.priorityIsSet); + assertEquals(1, json.priority); + } + @Test + public void setTitleTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setTitle("title"); + + // Assert + assertEquals("title", json.title); + } + @Test + public void setWidthTest() { + // Arrange + ImmutableStaticPanel.Json json = new ImmutableStaticPanel.Json(); + + // Act + json.setWidth(1); + + // Assert + assertTrue(json.widthIsSet); + assertEquals(1, json.width); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..7badb5fdfe --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceCreateCommandDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSurveyInstanceCreateCommandDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstanceCreateCommand.Json actualJson = new ImmutableSurveyInstanceCreateCommand.Json(); + + // Assert + assertNull(actualJson.surveyRunId); + assertNull(actualJson.status); + assertNull(actualJson.entityReference); + } + + + @Test + public void setStatusTest() { + // Arrange + ImmutableSurveyInstanceCreateCommand.Json json = new ImmutableSurveyInstanceCreateCommand.Json(); + + // Act + json.setStatus(SurveyInstanceStatus.NOT_STARTED); + + // Assert + assertEquals(SurveyInstanceStatus.NOT_STARTED, json.status); + } + + @Test + public void setSurveyRunIdTest() { + // Arrange + ImmutableSurveyInstanceCreateCommand.Json json = new ImmutableSurveyInstanceCreateCommand.Json(); + + // Act + json.setSurveyRunId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyRunId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceDiffblueTest.java new file mode 100644 index 0000000000..fde218c54f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceDiffblueTest.java @@ -0,0 +1,93 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.IdProvider; +import org.junit.Test; + +public class ImmutableSurveyInstanceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstance.Json actualJson = new ImmutableSurveyInstance.Json(); + + // Assert + assertNull(actualJson.surveyEntityExternalId); + assertNull(actualJson.submittedBy); + assertNull(actualJson.surveyEntity); + assertNull(actualJson.originalInstanceId); + assertNull(actualJson.dueDate); + assertNull(actualJson.surveyRunId); + assertNull(actualJson.approvedBy); + assertNull(actualJson.approvedAt); + assertNull(actualJson.status); + assertNull(actualJson.submittedAt); + } + @Test + public void setApprovedByTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setApprovedBy("approvedBy"); + + // Assert + assertEquals("approvedBy", json.approvedBy); + } + @Test + public void setOriginalInstanceIdTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setOriginalInstanceId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.originalInstanceId); + } + @Test + public void setStatusTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setStatus(SurveyInstanceStatus.NOT_STARTED); + + // Assert + assertEquals(SurveyInstanceStatus.NOT_STARTED, json.status); + } + @Test + public void setSubmittedByTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setSubmittedBy("submittedBy"); + + // Assert + assertEquals("submittedBy", json.submittedBy); + } + @Test + public void setSurveyEntityExternalIdTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setSurveyEntityExternalId("123"); + + // Assert + assertEquals("123", json.surveyEntityExternalId); + } + @Test + public void setSurveyRunIdTest() { + // Arrange + ImmutableSurveyInstance.Json json = new ImmutableSurveyInstance.Json(); + + // Act + json.setSurveyRunId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyRunId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceQuestionResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceQuestionResponseDiffblueTest.java new file mode 100644 index 0000000000..bbf727d0a7 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceQuestionResponseDiffblueTest.java @@ -0,0 +1,55 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableSurveyInstanceQuestionResponseDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstanceQuestionResponse.Json actualJson = new ImmutableSurveyInstanceQuestionResponse.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.personId); + assertNull(actualJson.surveyInstanceId); + assertNull(actualJson.questionResponse); + } + @Test + public void setPersonIdTest() { + // Arrange + ImmutableSurveyInstanceQuestionResponse.Json json = new ImmutableSurveyInstanceQuestionResponse.Json(); + + // Act + json.setPersonId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.personId); + } + @Test + public void setQuestionResponseTest() { + // Arrange + ImmutableSurveyInstanceQuestionResponse.Json json = new ImmutableSurveyInstanceQuestionResponse.Json(); + ImmutableSurveyQuestionResponse.Json json1 = new ImmutableSurveyQuestionResponse.Json(); + + // Act + json.setQuestionResponse(json1); + + // Assert + assertSame(json1, json.questionResponse); + } + @Test + public void setSurveyInstanceIdTest() { + // Arrange + ImmutableSurveyInstanceQuestionResponse.Json json = new ImmutableSurveyInstanceQuestionResponse.Json(); + + // Act + json.setSurveyInstanceId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyInstanceId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..53d3c295c1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientCreateCommandDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSurveyInstanceRecipientCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstanceRecipientCreateCommand.Json actualJson = new ImmutableSurveyInstanceRecipientCreateCommand.Json(); + + // Assert + assertNull(actualJson.personId); + assertNull(actualJson.surveyInstanceId); + } + @Test + public void setPersonIdTest() { + // Arrange + ImmutableSurveyInstanceRecipientCreateCommand.Json json = new ImmutableSurveyInstanceRecipientCreateCommand.Json(); + + // Act + json.setPersonId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.personId); + } + @Test + public void setSurveyInstanceIdTest() { + // Arrange + ImmutableSurveyInstanceRecipientCreateCommand.Json json = new ImmutableSurveyInstanceRecipientCreateCommand.Json(); + + // Act + json.setSurveyInstanceId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyInstanceId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientDiffblueTest.java new file mode 100644 index 0000000000..e547536179 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientDiffblueTest.java @@ -0,0 +1,34 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableSurveyInstanceRecipientDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstanceRecipient.Json actualJson = new ImmutableSurveyInstanceRecipient.Json(); + + // Assert + assertNull(actualJson.person); + assertNull(actualJson.surveyInstance); + } + + + + @Test + public void setSurveyInstanceTest() { + // Arrange + ImmutableSurveyInstanceRecipient.Json json = new ImmutableSurveyInstanceRecipient.Json(); + ImmutableSurveyInstance.Json json1 = new ImmutableSurveyInstance.Json(); + + // Act + json.setSurveyInstance(json1); + + // Assert + assertSame(json1, json.surveyInstance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientUpdateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientUpdateCommandDiffblueTest.java new file mode 100644 index 0000000000..794bf2adb1 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceRecipientUpdateCommandDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSurveyInstanceRecipientUpdateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyInstanceRecipientUpdateCommand.Json actualJson = new ImmutableSurveyInstanceRecipientUpdateCommand.Json(); + + // Assert + assertNull(actualJson.instanceRecipientId); + assertNull(actualJson.surveyInstanceId); + assertNull(actualJson.personId); + } + @Test + public void setInstanceRecipientIdTest() { + // Arrange + ImmutableSurveyInstanceRecipientUpdateCommand.Json json = new ImmutableSurveyInstanceRecipientUpdateCommand.Json(); + + // Act + json.setInstanceRecipientId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.instanceRecipientId); + } + @Test + public void setPersonIdTest() { + // Arrange + ImmutableSurveyInstanceRecipientUpdateCommand.Json json = new ImmutableSurveyInstanceRecipientUpdateCommand.Json(); + + // Act + json.setPersonId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.personId); + } + @Test + public void setSurveyInstanceIdTest() { + // Arrange + ImmutableSurveyInstanceRecipientUpdateCommand.Json json = new ImmutableSurveyInstanceRecipientUpdateCommand.Json(); + + // Act + json.setSurveyInstanceId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyInstanceId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceStatusChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceStatusChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..a14d837da9 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyInstanceStatusChangeCommandDiffblueTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSurveyInstanceStatusChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableSurveyInstanceStatusChangeCommand.Json()).newStatus); + } + @Test + public void setNewStatusTest() { + // Arrange + ImmutableSurveyInstanceStatusChangeCommand.Json json = new ImmutableSurveyInstanceStatusChangeCommand.Json(); + + // Act + json.setNewStatus(SurveyInstanceStatus.NOT_STARTED); + + // Assert + assertEquals(SurveyInstanceStatus.NOT_STARTED, json.newStatus); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDiffblueTest.java new file mode 100644 index 0000000000..83095bee89 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDiffblueTest.java @@ -0,0 +1,90 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.ExternalIdProvider; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSurveyQuestionDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyQuestion.Json actualJson = new ImmutableSurveyQuestion.Json(); + + // Assert + Optional optional = actualJson.helpText; + assertSame(optional, actualJson.sectionName); + assertSame(optional, actualJson.id); + assertSame(optional, actualJson.externalId); + } + @Test + public void setAllowCommentTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setAllowComment(true); + + // Assert + assertEquals(Boolean.valueOf(true), json.allowComment); + } + @Test + public void setFieldTypeTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setFieldType(SurveyQuestionFieldType.APPLICATION); + + // Assert + assertEquals(SurveyQuestionFieldType.APPLICATION, json.fieldType); + } + @Test + public void setIsMandatoryTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setIsMandatory(true); + + // Assert + assertTrue(json.isMandatory); + assertTrue(json.isMandatoryIsSet); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setPosition(1); + + // Assert + assertEquals(Integer.valueOf(1), json.position); + } + @Test + public void setQuestionTextTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setQuestionText("questionText"); + + // Assert + assertEquals("questionText", json.questionText); + } + @Test + public void setSurveyTemplateIdTest() { + // Arrange + ImmutableSurveyQuestion.Json json = new ImmutableSurveyQuestion.Json(); + + // Act + json.setSurveyTemplateId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyTemplateId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDropdownEntryDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDropdownEntryDiffblueTest.java new file mode 100644 index 0000000000..de3265e78f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionDropdownEntryDiffblueTest.java @@ -0,0 +1,41 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableSurveyQuestionDropdownEntryDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyQuestionDropdownEntry.Json actualJson = new ImmutableSurveyQuestionDropdownEntry.Json(); + + // Assert + assertSame(actualJson.questionId, actualJson.id); + } + @Test + public void setPositionTest() { + // Arrange + ImmutableSurveyQuestionDropdownEntry.Json json = new ImmutableSurveyQuestionDropdownEntry.Json(); + + // Act + json.setPosition(1); + + // Assert + assertTrue(json.positionIsSet); + assertEquals(1, json.position); + } + @Test + public void setValueTest() { + // Arrange + ImmutableSurveyQuestionDropdownEntry.Json json = new ImmutableSurveyQuestionDropdownEntry.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionResponseDiffblueTest.java new file mode 100644 index 0000000000..ff247e3c5f --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyQuestionResponseDiffblueTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityReference; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSurveyQuestionResponseDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyQuestionResponse.Json actualJson = new ImmutableSurveyQuestionResponse.Json(); + + // Assert + Optional optional = actualJson.entityResponse; + assertSame(actualJson.stringResponse, optional); + assertSame(optional, actualJson.stringResponse); + assertSame(optional, actualJson.listResponse); + assertSame(optional, actualJson.booleanResponse); + assertSame(optional, actualJson.numberResponse); + assertSame(optional, actualJson.dateResponse); + assertSame(optional, actualJson.comment); + } + @Test + public void setQuestionIdTest() { + // Arrange + ImmutableSurveyQuestionResponse.Json json = new ImmutableSurveyQuestionResponse.Json(); + + // Act + json.setQuestionId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.questionId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..407112d33a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunChangeCommandDiffblueTest.java @@ -0,0 +1,81 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import java.util.HashSet; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSurveyRunChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyRunChangeCommand.Json actualJson = new ImmutableSurveyRunChangeCommand.Json(); + + // Assert + Optional optional = actualJson.contactEmail; + assertSame(actualJson.dueDate, optional); + assertSame(optional, actualJson.dueDate); + assertEquals(0, actualJson.involvementKindIds.size()); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSurveyRunChangeCommand.Json json = new ImmutableSurveyRunChangeCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setInvolvementKindIdsTest() { + // Arrange + ImmutableSurveyRunChangeCommand.Json json = new ImmutableSurveyRunChangeCommand.Json(); + HashSet resultLongSet = new HashSet(); + resultLongSet.add(1L); + + // Act + json.setInvolvementKindIds(resultLongSet); + + // Assert + assertSame(resultLongSet, json.involvementKindIds); + } + @Test + public void setIssuanceKindTest() { + // Arrange + ImmutableSurveyRunChangeCommand.Json json = new ImmutableSurveyRunChangeCommand.Json(); + + // Act + json.setIssuanceKind(SurveyIssuanceKind.GROUP); + + // Assert + assertEquals(SurveyIssuanceKind.GROUP, json.issuanceKind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSurveyRunChangeCommand.Json json = new ImmutableSurveyRunChangeCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setSurveyTemplateIdTest() { + // Arrange + ImmutableSurveyRunChangeCommand.Json json = new ImmutableSurveyRunChangeCommand.Json(); + + // Act + json.setSurveyTemplateId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyTemplateId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCompletionRateDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCompletionRateDiffblueTest.java new file mode 100644 index 0000000000..4384d4a04a --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCompletionRateDiffblueTest.java @@ -0,0 +1,79 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableSurveyRunCompletionRateDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyRunCompletionRate.Json actualJson = new ImmutableSurveyRunCompletionRate.Json(); + + // Assert + assertFalse(actualJson.inProgressCountIsSet); + assertFalse(actualJson.surveyRunIdIsSet); + assertEquals(0L, actualJson.surveyRunId); + assertEquals(0, actualJson.inProgressCount); + assertFalse(actualJson.notStartedCountIsSet); + assertEquals(0, actualJson.completedCount); + assertEquals(0, actualJson.notStartedCount); + assertFalse(actualJson.completedCountIsSet); + } + + + @Test + public void setCompletedCountTest() { + // Arrange + ImmutableSurveyRunCompletionRate.Json json = new ImmutableSurveyRunCompletionRate.Json(); + + // Act + json.setCompletedCount(3); + + // Assert + assertEquals(3, json.completedCount); + assertTrue(json.completedCountIsSet); + } + + @Test + public void setInProgressCountTest() { + // Arrange + ImmutableSurveyRunCompletionRate.Json json = new ImmutableSurveyRunCompletionRate.Json(); + + // Act + json.setInProgressCount(3); + + // Assert + assertTrue(json.inProgressCountIsSet); + assertEquals(3, json.inProgressCount); + } + + @Test + public void setNotStartedCountTest() { + // Arrange + ImmutableSurveyRunCompletionRate.Json json = new ImmutableSurveyRunCompletionRate.Json(); + + // Act + json.setNotStartedCount(3); + + // Assert + assertTrue(json.notStartedCountIsSet); + assertEquals(3, json.notStartedCount); + } + + @Test + public void setSurveyRunIdTest() { + // Arrange + ImmutableSurveyRunCompletionRate.Json json = new ImmutableSurveyRunCompletionRate.Json(); + + // Act + json.setSurveyRunId(123L); + + // Assert + assertTrue(json.surveyRunIdIsSet); + assertEquals(123L, json.surveyRunId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCreateCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCreateCommandDiffblueTest.java new file mode 100644 index 0000000000..ac251f3617 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunCreateCommandDiffblueTest.java @@ -0,0 +1,82 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import java.time.LocalDate; +import java.util.HashSet; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSurveyRunCreateCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyRunCreateCommand.Json actualJson = new ImmutableSurveyRunCreateCommand.Json(); + + // Assert + Optional actualOptional = actualJson.contactEmail; + Optional expectedOptional = actualJson.dueDate; + assertEquals(0, actualJson.involvementKindIds.size()); + assertSame(expectedOptional, actualOptional); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSurveyRunCreateCommand.Json json = new ImmutableSurveyRunCreateCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setInvolvementKindIdsTest() { + // Arrange + ImmutableSurveyRunCreateCommand.Json json = new ImmutableSurveyRunCreateCommand.Json(); + HashSet resultLongSet = new HashSet(); + resultLongSet.add(1L); + + // Act + json.setInvolvementKindIds(resultLongSet); + + // Assert + assertSame(resultLongSet, json.involvementKindIds); + } + @Test + public void setIssuanceKindTest() { + // Arrange + ImmutableSurveyRunCreateCommand.Json json = new ImmutableSurveyRunCreateCommand.Json(); + + // Act + json.setIssuanceKind(SurveyIssuanceKind.GROUP); + + // Assert + assertEquals(SurveyIssuanceKind.GROUP, json.issuanceKind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSurveyRunCreateCommand.Json json = new ImmutableSurveyRunCreateCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setSurveyTemplateIdTest() { + // Arrange + ImmutableSurveyRunCreateCommand.Json json = new ImmutableSurveyRunCreateCommand.Json(); + + // Act + json.setSurveyTemplateId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyTemplateId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunDiffblueTest.java new file mode 100644 index 0000000000..267e884bc5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunDiffblueTest.java @@ -0,0 +1,115 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.NameProvider; +import java.time.LocalDate; +import java.util.HashSet; +import java.util.Optional; +import org.junit.Test; + +public class ImmutableSurveyRunDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyRun.Json actualJson = new ImmutableSurveyRun.Json(); + + // Assert + Optional actualOptional = actualJson.id; + Optional expectedOptional = actualJson.issuedOn; + assertEquals(0, actualJson.involvementKindIds.size()); + assertSame(expectedOptional, actualOptional); + } + @Test + public void setContactEmailTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setContactEmail("contactEmail"); + + // Assert + assertEquals("contactEmail", json.contactEmail); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setInvolvementKindIdsTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + HashSet resultLongSet = new HashSet(); + resultLongSet.add(1L); + + // Act + json.setInvolvementKindIds(resultLongSet); + + // Assert + assertSame(resultLongSet, json.involvementKindIds); + } + @Test + public void setIssuanceKindTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setIssuanceKind(SurveyIssuanceKind.GROUP); + + // Assert + assertEquals(SurveyIssuanceKind.GROUP, json.issuanceKind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOwnerIdTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setOwnerId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.ownerId); + } + @Test + public void setStatusTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setStatus(SurveyRunStatus.DRAFT); + + // Assert + assertEquals(SurveyRunStatus.DRAFT, json.status); + } + @Test + public void setSurveyTemplateIdTest() { + // Arrange + ImmutableSurveyRun.Json json = new ImmutableSurveyRun.Json(); + + // Act + json.setSurveyTemplateId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.surveyTemplateId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunStatusChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunStatusChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..c257053c25 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunStatusChangeCommandDiffblueTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableSurveyRunStatusChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableSurveyRunStatusChangeCommand.Json()).newStatus); + } + @Test + public void setNewStatusTest() { + // Arrange + ImmutableSurveyRunStatusChangeCommand.Json json = new ImmutableSurveyRunStatusChangeCommand.Json(); + + // Act + json.setNewStatus(SurveyRunStatus.DRAFT); + + // Assert + assertEquals(SurveyRunStatus.DRAFT, json.newStatus); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunWithOwnerAndStatsDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunWithOwnerAndStatsDiffblueTest.java new file mode 100644 index 0000000000..0392322d68 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyRunWithOwnerAndStatsDiffblueTest.java @@ -0,0 +1,43 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import org.junit.Test; + +public class ImmutableSurveyRunWithOwnerAndStatsDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyRunWithOwnerAndStats.Json actualJson = new ImmutableSurveyRunWithOwnerAndStats.Json(); + + // Assert + assertNull(actualJson.completionRateStats); + assertNull(actualJson.owner); + assertNull(actualJson.surveyRun); + } + @Test + public void setCompletionRateStatsTest() { + // Arrange + ImmutableSurveyRunWithOwnerAndStats.Json json = new ImmutableSurveyRunWithOwnerAndStats.Json(); + ImmutableSurveyRunCompletionRate.Json json1 = new ImmutableSurveyRunCompletionRate.Json(); + + // Act + json.setCompletionRateStats(json1); + + // Assert + assertSame(json1, json.completionRateStats); + } + @Test + public void setSurveyRunTest() { + // Arrange + ImmutableSurveyRunWithOwnerAndStats.Json json = new ImmutableSurveyRunWithOwnerAndStats.Json(); + ImmutableSurveyRun.Json json1 = new ImmutableSurveyRun.Json(); + + // Act + json.setSurveyRun(json1); + + // Assert + assertSame(json1, json.surveyRun); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..c0c8312e49 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateChangeCommandDiffblueTest.java @@ -0,0 +1,55 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableSurveyTemplateChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyTemplateChangeCommand.Json actualJson = new ImmutableSurveyTemplateChangeCommand.Json(); + + // Assert + assertNull(actualJson.targetEntityKind); + assertNull(actualJson.name); + assertNull(actualJson.description); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSurveyTemplateChangeCommand.Json json = new ImmutableSurveyTemplateChangeCommand.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSurveyTemplateChangeCommand.Json json = new ImmutableSurveyTemplateChangeCommand.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setTargetEntityKindTest() { + // Arrange + ImmutableSurveyTemplateChangeCommand.Json json = new ImmutableSurveyTemplateChangeCommand.Json(); + + // Act + json.setTargetEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.targetEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateDiffblueTest.java new file mode 100644 index 0000000000..0ee0072e6d --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/survey/ImmutableSurveyTemplateDiffblueTest.java @@ -0,0 +1,81 @@ +package com.khartec.waltz.model.survey; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.NameProvider; +import com.khartec.waltz.model.ReleaseLifecycleStatus; +import org.junit.Test; + +public class ImmutableSurveyTemplateDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSurveyTemplate.Json actualJson = new ImmutableSurveyTemplate.Json(); + + // Assert + assertNull(actualJson.createdAt); + assertNull(actualJson.name); + assertNull(actualJson.description); + assertNull(actualJson.ownerId); + assertNull(actualJson.targetEntityKind); + assertNull(actualJson.status); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSurveyTemplate.Json json = new ImmutableSurveyTemplate.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSurveyTemplate.Json json = new ImmutableSurveyTemplate.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setOwnerIdTest() { + // Arrange + ImmutableSurveyTemplate.Json json = new ImmutableSurveyTemplate.Json(); + + // Act + json.setOwnerId(123L); + + // Assert + assertEquals(Long.valueOf(123L), json.ownerId); + } + @Test + public void setStatusTest() { + // Arrange + ImmutableSurveyTemplate.Json json = new ImmutableSurveyTemplate.Json(); + + // Act + json.setStatus(ReleaseLifecycleStatus.DRAFT); + + // Assert + assertEquals(ReleaseLifecycleStatus.DRAFT, json.status); + } + @Test + public void setTargetEntityKindTest() { + // Arrange + ImmutableSurveyTemplate.Json json = new ImmutableSurveyTemplate.Json(); + + // Act + json.setTargetEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.targetEntityKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/svg/ImmutableSvgDiagramDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/svg/ImmutableSvgDiagramDiffblueTest.java new file mode 100644 index 0000000000..0afb5a3f22 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/svg/ImmutableSvgDiagramDiffblueTest.java @@ -0,0 +1,131 @@ +package com.khartec.waltz.model.svg; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableSvgDiagramDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableSvgDiagram.Json actualJson = new ImmutableSvgDiagram.Json(); + + // Assert + assertNull(actualJson.displayWidthPercent); + assertNull(actualJson.name); + assertNull(actualJson.displayHeightPercent); + assertNull(actualJson.description); + assertEquals(0, actualJson.priority); + assertNull(actualJson.svg); + assertFalse(actualJson.priorityIsSet); + assertNull(actualJson.group); + assertNull(actualJson.product); + assertNull(actualJson.keyProperty); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setDisplayHeightPercentTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setDisplayHeightPercent(1); + + // Assert + assertEquals(Integer.valueOf(1), json.displayHeightPercent); + } + @Test + public void setDisplayWidthPercentTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setDisplayWidthPercent(1); + + // Assert + assertEquals(Integer.valueOf(1), json.displayWidthPercent); + } + @Test + public void setGroupTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setGroup("group"); + + // Assert + assertEquals("group", json.group); + } + @Test + public void setKeyPropertyTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setKeyProperty("keyProperty"); + + // Assert + assertEquals("keyProperty", json.keyProperty); + } + @Test + public void setNameTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setPriorityTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setPriority(1); + + // Assert + assertEquals(1, json.priority); + assertTrue(json.priorityIsSet); + } + @Test + public void setProductTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setProduct("product"); + + // Assert + assertEquals("product", json.product); + } + @Test + public void setSvgTest() { + // Arrange + ImmutableSvgDiagram.Json json = new ImmutableSvgDiagram.Json(); + + // Act + json.setSvg("svg"); + + // Assert + assertEquals("svg", json.svg); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/system/job_log/ImmutableJobLogDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/system/job_log/ImmutableJobLogDiffblueTest.java new file mode 100644 index 0000000000..3427daec70 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/system/job_log/ImmutableJobLogDiffblueTest.java @@ -0,0 +1,68 @@ +package com.khartec.waltz.model.system.job_log; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.NameProvider; +import org.junit.Test; + +public class ImmutableJobLogDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableJobLog.Json actualJson = new ImmutableJobLog.Json(); + + // Assert + assertNull(actualJson.entityKind); + assertNull(actualJson.description); + assertNull(actualJson.start); + assertNull(actualJson.name); + assertNull(actualJson.status); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableJobLog.Json json = new ImmutableJobLog.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setEntityKindTest() { + // Arrange + ImmutableJobLog.Json json = new ImmutableJobLog.Json(); + + // Act + json.setEntityKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.entityKind); + } + @Test + public void setNameTest() { + // Arrange + ImmutableJobLog.Json json = new ImmutableJobLog.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + @Test + public void setStatusTest() { + // Arrange + ImmutableJobLog.Json json = new ImmutableJobLog.Json(); + + // Act + json.setStatus(JobStatus.SUCCESS); + + // Assert + assertEquals(JobStatus.SUCCESS, json.status); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagDiffblueTest.java new file mode 100644 index 0000000000..265af94de5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagDiffblueTest.java @@ -0,0 +1,60 @@ +package com.khartec.waltz.model.tag; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.EntityKind; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.NameProvider; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableTagDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableTag.Json()).tagUsages.size()); + } + + + + + @Test + public void setNameTest() { + // Arrange + ImmutableTag.Json json = new ImmutableTag.Json(); + + // Act + json.setName("name"); + + // Assert + assertEquals("name", json.name); + } + + @Test + public void setTagUsagesTest() { + // Arrange + ImmutableTag.Json json = new ImmutableTag.Json(); + HashSet tagUsageSet = new HashSet(); + tagUsageSet.add(new ImmutableTagUsage.Json()); + + // Act + json.setTagUsages(tagUsageSet); + + // Assert + assertSame(tagUsageSet, json.tagUsages); + } + + @Test + public void setTargetKindTest() { + // Arrange + ImmutableTag.Json json = new ImmutableTag.Json(); + + // Act + json.setTargetKind(EntityKind.ACTOR); + + // Assert + assertEquals(EntityKind.ACTOR, json.targetKind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagUsageDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagUsageDiffblueTest.java new file mode 100644 index 0000000000..5a787b3e0b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tag/ImmutableTagUsageDiffblueTest.java @@ -0,0 +1,69 @@ +package com.khartec.waltz.model.tag; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import com.khartec.waltz.model.CreatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import com.khartec.waltz.model.WaltzEntity; +import org.junit.Test; + +public class ImmutableTagUsageDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableTagUsage.Json actualJson = new ImmutableTagUsage.Json(); + + // Assert + assertNull(actualJson.createdBy); + assertNull(actualJson.provenance); + assertNull(actualJson.createdAt); + assertFalse(actualJson.tagIdIsSet); + assertNull(actualJson.entityReference); + assertEquals(0L, actualJson.tagId); + } + + + + + + @Test + public void setCreatedByTest() { + // Arrange + ImmutableTagUsage.Json json = new ImmutableTagUsage.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableTagUsage.Json json = new ImmutableTagUsage.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } + + @Test + public void setTagIdTest() { + // Arrange + ImmutableTagUsage.Json json = new ImmutableTagUsage.Json(); + + // Act + json.setTagId(123L); + + // Assert + assertTrue(json.tagIdIsSet); + assertEquals(123L, json.tagId); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableMeasurableRatingTallyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableMeasurableRatingTallyDiffblueTest.java new file mode 100644 index 0000000000..69a1fe274b --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableMeasurableRatingTallyDiffblueTest.java @@ -0,0 +1,59 @@ +package com.khartec.waltz.model.tally; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableMeasurableRatingTallyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableMeasurableRatingTally.Json actualJson = new ImmutableMeasurableRatingTally.Json(); + + // Assert + assertFalse(actualJson.idIsSet); + assertFalse(actualJson.countIsSet); + assertFalse(actualJson.ratingIsSet); + assertEquals(0L, actualJson.count); + assertEquals('\u0000', actualJson.rating); + assertEquals(0L, actualJson.id); + } + @Test + public void setCountTest() { + // Arrange + ImmutableMeasurableRatingTally.Json json = new ImmutableMeasurableRatingTally.Json(); + + // Act + json.setCount(3L); + + // Assert + assertTrue(json.countIsSet); + assertEquals(3L, json.count); + } + @Test + public void setIdTest() { + // Arrange + ImmutableMeasurableRatingTally.Json json = new ImmutableMeasurableRatingTally.Json(); + + // Act + json.setId(123L); + + // Assert + assertTrue(json.idIsSet); + assertEquals(123L, json.id); + } + @Test + public void setRatingTest() { + // Arrange + ImmutableMeasurableRatingTally.Json json = new ImmutableMeasurableRatingTally.Json(); + + // Act + json.setRating('A'); + + // Assert + assertTrue(json.ratingIsSet); + assertEquals('A', json.rating); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableOrderedTallyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableOrderedTallyDiffblueTest.java new file mode 100644 index 0000000000..b3c6de9ffb --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableOrderedTallyDiffblueTest.java @@ -0,0 +1,58 @@ +package com.khartec.waltz.model.tally; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableOrderedTallyDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableOrderedTally.Json actualJson = new ImmutableOrderedTally.Json(); + + // Assert + assertFalse(actualJson.indexIsSet); + assertFalse(actualJson.countIsSet); + assertNull(actualJson.id); + assertEquals(0.0, actualJson.count, 0.0); + assertEquals(0, actualJson.index); + } + @Test + public void setCountTest() { + // Arrange + ImmutableOrderedTally.Json json = new ImmutableOrderedTally.Json(); + + // Act + json.setCount(10.0); + + // Assert + assertTrue(json.countIsSet); + assertEquals(10.0, json.count, 0.0); + } + @Test + public void setIdTest() { + // Arrange + ImmutableOrderedTally.Json json = new ImmutableOrderedTally.Json(); + + // Act + json.setId("123"); + + // Assert + assertTrue(json.id instanceof String); + } + @Test + public void setIndexTest() { + // Arrange + ImmutableOrderedTally.Json json = new ImmutableOrderedTally.Json(); + + // Act + json.setIndex(1); + + // Assert + assertTrue(json.indexIsSet); + assertEquals(1, json.index); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyDiffblueTest.java new file mode 100644 index 0000000000..da6c148791 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyDiffblueTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.tally; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableTallyDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableTally.Json actualJson = new ImmutableTally.Json(); + + // Assert + assertFalse(actualJson.countIsSet); + assertNull(actualJson.id); + assertEquals(0.0, actualJson.count, 0.0); + } + + @Test + public void setCountTest() { + // Arrange + ImmutableTally.Json json = new ImmutableTally.Json(); + + // Act + json.setCount(10.0); + + // Assert + assertTrue(json.countIsSet); + assertEquals(10.0, json.count, 0.0); + } + + @Test + public void setIdTest() { + // Arrange + ImmutableTally.Json json = new ImmutableTally.Json(); + + // Act + json.setId("123"); + + // Assert + assertTrue(json.id instanceof String); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyPackDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyPackDiffblueTest.java new file mode 100644 index 0000000000..e241d1b701 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/tally/ImmutableTallyPackDiffblueTest.java @@ -0,0 +1,28 @@ +package com.khartec.waltz.model.tally; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableTallyPackDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableTallyPack.Json()).tallies.size()); + } + @Test + public void setTalliesTest() { + // Arrange + ImmutableTallyPack.Json json = new ImmutableTallyPack.Json(); + ArrayList> tallyList = new ArrayList>(); + tallyList.add(new ImmutableOrderedTally.Json()); + + // Act + json.setTallies(tallyList); + + // Assert + assertSame(tallyList, json.tallies); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeCommandDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeCommandDiffblueTest.java new file mode 100644 index 0000000000..b033d449ac --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeCommandDiffblueTest.java @@ -0,0 +1,76 @@ +package com.khartec.waltz.model.taxonomy_management; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.CreatedProvider; +import com.khartec.waltz.model.IdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import java.util.HashMap; +import org.junit.Test; + +public class ImmutableTaxonomyChangeCommandDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertNull((new ImmutableTaxonomyChangeCommand.Json()).params); + } + @Test + public void setChangeTypeTest() { + // Arrange + ImmutableTaxonomyChangeCommand.Json json = new ImmutableTaxonomyChangeCommand.Json(); + + // Act + json.setChangeType(TaxonomyChangeType.ADD_PEER); + + // Assert + assertEquals(TaxonomyChangeType.ADD_PEER, json.changeType); + } + @Test + public void setCreatedByTest() { + // Arrange + ImmutableTaxonomyChangeCommand.Json json = new ImmutableTaxonomyChangeCommand.Json(); + + // Act + json.setCreatedBy("createdBy"); + + // Assert + assertEquals("createdBy", json.createdBy); + } + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableTaxonomyChangeCommand.Json json = new ImmutableTaxonomyChangeCommand.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + @Test + public void setParamsTest() { + // Arrange + ImmutableTaxonomyChangeCommand.Json json = new ImmutableTaxonomyChangeCommand.Json(); + HashMap stringStringMap = new HashMap(); + stringStringMap.put("foo", "foo"); + + // Act + json.setParams(stringStringMap); + + // Assert + assertSame(stringStringMap, json.params); + } + @Test + public void setStatusTest() { + // Arrange + ImmutableTaxonomyChangeCommand.Json json = new ImmutableTaxonomyChangeCommand.Json(); + + // Act + json.setStatus(TaxonomyChangeLifecycleStatus.DRAFT); + + // Assert + assertEquals(TaxonomyChangeLifecycleStatus.DRAFT, json.status); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeImpactDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeImpactDiffblueTest.java new file mode 100644 index 0000000000..33e30104c4 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangeImpactDiffblueTest.java @@ -0,0 +1,53 @@ +package com.khartec.waltz.model.taxonomy_management; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.DescriptionProvider; +import com.khartec.waltz.model.EntityReference; +import com.khartec.waltz.model.Severity; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableTaxonomyChangeImpactDiffblueTest { + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableTaxonomyChangeImpact.Json()).impactedReferences.size()); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableTaxonomyChangeImpact.Json json = new ImmutableTaxonomyChangeImpact.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setImpactedReferencesTest() { + // Arrange + ImmutableTaxonomyChangeImpact.Json json = new ImmutableTaxonomyChangeImpact.Json(); + HashSet entityReferenceSet = new HashSet(); + entityReferenceSet.add(null); + + // Act + json.setImpactedReferences(entityReferenceSet); + + // Assert + assertSame(entityReferenceSet, json.impactedReferences); + } + @Test + public void setSeverityTest() { + // Arrange + ImmutableTaxonomyChangeImpact.Json json = new ImmutableTaxonomyChangeImpact.Json(); + + // Act + json.setSeverity(Severity.INFORMATION); + + // Assert + assertEquals(Severity.INFORMATION, json.severity); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangePreviewDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangePreviewDiffblueTest.java new file mode 100644 index 0000000000..c4457c0458 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/taxonomy_management/ImmutableTaxonomyChangePreviewDiffblueTest.java @@ -0,0 +1,44 @@ +package com.khartec.waltz.model.taxonomy_management; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import java.util.ArrayList; +import org.junit.Test; + +public class ImmutableTaxonomyChangePreviewDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableTaxonomyChangePreview.Json()).impacts.size()); + } + + + @Test + public void setCommandTest() { + // Arrange + ImmutableTaxonomyChangePreview.Json json = new ImmutableTaxonomyChangePreview.Json(); + ImmutableTaxonomyChangeCommand.Json json1 = new ImmutableTaxonomyChangeCommand.Json(); + + // Act + json.setCommand(json1); + + // Assert + assertSame(json1, json.command); + } + + @Test + public void setImpactsTest() { + // Arrange + ImmutableTaxonomyChangePreview.Json json = new ImmutableTaxonomyChangePreview.Json(); + ArrayList taxonomyChangeImpactList = new ArrayList(); + taxonomyChangeImpactList.add(new ImmutableTaxonomyChangeImpact.Json()); + + // Act + json.setImpacts(taxonomyChangeImpactList); + + // Assert + assertSame(taxonomyChangeImpactList, json.impacts); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/thumbnail/ImmutableThumbnailDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/thumbnail/ImmutableThumbnailDiffblueTest.java new file mode 100644 index 0000000000..a0319ce512 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/thumbnail/ImmutableThumbnailDiffblueTest.java @@ -0,0 +1,82 @@ +package com.khartec.waltz.model.thumbnail; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.ExternalIdProvider; +import com.khartec.waltz.model.LastUpdatedProvider; +import com.khartec.waltz.model.ProvenanceProvider; +import java.util.Arrays; +import org.junit.Test; + +public class ImmutableThumbnailDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableThumbnail.Json actualJson = new ImmutableThumbnail.Json(); + + // Assert + assertNull(actualJson.lastUpdatedAt); + assertNull(actualJson.mimeType); + assertNull(actualJson.lastUpdatedBy); + assertNull(actualJson.blob); + assertNull(actualJson.provenance); + assertNull(actualJson.parentEntityReference); + } + + + + + + @Test + public void setBlobTest() { + // Arrange + byte[] byteArray = new byte[24]; + Arrays.fill(byteArray, (byte) 88); + ImmutableThumbnail.Json json = new ImmutableThumbnail.Json(); + + // Act + json.setBlob(byteArray); + + // Assert + assertSame(byteArray, json.blob); + } + + @Test + public void setLastUpdatedByTest() { + // Arrange + ImmutableThumbnail.Json json = new ImmutableThumbnail.Json(); + + // Act + json.setLastUpdatedBy("lastUpdatedBy"); + + // Assert + assertEquals("lastUpdatedBy", json.lastUpdatedBy); + } + + @Test + public void setMimeTypeTest() { + // Arrange + ImmutableThumbnail.Json json = new ImmutableThumbnail.Json(); + + // Act + json.setMimeType("mimeType"); + + // Assert + assertEquals("mimeType", json.mimeType); + } + + @Test + public void setProvenanceTest() { + // Arrange + ImmutableThumbnail.Json json = new ImmutableThumbnail.Json(); + + // Act + json.setProvenance("provenance"); + + // Assert + assertEquals("provenance", json.provenance); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/usage_info/ImmutableUsageInfoDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/usage_info/ImmutableUsageInfoDiffblueTest.java new file mode 100644 index 0000000000..4c10bf9419 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/usage_info/ImmutableUsageInfoDiffblueTest.java @@ -0,0 +1,56 @@ +package com.khartec.waltz.model.usage_info; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableUsageInfoDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUsageInfo.Json actualJson = new ImmutableUsageInfo.Json(); + + // Assert + assertNull(actualJson.kind); + assertFalse(actualJson.isSelected); + assertNull(actualJson.description); + assertFalse(actualJson.isSelectedIsSet); + } + @Test + public void setDescriptionTest() { + // Arrange + ImmutableUsageInfo.Json json = new ImmutableUsageInfo.Json(); + + // Act + json.setDescription("description"); + + // Assert + assertEquals("description", json.description); + } + @Test + public void setIsSelectedTest() { + // Arrange + ImmutableUsageInfo.Json json = new ImmutableUsageInfo.Json(); + + // Act + json.setIsSelected(true); + + // Assert + assertTrue(json.isSelected); + assertTrue(json.isSelectedIsSet); + } + @Test + public void setKindTest() { + // Arrange + ImmutableUsageInfo.Json json = new ImmutableUsageInfo.Json(); + + // Act + json.setKind(UsageKind.CONSUMER); + + // Assert + assertEquals(UsageKind.CONSUMER, json.kind); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableAuthenticationResponseDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableAuthenticationResponseDiffblueTest.java new file mode 100644 index 0000000000..07db923dc4 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableAuthenticationResponseDiffblueTest.java @@ -0,0 +1,61 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class ImmutableAuthenticationResponseDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableAuthenticationResponse.Json actualJson = new ImmutableAuthenticationResponse.Json(); + + // Assert + assertNull(actualJson.waltzUserName); + assertFalse(actualJson.successIsSet); + assertNull(actualJson.errorMessage); + assertFalse(actualJson.success); + } + + + @Test + public void setErrorMessageTest() { + // Arrange + ImmutableAuthenticationResponse.Json json = new ImmutableAuthenticationResponse.Json(); + + // Act + json.setErrorMessage("An error occurred"); + + // Assert + assertEquals("An error occurred", json.errorMessage); + } + + @Test + public void setSuccessTest() { + // Arrange + ImmutableAuthenticationResponse.Json json = new ImmutableAuthenticationResponse.Json(); + + // Act + json.setSuccess(true); + + // Assert + assertTrue(json.successIsSet); + assertTrue(json.success); + } + + @Test + public void setWaltzUserNameTest() { + // Arrange + ImmutableAuthenticationResponse.Json json = new ImmutableAuthenticationResponse.Json(); + + // Act + json.setWaltzUserName("username"); + + // Assert + assertEquals("username", json.waltzUserName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableLoginRequestDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableLoginRequestDiffblueTest.java new file mode 100644 index 0000000000..cd9eb21c55 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableLoginRequestDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableLoginRequestDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableLoginRequest.Json actualJson = new ImmutableLoginRequest.Json(); + + // Assert + assertNull(actualJson.password); + assertNull(actualJson.userName); + } + @Test + public void setPasswordTest() { + // Arrange + ImmutableLoginRequest.Json json = new ImmutableLoginRequest.Json(); + + // Act + json.setPassword("Password123"); + + // Assert + assertEquals("Password123", json.password); + } + @Test + public void setUserNameTest() { + // Arrange + ImmutableLoginRequest.Json json = new ImmutableLoginRequest.Json(); + + // Act + json.setUserName("username"); + + // Assert + assertEquals("username", json.userName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutablePasswordResetRequestDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutablePasswordResetRequestDiffblueTest.java new file mode 100644 index 0000000000..ea184dc6c5 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutablePasswordResetRequestDiffblueTest.java @@ -0,0 +1,52 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutablePasswordResetRequestDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutablePasswordResetRequest.Json actualJson = new ImmutablePasswordResetRequest.Json(); + + // Assert + assertNull(actualJson.newPassword); + assertNull(actualJson.userName); + assertNull(actualJson.currentPassword); + } + @Test + public void setCurrentPasswordTest() { + // Arrange + ImmutablePasswordResetRequest.Json json = new ImmutablePasswordResetRequest.Json(); + + // Act + json.setCurrentPassword("Password123"); + + // Assert + assertEquals("Password123", json.currentPassword); + } + @Test + public void setNewPasswordTest() { + // Arrange + ImmutablePasswordResetRequest.Json json = new ImmutablePasswordResetRequest.Json(); + + // Act + json.setNewPassword("Password123"); + + // Assert + assertEquals("Password123", json.newPassword); + } + @Test + public void setUserNameTest() { + // Arrange + ImmutablePasswordResetRequest.Json json = new ImmutablePasswordResetRequest.Json(); + + // Act + json.setUserName("username"); + + // Assert + assertEquals("username", json.userName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserDiffblueTest.java new file mode 100644 index 0000000000..0184d147bc --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserDiffblueTest.java @@ -0,0 +1,45 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertSame; +import com.khartec.waltz.model.UserNameProvider; +import java.util.HashSet; +import org.junit.Test; + +public class ImmutableUserDiffblueTest { + + @Test + public void constructorTest() { + // Arrange, Act and Assert + assertEquals(0, (new ImmutableUser.Json()).roles.size()); + } + + + + @Test + public void setRolesTest() { + // Arrange + ImmutableUser.Json json = new ImmutableUser.Json(); + HashSet stringSet = new HashSet(); + stringSet.add("foo"); + + // Act + json.setRoles(stringSet); + + // Assert + assertSame(stringSet, json.roles); + } + + @Test + public void setUserNameTest() { + // Arrange + ImmutableUser.Json json = new ImmutableUser.Json(); + + // Act + json.setUserName("username"); + + // Assert + assertEquals("username", json.userName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserPreferenceDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserPreferenceDiffblueTest.java new file mode 100644 index 0000000000..0241ba7133 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserPreferenceDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUserPreferenceDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUserPreference.Json actualJson = new ImmutableUserPreference.Json(); + + // Assert + assertNull(actualJson.value); + assertNull(actualJson.key); + } + @Test + public void setKeyTest() { + // Arrange + ImmutableUserPreference.Json json = new ImmutableUserPreference.Json(); + + // Act + json.setKey("key"); + + // Assert + assertEquals("key", json.key); + } + @Test + public void setValueTest() { + // Arrange + ImmutableUserPreference.Json json = new ImmutableUserPreference.Json(); + + // Act + json.setValue("value"); + + // Assert + assertEquals("value", json.value); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserRegistrationRequestDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserRegistrationRequestDiffblueTest.java new file mode 100644 index 0000000000..14e846bfa2 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/ImmutableUserRegistrationRequestDiffblueTest.java @@ -0,0 +1,40 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import org.junit.Test; + +public class ImmutableUserRegistrationRequestDiffblueTest { + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUserRegistrationRequest.Json actualJson = new ImmutableUserRegistrationRequest.Json(); + + // Assert + assertNull(actualJson.password); + assertNull(actualJson.userName); + } + @Test + public void setPasswordTest() { + // Arrange + ImmutableUserRegistrationRequest.Json json = new ImmutableUserRegistrationRequest.Json(); + + // Act + json.setPassword("Password123"); + + // Assert + assertEquals("Password123", json.password); + } + @Test + public void setUserNameTest() { + // Arrange + ImmutableUserRegistrationRequest.Json json = new ImmutableUserRegistrationRequest.Json(); + + // Act + json.setUserName("username"); + + // Assert + assertEquals("username", json.userName); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user/SystemRoleDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/SystemRoleDiffblueTest.java new file mode 100644 index 0000000000..51dba4c817 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user/SystemRoleDiffblueTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model.user; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import java.util.Set; +import org.junit.Test; + +public class SystemRoleDiffblueTest { + @Test + public void allNamesTest() { + // Arrange and Act + Set actualAllNamesResult = SystemRole.allNames(); + + // Assert + assertEquals(20, actualAllNamesResult.size()); + assertTrue(actualAllNamesResult.contains("ANONYMOUS")); + assertTrue(actualAllNamesResult.contains("RATING_EDITOR")); + assertTrue(actualAllNamesResult.contains("ORG_UNIT_EDITOR")); + assertTrue(actualAllNamesResult.contains("CAPABILITY_EDITOR")); + assertTrue(actualAllNamesResult.contains("SCENARIO_ADMIN")); + assertTrue(actualAllNamesResult.contains("USER_ADMIN")); + assertTrue(actualAllNamesResult.contains("BOOKMARK_EDITOR")); + assertTrue(actualAllNamesResult.contains("ATTESTATION_ADMIN")); + assertTrue(actualAllNamesResult.contains("TAXONOMY_EDITOR")); + assertTrue(actualAllNamesResult.contains("SURVEY_TEMPLATE_ADMIN")); + assertTrue(actualAllNamesResult.contains("BETA_TESTER")); + } +} + diff --git a/waltz-model/src/dcover/java/com/khartec/waltz/model/user_agent_info/ImmutableUserAgentInfoDiffblueTest.java b/waltz-model/src/dcover/java/com/khartec/waltz/model/user_agent_info/ImmutableUserAgentInfoDiffblueTest.java new file mode 100644 index 0000000000..5e2d2f8258 --- /dev/null +++ b/waltz-model/src/dcover/java/com/khartec/waltz/model/user_agent_info/ImmutableUserAgentInfoDiffblueTest.java @@ -0,0 +1,86 @@ +package com.khartec.waltz.model.user_agent_info; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import com.khartec.waltz.model.UserNameProvider; +import org.junit.Test; + +public class ImmutableUserAgentInfoDiffblueTest { + + @Test + public void constructorTest() { + // Arrange and Act + ImmutableUserAgentInfo.Json actualJson = new ImmutableUserAgentInfo.Json(); + + // Assert + assertNull(actualJson.userName); + assertNull(actualJson.ipAddress); + assertNull(actualJson.userAgent); + assertNull(actualJson.operatingSystem); + assertNull(actualJson.resolution); + assertNull(actualJson.loginTimestamp); + } + + + + @Test + public void setIpAddressTest() { + // Arrange + ImmutableUserAgentInfo.Json json = new ImmutableUserAgentInfo.Json(); + + // Act + json.setIpAddress("ipAddress"); + + // Assert + assertEquals("ipAddress", json.ipAddress); + } + + @Test + public void setOperatingSystemTest() { + // Arrange + ImmutableUserAgentInfo.Json json = new ImmutableUserAgentInfo.Json(); + + // Act + json.setOperatingSystem("operatingSystem"); + + // Assert + assertEquals("operatingSystem", json.operatingSystem); + } + + @Test + public void setResolutionTest() { + // Arrange + ImmutableUserAgentInfo.Json json = new ImmutableUserAgentInfo.Json(); + + // Act + json.setResolution("resolution"); + + // Assert + assertEquals("resolution", json.resolution); + } + + @Test + public void setUserAgentTest() { + // Arrange + ImmutableUserAgentInfo.Json json = new ImmutableUserAgentInfo.Json(); + + // Act + json.setUserAgent("userAgent"); + + // Assert + assertEquals("userAgent", json.userAgent); + } + + @Test + public void setUserNameTest() { + // Arrange + ImmutableUserAgentInfo.Json json = new ImmutableUserAgentInfo.Json(); + + // Act + json.setUserName("username"); + + // Assert + assertEquals("username", json.userName); + } +} + From 321ca4cd5cda3c8b4a7a34de267168173517f012 Mon Sep 17 00:00:00 2001 From: Thomas Perkins Date: Thu, 5 Mar 2020 17:08:45 +0000 Subject: [PATCH 4/4] Add jcover tests for "waltz-model" Coverage: 44.7% --- waltz-model/pom.xml | 7 +++ .../waltz/model/ApprovalStatusTest.java | 25 ++++++++++ .../waltz/model/AxisOrientationTest.java | 22 +++++++++ .../khartec/waltz/model/CriticalityTest.java | 29 ++++++++++++ .../com/khartec/waltz/model/DurationTest.java | 32 +++++++++++++ .../waltz/model/EndOfLifeStatusTest.java | 30 ++++++++++++ .../khartec/waltz/model/EntityKindTest.java | 17 +++++++ .../model/EntityLifecycleStatusTest.java | 29 ++++++++++++ .../waltz/model/EntityLinkUtilitiesTest.java | 25 ++++++++++ .../waltz/model/FieldDataTypeTest.java | 28 +++++++++++ .../waltz/model/FlowDirectionTest.java | 23 +++++++++ .../waltz/model/FreshnessIndicatorTest.java | 24 ++++++++++ .../waltz/model/HierarchyQueryScopeTest.java | 33 +++++++++++++ .../waltz/model/IdSelectionOptionsTest.java | 20 ++++++++ .../waltz/model/LifecycleStatusTest.java | 25 ++++++++++ .../khartec/waltz/model/OperationTest.java | 25 ++++++++++ .../com/khartec/waltz/model/QuarterTest.java | 29 ++++++++++++ .../model/ReleaseLifecycleStatusTest.java | 24 ++++++++++ .../com/khartec/waltz/model/SeverityTest.java | 23 +++++++++ .../model/app_group/AppGroupKindTest.java | 22 +++++++++ .../app_group/AppGroupMemberRoleTest.java | 22 +++++++++ .../application/ApplicationKindTest.java | 27 +++++++++++ .../AssetCodeRelationshipKindTest.java | 25 ++++++++++ .../model/application/LifecyclePhaseTest.java | 24 ++++++++++ .../AssessmentVisibilityTest.java | 22 +++++++++ .../ChangeInitiativeKindTest.java | 23 +++++++++ .../model/change_unit/ChangeActionTest.java | 23 +++++++++ .../change_unit/ExecutionStatusTest.java | 23 +++++++++ .../waltz/model/checkpoint/GoalTypeTest.java | 24 ++++++++++ .../model/command/CommandOutcomeTest.java | 22 +++++++++ .../model/complexity/ComplexityKindTest.java | 24 ++++++++++ .../DirectionalityTest.java | 23 +++++++++ .../RelationshipKindTest.java | 37 +++++++++++++++ .../entity_statistic/RollupKindTest.java | 24 ++++++++++ .../StatisticCategoryTest.java | 26 ++++++++++ .../entity_statistic/StatisticTypeTest.java | 25 ++++++++++ .../StatisticValueStateTest.java | 23 +++++++++ .../model/enum_value/EnumValueKindTest.java | 34 ++++++++++++++ .../NotAuthorizedExceptionTest.java | 24 ++++++++++ .../MeasurableRelationshipKindTest.java | 22 +++++++++ .../waltz/model/orphan/OrphanSideTest.java | 23 +++++++++ .../sample/SampleTypeTest.java | 22 +++++++++ .../waltz/model/person/PersonKindTest.java | 23 +++++++++ .../physical_flow/FrequencyKindTest.java | 29 ++++++++++++ .../ParticipationKindTest.java | 23 +++++++++ .../DataFormatKindTest.java | 42 +++++++++++++++++ .../PhysicalSpecDefinitionTypeTest.java | 20 ++++++++ .../rating/AuthoritativenessRatingTest.java | 24 ++++++++++ .../waltz/model/rating/RagRatingTest.java | 25 ++++++++++ .../waltz/model/rating/RatingSchemeTest.java | 20 ++++++++ .../model/scenario/ScenarioTypeTest.java | 23 +++++++++ .../waltz/model/scheduled_job/JobKeyTest.java | 32 +++++++++++++ .../scheduled_job/JobLifecycleStatusTest.java | 24 ++++++++++ .../software_catalog/MaturityStatusTest.java | 27 +++++++++++ .../model/staticpanel/ContentKindTest.java | 22 +++++++++ .../survey/SurveyInstanceStatusTest.java | 26 ++++++++++ .../model/survey/SurveyIssuanceKindTest.java | 22 +++++++++ .../survey/SurveyQuestionFieldTypeTest.java | 29 ++++++++++++ .../model/survey/SurveyRunStatusTest.java | 23 +++++++++ .../model/system/job_log/JobStatusTest.java | 23 +++++++++ .../TaxonomyChangeLifecycleStatusTest.java | 24 ++++++++++ .../TaxonomyChangeTypeTest.java | 30 ++++++++++++ .../waltz/model/usage_info/UsageKindTest.java | 30 ++++++++++++ .../waltz/model/user/SystemRoleTest.java | 47 +++++++++++++++++++ .../waltz/model/utils/IdUtilitiesTest.java | 31 ++++++++++++ 65 files changed, 1653 insertions(+) create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/ApprovalStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/AxisOrientationTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/CriticalityTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/DurationTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/EndOfLifeStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/EntityKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLifecycleStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLinkUtilitiesTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/FieldDataTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/FlowDirectionTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/FreshnessIndicatorTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/HierarchyQueryScopeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/IdSelectionOptionsTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/LifecycleStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/OperationTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/QuarterTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/ReleaseLifecycleStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/SeverityTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupMemberRoleTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/application/ApplicationKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/application/AssetCodeRelationshipKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/application/LifecyclePhaseTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/assessment_definition/AssessmentVisibilityTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/change_initiative/ChangeInitiativeKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ChangeActionTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ExecutionStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/checkpoint/GoalTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/command/CommandOutcomeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/complexity/ComplexityKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/DirectionalityTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/RelationshipKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/RollupKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticCategoryTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticValueStateTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/enum_value/EnumValueKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/measurable_relationship/MeasurableRelationshipKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/orphan/OrphanSideTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/performance_metric/sample/SampleTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/person/PersonKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow/FrequencyKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow_participant/ParticipationKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification/DataFormatKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification_definition/PhysicalSpecDefinitionTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/rating/AuthoritativenessRatingTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RagRatingTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RatingSchemeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/scenario/ScenarioTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobKeyTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobLifecycleStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/software_catalog/MaturityStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/staticpanel/ContentKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyInstanceStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyIssuanceKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyQuestionFieldTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyRunStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/system/job_log/JobStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeLifecycleStatusTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeTypeTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/usage_info/UsageKindTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/user/SystemRoleTest.java create mode 100644 waltz-model/src/jcover/java/com/khartec/waltz/model/utils/IdUtilitiesTest.java diff --git a/waltz-model/pom.xml b/waltz-model/pom.xml index f1c48ecbdc..0705a2d6f0 100644 --- a/waltz-model/pom.xml +++ b/waltz-model/pom.xml @@ -54,6 +54,13 @@ test + + org.mockito + mockito-core + 3.2.4 + test + + diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/ApprovalStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/ApprovalStatusTest.java new file mode 100644 index 0000000000..38580bc014 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/ApprovalStatusTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.ApprovalStatus + * + * @author Diffblue JCover + */ + +public class ApprovalStatusTest { + + @Test + public void valuesReturnsPENDING_APPROVALAPPROVED_ALLINTERNAL_ONLYREJECTED_ALLREQUIRES_EXCEPTION() { + ApprovalStatus[] result = ApprovalStatus.values(); + assertThat(result[0], is(ApprovalStatus.PENDING_APPROVAL)); + assertThat(result[1], is(ApprovalStatus.APPROVED_ALL)); + assertThat(result[2], is(ApprovalStatus.INTERNAL_ONLY)); + assertThat(result[3], is(ApprovalStatus.REJECTED_ALL)); + assertThat(result[4], is(ApprovalStatus.REQUIRES_EXCEPTION)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/AxisOrientationTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/AxisOrientationTest.java new file mode 100644 index 0000000000..67ecb060ab --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/AxisOrientationTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.AxisOrientation + * + * @author Diffblue JCover + */ + +public class AxisOrientationTest { + + @Test + public void valuesReturnsROWCOLUMN() { + AxisOrientation[] result = AxisOrientation.values(); + assertThat(result[0], is(AxisOrientation.ROW)); + assertThat(result[1], is(AxisOrientation.COLUMN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/CriticalityTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/CriticalityTest.java new file mode 100644 index 0000000000..68d7858168 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/CriticalityTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.function.Function; + +import org.junit.Test; +import org.mockito.Mockito; + +/** + * Unit tests for com.khartec.waltz.model.Criticality + * + * @author Diffblue JCover + */ + +public class CriticalityTest { + + @Test + public void parseValueIsFooReturnsLOW() { + @SuppressWarnings("unchecked") + Function failedParseSupplier = mock(Function.class); + when(failedParseSupplier.apply(Mockito.any())) + .thenReturn(Criticality.LOW); + assertThat(Criticality.parse("foo", failedParseSupplier), is(Criticality.LOW)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/DurationTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/DurationTest.java new file mode 100644 index 0000000000..26948860ca --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/DurationTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.Duration + * + * @author Diffblue JCover + */ + +public class DurationTest { + + @Test + public void numDaysReturnsOne() { + assertThat(Duration.DAY.numDays(), is(1)); + } + + @Test + public void valuesReturnsDAYWEEKMONTHQUARTERHALF_YEARYEARALL() { + Duration[] result = Duration.values(); + assertThat(result[0], is(Duration.DAY)); + assertThat(result[1], is(Duration.WEEK)); + assertThat(result[2], is(Duration.MONTH)); + assertThat(result[3], is(Duration.QUARTER)); + assertThat(result[4], is(Duration.HALF_YEAR)); + assertThat(result[5], is(Duration.YEAR)); + assertThat(result[6], is(Duration.ALL)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/EndOfLifeStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/EndOfLifeStatusTest.java new file mode 100644 index 0000000000..f8777488dc --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/EndOfLifeStatusTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.util.Date; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.EndOfLifeStatus + * + * @author Diffblue JCover + */ + +public class EndOfLifeStatusTest { + + @Test + public void calculateEndOfLifeStatus() { + assertThat(EndOfLifeStatus.calculateEndOfLifeStatus(null), is(EndOfLifeStatus.NOT_END_OF_LIFE)); + assertThat(EndOfLifeStatus.calculateEndOfLifeStatus(new Date(1L)), is(EndOfLifeStatus.END_OF_LIFE)); + } + + @Test + public void valuesReturnsEND_OF_LIFENOT_END_OF_LIFE() { + EndOfLifeStatus[] result = EndOfLifeStatus.values(); + assertThat(result[0], is(EndOfLifeStatus.END_OF_LIFE)); + assertThat(result[1], is(EndOfLifeStatus.NOT_END_OF_LIFE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityKindTest.java new file mode 100644 index 0000000000..115aae08fb --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityKindTest.java @@ -0,0 +1,17 @@ +package com.khartec.waltz.model; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.EntityKind + * + * @author Diffblue JCover + */ + +public class EntityKindTest { + + @Test + public void valuesReturnsACTORALLOCATION_SCHEMEAPPLICATIONAPP_GROUPASSET_COSTATTESTATIONATTESTATION_RUNAUTHORITATIVE_SOURCEBOOKMARKCHANGE_INITIATIVECHANGE_SETCHANGE_UNITDATABASEDATA_TYPEDRILL_GRID_DEFINITIONEND_USER_APPLICATIONENTITY_HIERARCHYENTITY_NAMED_NOTEENTITY_NAMED_NOTE_TYPEENTITY_STATISTICFLOW_DIAGRAMFLOW_ANNOTATIONINVOLVEMENTINVOLVEMENT_KINDLICENCELOGICAL_DATA_ELEMENTLOGICAL_DATA_FLOWMEASURABLEMEASURABLE_CATEGORYMEASURABLE_RATINGMEASURABLE_RATING_PLANNED_DECOMMISSIONMEASURABLE_RATING_REPLACEMENTORG_UNITPERFORMANCE_METRIC_PACKPERSONPHYSICAL_SPECIFICATIONPHYSICAL_SPEC_DEFNPHYSICAL_SPEC_DEFN_FIELDPHYSICAL_FLOWROADMAPSCENARIOSERVERSOFTWARESOFTWARE_VERSIONSURVEY_INSTANCESURVEY_RUNSURVEY_TEMPLATESYSTEMTAGCAPABILITY() { + EntityKind[] result = EntityKind.values(); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLifecycleStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLifecycleStatusTest.java new file mode 100644 index 0000000000..1e819b9cf8 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLifecycleStatusTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.EntityLifecycleStatus + * + * @author Diffblue JCover + */ + +public class EntityLifecycleStatusTest { + + @Test + public void fromIsRemovedFlag() { + assertThat(EntityLifecycleStatus.fromIsRemovedFlag(false), is(EntityLifecycleStatus.ACTIVE)); + assertThat(EntityLifecycleStatus.fromIsRemovedFlag(true), is(EntityLifecycleStatus.REMOVED)); + } + + @Test + public void valuesReturnsACTIVEPENDINGREMOVED() { + EntityLifecycleStatus[] result = EntityLifecycleStatus.values(); + assertThat(result[0], is(EntityLifecycleStatus.ACTIVE)); + assertThat(result[1], is(EntityLifecycleStatus.PENDING)); + assertThat(result[2], is(EntityLifecycleStatus.REMOVED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLinkUtilitiesTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLinkUtilitiesTest.java new file mode 100644 index 0000000000..583bf0b3ca --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/EntityLinkUtilitiesTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.EntityLinkUtilities + * + * @author Diffblue JCover + */ + +public class EntityLinkUtilitiesTest { + + @Test + public void mkExternalIdLinkExternalIdIsRootAndKindIsACTOR() { + assertThat(EntityLinkUtilities.mkExternalIdLink("ZGF0YQ==", EntityKind.ACTOR, "root"), is("ZGF0YQ==entity/ACTOR/external-id/root")); + } + + @Test + public void mkIdLinkIdIsOneAndKindIsACTOR() { + assertThat(EntityLinkUtilities.mkIdLink("ZGF0YQ==", EntityKind.ACTOR, 1L), is("ZGF0YQ==entity/ACTOR/id/1")); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/FieldDataTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/FieldDataTypeTest.java new file mode 100644 index 0000000000..971b040050 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/FieldDataTypeTest.java @@ -0,0 +1,28 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.FieldDataType + * + * @author Diffblue JCover + */ + +public class FieldDataTypeTest { + + @Test + public void valuesReturnsDATEDATETIMEDECIMALINTEGERSTRINGBOOLEANENUMUNSPECIFIED() { + FieldDataType[] result = FieldDataType.values(); + assertThat(result[0], is(FieldDataType.DATE)); + assertThat(result[1], is(FieldDataType.DATETIME)); + assertThat(result[2], is(FieldDataType.DECIMAL)); + assertThat(result[3], is(FieldDataType.INTEGER)); + assertThat(result[4], is(FieldDataType.STRING)); + assertThat(result[5], is(FieldDataType.BOOLEAN)); + assertThat(result[6], is(FieldDataType.ENUM)); + assertThat(result[7], is(FieldDataType.UNSPECIFIED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/FlowDirectionTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/FlowDirectionTest.java new file mode 100644 index 0000000000..c2272e569f --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/FlowDirectionTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.FlowDirection + * + * @author Diffblue JCover + */ + +public class FlowDirectionTest { + + @Test + public void valuesReturnsINBOUNDOUTBOUNDINTRA() { + FlowDirection[] result = FlowDirection.values(); + assertThat(result[0], is(FlowDirection.INBOUND)); + assertThat(result[1], is(FlowDirection.OUTBOUND)); + assertThat(result[2], is(FlowDirection.INTRA)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/FreshnessIndicatorTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/FreshnessIndicatorTest.java new file mode 100644 index 0000000000..df823f1900 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/FreshnessIndicatorTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.FreshnessIndicator + * + * @author Diffblue JCover + */ + +public class FreshnessIndicatorTest { + + @Test + public void valuesReturnsNEVER_OBSERVEDHISTORICALLY_OBSERVEDOBSERVEDRECENTLY_OBSERVED() { + FreshnessIndicator[] result = FreshnessIndicator.values(); + assertThat(result[0], is(FreshnessIndicator.NEVER_OBSERVED)); + assertThat(result[1], is(FreshnessIndicator.HISTORICALLY_OBSERVED)); + assertThat(result[2], is(FreshnessIndicator.OBSERVED)); + assertThat(result[3], is(FreshnessIndicator.RECENTLY_OBSERVED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/HierarchyQueryScopeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/HierarchyQueryScopeTest.java new file mode 100644 index 0000000000..ce3360861a --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/HierarchyQueryScopeTest.java @@ -0,0 +1,33 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.HierarchyQueryScope + * + * @author Diffblue JCover + */ + +public class HierarchyQueryScopeTest { + + @Test + public void determineDownwardsScopeForKindKindIsACTORReturnsEXACT() { + assertThat(HierarchyQueryScope.determineDownwardsScopeForKind(EntityKind.ACTOR), is(HierarchyQueryScope.EXACT)); + } + + @Test + public void determineUpwardsScopeForKindKindIsACTORReturnsEXACT() { + assertThat(HierarchyQueryScope.determineUpwardsScopeForKind(EntityKind.ACTOR), is(HierarchyQueryScope.EXACT)); + } + + @Test + public void valuesReturnsEXACTPARENTSCHILDREN() { + HierarchyQueryScope[] result = HierarchyQueryScope.values(); + assertThat(result[0], is(HierarchyQueryScope.EXACT)); + assertThat(result[1], is(HierarchyQueryScope.PARENTS)); + assertThat(result[2], is(HierarchyQueryScope.CHILDREN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/IdSelectionOptionsTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/IdSelectionOptionsTest.java new file mode 100644 index 0000000000..1684a8a651 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/IdSelectionOptionsTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.IdSelectionOptions + * + * @author Diffblue JCover + */ + +public class IdSelectionOptionsTest { + + @Test + public void determineDefaultScopeKindIsACTORReturnsEXACT() { + assertThat(IdSelectionOptions.determineDefaultScope(EntityKind.ACTOR), is(HierarchyQueryScope.EXACT)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/LifecycleStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/LifecycleStatusTest.java new file mode 100644 index 0000000000..e778031401 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/LifecycleStatusTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.LifecycleStatus + * + * @author Diffblue JCover + */ + +public class LifecycleStatusTest { + + @Test + public void valuesReturnsACTIVEBUILDINGINACTIVERETIRINGUNKNOWN() { + LifecycleStatus[] result = LifecycleStatus.values(); + assertThat(result[0], is(LifecycleStatus.ACTIVE)); + assertThat(result[1], is(LifecycleStatus.BUILDING)); + assertThat(result[2], is(LifecycleStatus.INACTIVE)); + assertThat(result[3], is(LifecycleStatus.RETIRING)); + assertThat(result[4], is(LifecycleStatus.UNKNOWN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/OperationTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/OperationTest.java new file mode 100644 index 0000000000..58ae2f3ba2 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/OperationTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.Operation + * + * @author Diffblue JCover + */ + +public class OperationTest { + + @Test + public void valuesReturnsADDATTESTREMOVEUPDATEUNKNOWN() { + Operation[] result = Operation.values(); + assertThat(result[0], is(Operation.ADD)); + assertThat(result[1], is(Operation.ATTEST)); + assertThat(result[2], is(Operation.REMOVE)); + assertThat(result[3], is(Operation.UPDATE)); + assertThat(result[4], is(Operation.UNKNOWN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/QuarterTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/QuarterTest.java new file mode 100644 index 0000000000..697903b22f --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/QuarterTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.Quarter + * + * @author Diffblue JCover + */ + +public class QuarterTest { + + @Test + public void fromIntQuarterIsOneReturnsQ1() { + assertThat(Quarter.fromInt(1), is(Quarter.Q1)); + } + + @Test + public void valuesReturnsQ1Q2Q3Q4() { + Quarter[] result = Quarter.values(); + assertThat(result[0], is(Quarter.Q1)); + assertThat(result[1], is(Quarter.Q2)); + assertThat(result[2], is(Quarter.Q3)); + assertThat(result[3], is(Quarter.Q4)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/ReleaseLifecycleStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/ReleaseLifecycleStatusTest.java new file mode 100644 index 0000000000..13f2015754 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/ReleaseLifecycleStatusTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.ReleaseLifecycleStatus + * + * @author Diffblue JCover + */ + +public class ReleaseLifecycleStatusTest { + + @Test + public void valuesReturnsDRAFTACTIVEDEPRECATEDOBSOLETE() { + ReleaseLifecycleStatus[] result = ReleaseLifecycleStatus.values(); + assertThat(result[0], is(ReleaseLifecycleStatus.DRAFT)); + assertThat(result[1], is(ReleaseLifecycleStatus.ACTIVE)); + assertThat(result[2], is(ReleaseLifecycleStatus.DEPRECATED)); + assertThat(result[3], is(ReleaseLifecycleStatus.OBSOLETE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/SeverityTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/SeverityTest.java new file mode 100644 index 0000000000..5d9cde6d54 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/SeverityTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.Severity + * + * @author Diffblue JCover + */ + +public class SeverityTest { + + @Test + public void valuesReturnsINFORMATIONWARNINGERROR() { + Severity[] result = Severity.values(); + assertThat(result[0], is(Severity.INFORMATION)); + assertThat(result[1], is(Severity.WARNING)); + assertThat(result[2], is(Severity.ERROR)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupKindTest.java new file mode 100644 index 0000000000..2859b72cc9 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupKindTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.app_group; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.app_group.AppGroupKind + * + * @author Diffblue JCover + */ + +public class AppGroupKindTest { + + @Test + public void valuesReturnsPUBLICPRIVATE() { + AppGroupKind[] result = AppGroupKind.values(); + assertThat(result[0], is(AppGroupKind.PUBLIC)); + assertThat(result[1], is(AppGroupKind.PRIVATE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupMemberRoleTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupMemberRoleTest.java new file mode 100644 index 0000000000..e464ac6475 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/app_group/AppGroupMemberRoleTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.app_group; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.app_group.AppGroupMemberRole + * + * @author Diffblue JCover + */ + +public class AppGroupMemberRoleTest { + + @Test + public void valuesReturnsVIEWEROWNER() { + AppGroupMemberRole[] result = AppGroupMemberRole.values(); + assertThat(result[0], is(AppGroupMemberRole.VIEWER)); + assertThat(result[1], is(AppGroupMemberRole.OWNER)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/application/ApplicationKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/ApplicationKindTest.java new file mode 100644 index 0000000000..7d6f4fe315 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/ApplicationKindTest.java @@ -0,0 +1,27 @@ +package com.khartec.waltz.model.application; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.application.ApplicationKind + * + * @author Diffblue JCover + */ + +public class ApplicationKindTest { + + @Test + public void valuesReturnsIN_HOUSEINTERNALLY_HOSTEDEXTERNALLY_HOSTEDEUCTHIRD_PARTYCUSTOMISEDEXTERNAL() { + ApplicationKind[] result = ApplicationKind.values(); + assertThat(result[0], is(ApplicationKind.IN_HOUSE)); + assertThat(result[1], is(ApplicationKind.INTERNALLY_HOSTED)); + assertThat(result[2], is(ApplicationKind.EXTERNALLY_HOSTED)); + assertThat(result[3], is(ApplicationKind.EUC)); + assertThat(result[4], is(ApplicationKind.THIRD_PARTY)); + assertThat(result[5], is(ApplicationKind.CUSTOMISED)); + assertThat(result[6], is(ApplicationKind.EXTERNAL)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/application/AssetCodeRelationshipKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/AssetCodeRelationshipKindTest.java new file mode 100644 index 0000000000..8e5c75ef2b --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/AssetCodeRelationshipKindTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model.application; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.application.AssetCodeRelationshipKind + * + * @author Diffblue JCover + */ + +public class AssetCodeRelationshipKindTest { + + @Test + public void valuesReturnsPARENTCHILDSIBLINGSHARINGNONE() { + AssetCodeRelationshipKind[] result = AssetCodeRelationshipKind.values(); + assertThat(result[0], is(AssetCodeRelationshipKind.PARENT)); + assertThat(result[1], is(AssetCodeRelationshipKind.CHILD)); + assertThat(result[2], is(AssetCodeRelationshipKind.SIBLING)); + assertThat(result[3], is(AssetCodeRelationshipKind.SHARING)); + assertThat(result[4], is(AssetCodeRelationshipKind.NONE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/application/LifecyclePhaseTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/LifecyclePhaseTest.java new file mode 100644 index 0000000000..792ce5040b --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/application/LifecyclePhaseTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.application; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.application.LifecyclePhase + * + * @author Diffblue JCover + */ + +public class LifecyclePhaseTest { + + @Test + public void valuesReturnsPRODUCTIONDEVELOPMENTCONCEPTUALRETIRED() { + LifecyclePhase[] result = LifecyclePhase.values(); + assertThat(result[0], is(LifecyclePhase.PRODUCTION)); + assertThat(result[1], is(LifecyclePhase.DEVELOPMENT)); + assertThat(result[2], is(LifecyclePhase.CONCEPTUAL)); + assertThat(result[3], is(LifecyclePhase.RETIRED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/assessment_definition/AssessmentVisibilityTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/assessment_definition/AssessmentVisibilityTest.java new file mode 100644 index 0000000000..1a5806df79 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/assessment_definition/AssessmentVisibilityTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.assessment_definition; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.assessment_definition.AssessmentVisibility + * + * @author Diffblue JCover + */ + +public class AssessmentVisibilityTest { + + @Test + public void valuesReturnsPRIMARYSECONDARY() { + AssessmentVisibility[] result = AssessmentVisibility.values(); + assertThat(result[0], is(AssessmentVisibility.PRIMARY)); + assertThat(result[1], is(AssessmentVisibility.SECONDARY)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/change_initiative/ChangeInitiativeKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_initiative/ChangeInitiativeKindTest.java new file mode 100644 index 0000000000..86aa0cf367 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_initiative/ChangeInitiativeKindTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.change_initiative; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.change_initiative.ChangeInitiativeKind + * + * @author Diffblue JCover + */ + +public class ChangeInitiativeKindTest { + + @Test + public void valuesReturnsINITIATIVEPROGRAMMEPROJECT() { + ChangeInitiativeKind[] result = ChangeInitiativeKind.values(); + assertThat(result[0], is(ChangeInitiativeKind.INITIATIVE)); + assertThat(result[1], is(ChangeInitiativeKind.PROGRAMME)); + assertThat(result[2], is(ChangeInitiativeKind.PROJECT)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ChangeActionTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ChangeActionTest.java new file mode 100644 index 0000000000..e72104d01b --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ChangeActionTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.change_unit; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.change_unit.ChangeAction + * + * @author Diffblue JCover + */ + +public class ChangeActionTest { + + @Test + public void valuesReturnsACTIVATERETIREMODIFY() { + ChangeAction[] result = ChangeAction.values(); + assertThat(result[0], is(ChangeAction.ACTIVATE)); + assertThat(result[1], is(ChangeAction.RETIRE)); + assertThat(result[2], is(ChangeAction.MODIFY)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ExecutionStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ExecutionStatusTest.java new file mode 100644 index 0000000000..49c241ebc3 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/change_unit/ExecutionStatusTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.change_unit; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.change_unit.ExecutionStatus + * + * @author Diffblue JCover + */ + +public class ExecutionStatusTest { + + @Test + public void valuesReturnsPENDINGCOMPLETEDISCARDED() { + ExecutionStatus[] result = ExecutionStatus.values(); + assertThat(result[0], is(ExecutionStatus.PENDING)); + assertThat(result[1], is(ExecutionStatus.COMPLETE)); + assertThat(result[2], is(ExecutionStatus.DISCARDED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/checkpoint/GoalTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/checkpoint/GoalTypeTest.java new file mode 100644 index 0000000000..e6a54ca56e --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/checkpoint/GoalTypeTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.checkpoint; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.checkpoint.GoalType + * + * @author Diffblue JCover + */ + +public class GoalTypeTest { + + @Test + public void valuesReturnsABOVE_THRESHOLDBELOW_THRESHOLDPERCENT_INCREASEPERCENT_DECREASE() { + GoalType[] result = GoalType.values(); + assertThat(result[0], is(GoalType.ABOVE_THRESHOLD)); + assertThat(result[1], is(GoalType.BELOW_THRESHOLD)); + assertThat(result[2], is(GoalType.PERCENT_INCREASE)); + assertThat(result[3], is(GoalType.PERCENT_DECREASE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/command/CommandOutcomeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/command/CommandOutcomeTest.java new file mode 100644 index 0000000000..c42dd2f001 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/command/CommandOutcomeTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.command; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.command.CommandOutcome + * + * @author Diffblue JCover + */ + +public class CommandOutcomeTest { + + @Test + public void valuesReturnsSUCCESSFAILURE() { + CommandOutcome[] result = CommandOutcome.values(); + assertThat(result[0], is(CommandOutcome.SUCCESS)); + assertThat(result[1], is(CommandOutcome.FAILURE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/complexity/ComplexityKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/complexity/ComplexityKindTest.java new file mode 100644 index 0000000000..ba768f0448 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/complexity/ComplexityKindTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.complexity; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.complexity.ComplexityKind + * + * @author Diffblue JCover + */ + +public class ComplexityKindTest { + + @Test + public void valuesReturnsCONNECTIONMEASURABLESERVERTOTAL() { + ComplexityKind[] result = ComplexityKind.values(); + assertThat(result[0], is(ComplexityKind.CONNECTION)); + assertThat(result[1], is(ComplexityKind.MEASURABLE)); + assertThat(result[2], is(ComplexityKind.SERVER)); + assertThat(result[3], is(ComplexityKind.TOTAL)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/DirectionalityTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/DirectionalityTest.java new file mode 100644 index 0000000000..f0d9c9964d --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/DirectionalityTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_relationship.Directionality + * + * @author Diffblue JCover + */ + +public class DirectionalityTest { + + @Test + public void valuesReturnsANYSOURCETARGET() { + Directionality[] result = Directionality.values(); + assertThat(result[0], is(Directionality.ANY)); + assertThat(result[1], is(Directionality.SOURCE)); + assertThat(result[2], is(Directionality.TARGET)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/RelationshipKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/RelationshipKindTest.java new file mode 100644 index 0000000000..3ab8245a99 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_relationship/RelationshipKindTest.java @@ -0,0 +1,37 @@ +package com.khartec.waltz.model.entity_relationship; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_relationship.RelationshipKind + * + * @author Diffblue JCover + */ + +public class RelationshipKindTest { + + @Test + public void getAllowedEntityKindsReturnsEmpty() { + assertTrue(RelationshipKind.HAS.getAllowedEntityKinds().isEmpty()); + } + + @Test + public void valuesReturnsHASDEPRECATESPARTICIPATES_INRELATES_TOSUPPORTSAPPLICATION_NEWAPPLICATION_FUNCTIONAL_CHANGEAPPLICATION_DECOMMISSIONEDAPPLICATION_NFR_CHANGEDATA_PUBLISHERDATA_CONSUMER() { + RelationshipKind[] result = RelationshipKind.values(); + assertThat(result[0], is(RelationshipKind.HAS)); + assertThat(result[1], is(RelationshipKind.DEPRECATES)); + assertThat(result[2], is(RelationshipKind.PARTICIPATES_IN)); + assertThat(result[3], is(RelationshipKind.RELATES_TO)); + assertThat(result[4], is(RelationshipKind.SUPPORTS)); + assertThat(result[5], is(RelationshipKind.APPLICATION_NEW)); + assertThat(result[6], is(RelationshipKind.APPLICATION_FUNCTIONAL_CHANGE)); + assertThat(result[7], is(RelationshipKind.APPLICATION_DECOMMISSIONED)); + assertThat(result[8], is(RelationshipKind.APPLICATION_NFR_CHANGE)); + assertThat(result[9], is(RelationshipKind.DATA_PUBLISHER)); + assertThat(result[10], is(RelationshipKind.DATA_CONSUMER)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/RollupKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/RollupKindTest.java new file mode 100644 index 0000000000..83ba1fb553 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/RollupKindTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_statistic.RollupKind + * + * @author Diffblue JCover + */ + +public class RollupKindTest { + + @Test + public void valuesReturnsCOUNT_BY_ENTITYSUM_BY_VALUEAVG_BY_VALUENONE() { + RollupKind[] result = RollupKind.values(); + assertThat(result[0], is(RollupKind.COUNT_BY_ENTITY)); + assertThat(result[1], is(RollupKind.SUM_BY_VALUE)); + assertThat(result[2], is(RollupKind.AVG_BY_VALUE)); + assertThat(result[3], is(RollupKind.NONE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticCategoryTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticCategoryTest.java new file mode 100644 index 0000000000..0d967a2d1d --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticCategoryTest.java @@ -0,0 +1,26 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_statistic.StatisticCategory + * + * @author Diffblue JCover + */ + +public class StatisticCategoryTest { + + @Test + public void valuesReturnsCOMPLIANCEDATA_QUALITYGOVERNANCEREGULATORYSECURITYTECHNICAL() { + StatisticCategory[] result = StatisticCategory.values(); + assertThat(result[0], is(StatisticCategory.COMPLIANCE)); + assertThat(result[1], is(StatisticCategory.DATA_QUALITY)); + assertThat(result[2], is(StatisticCategory.GOVERNANCE)); + assertThat(result[3], is(StatisticCategory.REGULATORY)); + assertThat(result[4], is(StatisticCategory.SECURITY)); + assertThat(result[5], is(StatisticCategory.TECHNICAL)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticTypeTest.java new file mode 100644 index 0000000000..5671979591 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticTypeTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_statistic.StatisticType + * + * @author Diffblue JCover + */ + +public class StatisticTypeTest { + + @Test + public void valuesReturnsBOOLEANDATEENUMNUMERICPERCENTAGE() { + StatisticType[] result = StatisticType.values(); + assertThat(result[0], is(StatisticType.BOOLEAN)); + assertThat(result[1], is(StatisticType.DATE)); + assertThat(result[2], is(StatisticType.ENUM)); + assertThat(result[3], is(StatisticType.NUMERIC)); + assertThat(result[4], is(StatisticType.PERCENTAGE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticValueStateTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticValueStateTest.java new file mode 100644 index 0000000000..cbbdc1bf49 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/entity_statistic/StatisticValueStateTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.entity_statistic; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.entity_statistic.StatisticValueState + * + * @author Diffblue JCover + */ + +public class StatisticValueStateTest { + + @Test + public void valuesReturnsEXEMPTPROVIDEDUNKNOWN() { + StatisticValueState[] result = StatisticValueState.values(); + assertThat(result[0], is(StatisticValueState.EXEMPT)); + assertThat(result[1], is(StatisticValueState.PROVIDED)); + assertThat(result[2], is(StatisticValueState.UNKNOWN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/enum_value/EnumValueKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/enum_value/EnumValueKindTest.java new file mode 100644 index 0000000000..6606d4c804 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/enum_value/EnumValueKindTest.java @@ -0,0 +1,34 @@ +package com.khartec.waltz.model.enum_value; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.enum_value.EnumValueKind + * + * @author Diffblue JCover + */ + +public class EnumValueKindTest { + + @Test + public void dbValueReturnsTransportKind() { + assertThat(EnumValueKind.TRANSPORT_KIND.dbValue(), is("TransportKind")); + } + + @Test + public void valuesReturnsTRANSPORT_KINDBOOKMARK_KINDAUTHORITATIVENESS_RATINGCOST_KINDPERSON_KINDSCENARIO_TYPECHANGE_INITIATIVE_LIFECYCLE_PHASEPHYSICAL_FLOW_CRITICALITYFRESHNESS_INDICATOR() { + EnumValueKind[] result = EnumValueKind.values(); + assertThat(result[0], is(EnumValueKind.TRANSPORT_KIND)); + assertThat(result[1], is(EnumValueKind.BOOKMARK_KIND)); + assertThat(result[2], is(EnumValueKind.AUTHORITATIVENESS_RATING)); + assertThat(result[3], is(EnumValueKind.COST_KIND)); + assertThat(result[4], is(EnumValueKind.PERSON_KIND)); + assertThat(result[5], is(EnumValueKind.SCENARIO_TYPE)); + assertThat(result[6], is(EnumValueKind.CHANGE_INITIATIVE_LIFECYCLE_PHASE)); + assertThat(result[7], is(EnumValueKind.PHYSICAL_FLOW_CRITICALITY)); + assertThat(result[8], is(EnumValueKind.FRESHNESS_INDICATOR)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionTest.java new file mode 100644 index 0000000000..0d6903d649 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/exceptions/NotAuthorizedExceptionTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.exceptions; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNull.nullValue; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.exceptions.NotAuthorizedException + * + * @author Diffblue JCover + */ + +public class NotAuthorizedExceptionTest { + + @Test + public void constructor() { + NotAuthorizedException notAuthorizedException = new NotAuthorizedException(); + assertThat(notAuthorizedException.getCause(), is(nullValue())); + assertThat(notAuthorizedException.getLocalizedMessage(), is("User is not authorized to perform that action")); + assertThat(notAuthorizedException.getMessage(), is("User is not authorized to perform that action")); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/measurable_relationship/MeasurableRelationshipKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/measurable_relationship/MeasurableRelationshipKindTest.java new file mode 100644 index 0000000000..bfefd9fdf6 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/measurable_relationship/MeasurableRelationshipKindTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.measurable_relationship; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.measurable_relationship.MeasurableRelationshipKind + * + * @author Diffblue JCover + */ + +public class MeasurableRelationshipKindTest { + + @Test + public void valuesReturnsWEAKLY_RELATES_TOSTRONGLY_RELATES_TO() { + MeasurableRelationshipKind[] result = MeasurableRelationshipKind.values(); + assertThat(result[0], is(MeasurableRelationshipKind.WEAKLY_RELATES_TO)); + assertThat(result[1], is(MeasurableRelationshipKind.STRONGLY_RELATES_TO)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/orphan/OrphanSideTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/orphan/OrphanSideTest.java new file mode 100644 index 0000000000..e63d4bc323 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/orphan/OrphanSideTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.orphan; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.orphan.OrphanSide + * + * @author Diffblue JCover + */ + +public class OrphanSideTest { + + @Test + public void valuesReturnsABBOTH() { + OrphanSide[] result = OrphanSide.values(); + assertThat(result[0], is(OrphanSide.A)); + assertThat(result[1], is(OrphanSide.B)); + assertThat(result[2], is(OrphanSide.BOTH)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/performance_metric/sample/SampleTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/performance_metric/sample/SampleTypeTest.java new file mode 100644 index 0000000000..98829dcf6a --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/performance_metric/sample/SampleTypeTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.performance_metric.sample; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.performance_metric.sample.SampleType + * + * @author Diffblue JCover + */ + +public class SampleTypeTest { + + @Test + public void valuesReturnsMANUALAUTOMATED() { + SampleType[] result = SampleType.values(); + assertThat(result[0], is(SampleType.MANUAL)); + assertThat(result[1], is(SampleType.AUTOMATED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/person/PersonKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/person/PersonKindTest.java new file mode 100644 index 0000000000..5c5e016ba8 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/person/PersonKindTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.person; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.person.PersonKind + * + * @author Diffblue JCover + */ + +public class PersonKindTest { + + @Test + public void valuesReturnsEMPLOYEECONTRACTORCONSULTANT() { + PersonKind[] result = PersonKind.values(); + assertThat(result[0], is(PersonKind.EMPLOYEE)); + assertThat(result[1], is(PersonKind.CONTRACTOR)); + assertThat(result[2], is(PersonKind.CONSULTANT)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow/FrequencyKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow/FrequencyKindTest.java new file mode 100644 index 0000000000..91fc4014da --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow/FrequencyKindTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model.physical_flow; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.function.Function; + +import org.junit.Test; +import org.mockito.Mockito; + +/** + * Unit tests for com.khartec.waltz.model.physical_flow.FrequencyKind + * + * @author Diffblue JCover + */ + +public class FrequencyKindTest { + + @Test + public void parseValueIsFooReturnsON_DEMAND() { + @SuppressWarnings("unchecked") + Function failedParseSupplier = mock(Function.class); + when(failedParseSupplier.apply(Mockito.any())) + .thenReturn(FrequencyKind.ON_DEMAND); + assertThat(FrequencyKind.parse("foo", failedParseSupplier), is(FrequencyKind.ON_DEMAND)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow_participant/ParticipationKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow_participant/ParticipationKindTest.java new file mode 100644 index 0000000000..23457c4d82 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_flow_participant/ParticipationKindTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.physical_flow_participant; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.physical_flow_participant.ParticipationKind + * + * @author Diffblue JCover + */ + +public class ParticipationKindTest { + + @Test + public void valuesReturnsSOURCEFLOWTARGET() { + ParticipationKind[] result = ParticipationKind.values(); + assertThat(result[0], is(ParticipationKind.SOURCE)); + assertThat(result[1], is(ParticipationKind.FLOW)); + assertThat(result[2], is(ParticipationKind.TARGET)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification/DataFormatKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification/DataFormatKindTest.java new file mode 100644 index 0000000000..9cf7127a92 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification/DataFormatKindTest.java @@ -0,0 +1,42 @@ +package com.khartec.waltz.model.physical_specification; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.function.Function; + +import org.junit.Test; +import org.mockito.Mockito; + +/** + * Unit tests for com.khartec.waltz.model.physical_specification.DataFormatKind + * + * @author Diffblue JCover + */ + +public class DataFormatKindTest { + + @Test + public void parseReturnsBINARY() { + @SuppressWarnings("unchecked") + Function failedParseSupplier = mock(Function.class); + when(failedParseSupplier.apply(Mockito.any())) + .thenReturn(DataFormatKind.BINARY); + assertThat(DataFormatKind.parse("yyyy-MM-dd", failedParseSupplier), is(DataFormatKind.BINARY)); + } + + @Test + public void valuesReturnsBINARYDATABASEFLAT_FILEJSONOTHERUNSTRUCTUREDUNKNOWNXML() { + DataFormatKind[] result = DataFormatKind.values(); + assertThat(result[0], is(DataFormatKind.BINARY)); + assertThat(result[1], is(DataFormatKind.DATABASE)); + assertThat(result[2], is(DataFormatKind.FLAT_FILE)); + assertThat(result[3], is(DataFormatKind.JSON)); + assertThat(result[4], is(DataFormatKind.OTHER)); + assertThat(result[5], is(DataFormatKind.UNSTRUCTURED)); + assertThat(result[6], is(DataFormatKind.UNKNOWN)); + assertThat(result[7], is(DataFormatKind.XML)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification_definition/PhysicalSpecDefinitionTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification_definition/PhysicalSpecDefinitionTypeTest.java new file mode 100644 index 0000000000..ec525736eb --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/physical_specification_definition/PhysicalSpecDefinitionTypeTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.model.physical_specification_definition; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.physical_specification_definition.PhysicalSpecDefinitionType + * + * @author Diffblue JCover + */ + +public class PhysicalSpecDefinitionTypeTest { + + @Test + public void valuesReturnsDELIMITED() { + assertThat(PhysicalSpecDefinitionType.values()[0], is(PhysicalSpecDefinitionType.DELIMITED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/AuthoritativenessRatingTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/AuthoritativenessRatingTest.java new file mode 100644 index 0000000000..da52dbcbe0 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/AuthoritativenessRatingTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.rating; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.rating.AuthoritativenessRating + * + * @author Diffblue JCover + */ + +public class AuthoritativenessRatingTest { + + @Test + public void valuesReturnsPRIMARYSECONDARYNO_OPINIONDISCOURAGED() { + AuthoritativenessRating[] result = AuthoritativenessRating.values(); + assertThat(result[0], is(AuthoritativenessRating.PRIMARY)); + assertThat(result[1], is(AuthoritativenessRating.SECONDARY)); + assertThat(result[2], is(AuthoritativenessRating.NO_OPINION)); + assertThat(result[3], is(AuthoritativenessRating.DISCOURAGED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RagRatingTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RagRatingTest.java new file mode 100644 index 0000000000..64edee3ed8 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RagRatingTest.java @@ -0,0 +1,25 @@ +package com.khartec.waltz.model.rating; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.rating.RagRating + * + * @author Diffblue JCover + */ + +public class RagRatingTest { + + @Test + public void valuesReturnsRAGZX() { + RagRating[] result = RagRating.values(); + assertThat(result[0], is(RagRating.R)); + assertThat(result[1], is(RagRating.A)); + assertThat(result[2], is(RagRating.G)); + assertThat(result[3], is(RagRating.Z)); + assertThat(result[4], is(RagRating.X)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RatingSchemeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RatingSchemeTest.java new file mode 100644 index 0000000000..c68c802d23 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/rating/RatingSchemeTest.java @@ -0,0 +1,20 @@ +package com.khartec.waltz.model.rating; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.rating.RatingScheme + * + * @author Diffblue JCover + */ + +public class RatingSchemeTest { + + @Test + public void toList() { + assertThat(RatingScheme.toList().size(), is(6)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/scenario/ScenarioTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/scenario/ScenarioTypeTest.java new file mode 100644 index 0000000000..c86915202e --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/scenario/ScenarioTypeTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.scenario; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.scenario.ScenarioType + * + * @author Diffblue JCover + */ + +public class ScenarioTypeTest { + + @Test + public void valuesReturnsTARGETCURRENTINTERIM() { + ScenarioType[] result = ScenarioType.values(); + assertThat(result[0], is(ScenarioType.TARGET)); + assertThat(result[1], is(ScenarioType.CURRENT)); + assertThat(result[2], is(ScenarioType.INTERIM)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobKeyTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobKeyTest.java new file mode 100644 index 0000000000..a9b4e37682 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobKeyTest.java @@ -0,0 +1,32 @@ +package com.khartec.waltz.model.scheduled_job; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.scheduled_job.JobKey + * + * @author Diffblue JCover + */ + +public class JobKeyTest { + + @Test + public void valuesReturnsHIERARCHY_REBUILD_CHANGE_INITIATIVEHIERARCHY_REBUILD_DATA_TYPEHIERARCHY_REBUILD_ENTITY_STATISTICSHIERARCHY_REBUILD_MEASURABLEHIERARCHY_REBUILD_ORG_UNITHIERARCHY_REBUILD_PERSONDATA_TYPE_RIPPLE_PHYSICAL_TO_LOGICALDATA_TYPE_USAGE_RECALC_APPLICATIONCOMPLEXITY_REBUILDAUTH_SOURCE_RECALC_FLOW_RATINGSLOGICAL_FLOW_CLEANUP_ORPHANSATTESTATION_CLEANUP_ORPHANS() { + JobKey[] result = JobKey.values(); + assertThat(result[0], is(JobKey.HIERARCHY_REBUILD_CHANGE_INITIATIVE)); + assertThat(result[1], is(JobKey.HIERARCHY_REBUILD_DATA_TYPE)); + assertThat(result[2], is(JobKey.HIERARCHY_REBUILD_ENTITY_STATISTICS)); + assertThat(result[3], is(JobKey.HIERARCHY_REBUILD_MEASURABLE)); + assertThat(result[4], is(JobKey.HIERARCHY_REBUILD_ORG_UNIT)); + assertThat(result[5], is(JobKey.HIERARCHY_REBUILD_PERSON)); + assertThat(result[6], is(JobKey.DATA_TYPE_RIPPLE_PHYSICAL_TO_LOGICAL)); + assertThat(result[7], is(JobKey.DATA_TYPE_USAGE_RECALC_APPLICATION)); + assertThat(result[8], is(JobKey.COMPLEXITY_REBUILD)); + assertThat(result[9], is(JobKey.AUTH_SOURCE_RECALC_FLOW_RATINGS)); + assertThat(result[10], is(JobKey.LOGICAL_FLOW_CLEANUP_ORPHANS)); + assertThat(result[11], is(JobKey.ATTESTATION_CLEANUP_ORPHANS)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobLifecycleStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobLifecycleStatusTest.java new file mode 100644 index 0000000000..ed771f65c2 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/scheduled_job/JobLifecycleStatusTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.scheduled_job; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.scheduled_job.JobLifecycleStatus + * + * @author Diffblue JCover + */ + +public class JobLifecycleStatusTest { + + @Test + public void valuesReturnsRUNNABLERUNNINGCOMPLETEDERRORED() { + JobLifecycleStatus[] result = JobLifecycleStatus.values(); + assertThat(result[0], is(JobLifecycleStatus.RUNNABLE)); + assertThat(result[1], is(JobLifecycleStatus.RUNNING)); + assertThat(result[2], is(JobLifecycleStatus.COMPLETED)); + assertThat(result[3], is(JobLifecycleStatus.ERRORED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/software_catalog/MaturityStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/software_catalog/MaturityStatusTest.java new file mode 100644 index 0000000000..6732200272 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/software_catalog/MaturityStatusTest.java @@ -0,0 +1,27 @@ +package com.khartec.waltz.model.software_catalog; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.software_catalog.MaturityStatus + * + * @author Diffblue JCover + */ + +public class MaturityStatusTest { + + @Test + public void valuesReturnsPLANNEDINVESTHOLDDISINVESTUNSUPPORTEDRESTRICTEDUNKNOWN() { + MaturityStatus[] result = MaturityStatus.values(); + assertThat(result[0], is(MaturityStatus.PLANNED)); + assertThat(result[1], is(MaturityStatus.INVEST)); + assertThat(result[2], is(MaturityStatus.HOLD)); + assertThat(result[3], is(MaturityStatus.DISINVEST)); + assertThat(result[4], is(MaturityStatus.UNSUPPORTED)); + assertThat(result[5], is(MaturityStatus.RESTRICTED)); + assertThat(result[6], is(MaturityStatus.UNKNOWN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/staticpanel/ContentKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/staticpanel/ContentKindTest.java new file mode 100644 index 0000000000..3fa83bf615 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/staticpanel/ContentKindTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.staticpanel; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.staticpanel.ContentKind + * + * @author Diffblue JCover + */ + +public class ContentKindTest { + + @Test + public void valuesReturnsHTMLMARKDOWN() { + ContentKind[] result = ContentKind.values(); + assertThat(result[0], is(ContentKind.HTML)); + assertThat(result[1], is(ContentKind.MARKDOWN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyInstanceStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyInstanceStatusTest.java new file mode 100644 index 0000000000..a6ceeafacb --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyInstanceStatusTest.java @@ -0,0 +1,26 @@ +package com.khartec.waltz.model.survey; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.survey.SurveyInstanceStatus + * + * @author Diffblue JCover + */ + +public class SurveyInstanceStatusTest { + + @Test + public void valuesReturnsNOT_STARTEDIN_PROGRESSCOMPLETEDREJECTEDWITHDRAWNAPPROVED() { + SurveyInstanceStatus[] result = SurveyInstanceStatus.values(); + assertThat(result[0], is(SurveyInstanceStatus.NOT_STARTED)); + assertThat(result[1], is(SurveyInstanceStatus.IN_PROGRESS)); + assertThat(result[2], is(SurveyInstanceStatus.COMPLETED)); + assertThat(result[3], is(SurveyInstanceStatus.REJECTED)); + assertThat(result[4], is(SurveyInstanceStatus.WITHDRAWN)); + assertThat(result[5], is(SurveyInstanceStatus.APPROVED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyIssuanceKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyIssuanceKindTest.java new file mode 100644 index 0000000000..b7634f92f5 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyIssuanceKindTest.java @@ -0,0 +1,22 @@ +package com.khartec.waltz.model.survey; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.survey.SurveyIssuanceKind + * + * @author Diffblue JCover + */ + +public class SurveyIssuanceKindTest { + + @Test + public void valuesReturnsGROUPINDIVIDUAL() { + SurveyIssuanceKind[] result = SurveyIssuanceKind.values(); + assertThat(result[0], is(SurveyIssuanceKind.GROUP)); + assertThat(result[1], is(SurveyIssuanceKind.INDIVIDUAL)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyQuestionFieldTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyQuestionFieldTypeTest.java new file mode 100644 index 0000000000..f2a35c45ae --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyQuestionFieldTypeTest.java @@ -0,0 +1,29 @@ +package com.khartec.waltz.model.survey; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.survey.SurveyQuestionFieldType + * + * @author Diffblue JCover + */ + +public class SurveyQuestionFieldTypeTest { + + @Test + public void valuesReturnsAPPLICATIONBOOLEANDATEDROPDOWNDROPDOWN_MULTI_SELECTNUMBERPERSONTEXTTEXTAREA() { + SurveyQuestionFieldType[] result = SurveyQuestionFieldType.values(); + assertThat(result[0], is(SurveyQuestionFieldType.APPLICATION)); + assertThat(result[1], is(SurveyQuestionFieldType.BOOLEAN)); + assertThat(result[2], is(SurveyQuestionFieldType.DATE)); + assertThat(result[3], is(SurveyQuestionFieldType.DROPDOWN)); + assertThat(result[4], is(SurveyQuestionFieldType.DROPDOWN_MULTI_SELECT)); + assertThat(result[5], is(SurveyQuestionFieldType.NUMBER)); + assertThat(result[6], is(SurveyQuestionFieldType.PERSON)); + assertThat(result[7], is(SurveyQuestionFieldType.TEXT)); + assertThat(result[8], is(SurveyQuestionFieldType.TEXTAREA)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyRunStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyRunStatusTest.java new file mode 100644 index 0000000000..5433d0b1fc --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/survey/SurveyRunStatusTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.survey; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.survey.SurveyRunStatus + * + * @author Diffblue JCover + */ + +public class SurveyRunStatusTest { + + @Test + public void valuesReturnsDRAFTISSUEDCOMPLETED() { + SurveyRunStatus[] result = SurveyRunStatus.values(); + assertThat(result[0], is(SurveyRunStatus.DRAFT)); + assertThat(result[1], is(SurveyRunStatus.ISSUED)); + assertThat(result[2], is(SurveyRunStatus.COMPLETED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/system/job_log/JobStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/system/job_log/JobStatusTest.java new file mode 100644 index 0000000000..ca97bf542c --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/system/job_log/JobStatusTest.java @@ -0,0 +1,23 @@ +package com.khartec.waltz.model.system.job_log; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.system.job_log.JobStatus + * + * @author Diffblue JCover + */ + +public class JobStatusTest { + + @Test + public void valuesReturnsSUCCESSFAILUREIN_PROGRESS() { + JobStatus[] result = JobStatus.values(); + assertThat(result[0], is(JobStatus.SUCCESS)); + assertThat(result[1], is(JobStatus.FAILURE)); + assertThat(result[2], is(JobStatus.IN_PROGRESS)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeLifecycleStatusTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeLifecycleStatusTest.java new file mode 100644 index 0000000000..6ab89e9778 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeLifecycleStatusTest.java @@ -0,0 +1,24 @@ +package com.khartec.waltz.model.taxonomy_management; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.taxonomy_management.TaxonomyChangeLifecycleStatus + * + * @author Diffblue JCover + */ + +public class TaxonomyChangeLifecycleStatusTest { + + @Test + public void valuesReturnsDRAFTABORTEDEXECUTEDFAILED() { + TaxonomyChangeLifecycleStatus[] result = TaxonomyChangeLifecycleStatus.values(); + assertThat(result[0], is(TaxonomyChangeLifecycleStatus.DRAFT)); + assertThat(result[1], is(TaxonomyChangeLifecycleStatus.ABORTED)); + assertThat(result[2], is(TaxonomyChangeLifecycleStatus.EXECUTED)); + assertThat(result[3], is(TaxonomyChangeLifecycleStatus.FAILED)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeTypeTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeTypeTest.java new file mode 100644 index 0000000000..1f2ed9fe93 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/taxonomy_management/TaxonomyChangeTypeTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.taxonomy_management; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.taxonomy_management.TaxonomyChangeType + * + * @author Diffblue JCover + */ + +public class TaxonomyChangeTypeTest { + + @Test + public void valuesReturnsADD_PEERADD_CHILDREMOVEDEPRECATEUPDATE_NAMEUPDATE_DESCRIPTIONUPDATE_CONCRETENESSUPDATE_EXTERNAL_IDMOVEMERGE() { + TaxonomyChangeType[] result = TaxonomyChangeType.values(); + assertThat(result[0], is(TaxonomyChangeType.ADD_PEER)); + assertThat(result[1], is(TaxonomyChangeType.ADD_CHILD)); + assertThat(result[2], is(TaxonomyChangeType.REMOVE)); + assertThat(result[3], is(TaxonomyChangeType.DEPRECATE)); + assertThat(result[4], is(TaxonomyChangeType.UPDATE_NAME)); + assertThat(result[5], is(TaxonomyChangeType.UPDATE_DESCRIPTION)); + assertThat(result[6], is(TaxonomyChangeType.UPDATE_CONCRETENESS)); + assertThat(result[7], is(TaxonomyChangeType.UPDATE_EXTERNAL_ID)); + assertThat(result[8], is(TaxonomyChangeType.MOVE)); + assertThat(result[9], is(TaxonomyChangeType.MERGE)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/usage_info/UsageKindTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/usage_info/UsageKindTest.java new file mode 100644 index 0000000000..6494efb503 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/usage_info/UsageKindTest.java @@ -0,0 +1,30 @@ +package com.khartec.waltz.model.usage_info; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.usage_info.UsageKind + * + * @author Diffblue JCover + */ + +public class UsageKindTest { + + @Test + public void isReadOnly() { + assertThat(UsageKind.MODIFIER.isReadOnly(), is(false)); + assertThat(UsageKind.CONSUMER.isReadOnly(), is(true)); + } + + @Test + public void valuesReturnsCONSUMERDISTRIBUTORMODIFIERORIGINATOR() { + UsageKind[] result = UsageKind.values(); + assertThat(result[0], is(UsageKind.CONSUMER)); + assertThat(result[1], is(UsageKind.DISTRIBUTOR)); + assertThat(result[2], is(UsageKind.MODIFIER)); + assertThat(result[3], is(UsageKind.ORIGINATOR)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/user/SystemRoleTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/user/SystemRoleTest.java new file mode 100644 index 0000000000..aafed44718 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/user/SystemRoleTest.java @@ -0,0 +1,47 @@ +package com.khartec.waltz.model.user; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + +import java.util.Set; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.user.SystemRole + * + * @author Diffblue JCover + */ + +public class SystemRoleTest { + + @Test + public void allNames() { + Set result = SystemRole.allNames(); + } + + @Test + public void valuesReturnsADMINAPP_EDITORANONYMOUSATTESTATION_ADMINAUTHORITATIVE_SOURCE_EDITORBETA_TESTERBOOKMARK_EDITORCAPABILITY_EDITORCHANGE_INITIATIVE_EDITORCHANGE_SET_EDITORLINEAGE_EDITORLOGICAL_DATA_FLOW_EDITORORG_UNIT_EDITORRATING_EDITORSCENARIO_ADMINSCENARIO_EDITORSURVEY_ADMINSURVEY_TEMPLATE_ADMINTAXONOMY_EDITORUSER_ADMIN() { + SystemRole[] result = SystemRole.values(); + assertThat(result[0], is(SystemRole.ADMIN)); + assertThat(result[1], is(SystemRole.APP_EDITOR)); + assertThat(result[2], is(SystemRole.ANONYMOUS)); + assertThat(result[3], is(SystemRole.ATTESTATION_ADMIN)); + assertThat(result[4], is(SystemRole.AUTHORITATIVE_SOURCE_EDITOR)); + assertThat(result[5], is(SystemRole.BETA_TESTER)); + assertThat(result[6], is(SystemRole.BOOKMARK_EDITOR)); + assertThat(result[7], is(SystemRole.CAPABILITY_EDITOR)); + assertThat(result[8], is(SystemRole.CHANGE_INITIATIVE_EDITOR)); + assertThat(result[9], is(SystemRole.CHANGE_SET_EDITOR)); + assertThat(result[10], is(SystemRole.LINEAGE_EDITOR)); + assertThat(result[11], is(SystemRole.LOGICAL_DATA_FLOW_EDITOR)); + assertThat(result[12], is(SystemRole.ORG_UNIT_EDITOR)); + assertThat(result[13], is(SystemRole.RATING_EDITOR)); + assertThat(result[14], is(SystemRole.SCENARIO_ADMIN)); + assertThat(result[15], is(SystemRole.SCENARIO_EDITOR)); + assertThat(result[16], is(SystemRole.SURVEY_ADMIN)); + assertThat(result[17], is(SystemRole.SURVEY_TEMPLATE_ADMIN)); + assertThat(result[18], is(SystemRole.TAXONOMY_EDITOR)); + assertThat(result[19], is(SystemRole.USER_ADMIN)); + } +} diff --git a/waltz-model/src/jcover/java/com/khartec/waltz/model/utils/IdUtilitiesTest.java b/waltz-model/src/jcover/java/com/khartec/waltz/model/utils/IdUtilitiesTest.java new file mode 100644 index 0000000000..b779dc9502 --- /dev/null +++ b/waltz-model/src/jcover/java/com/khartec/waltz/model/utils/IdUtilitiesTest.java @@ -0,0 +1,31 @@ +package com.khartec.waltz.model.utils; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertArrayEquals; + +import com.khartec.waltz.model.IdCommandResponse; + +import java.util.LinkedList; + +import org.junit.Test; + +/** + * Unit tests for com.khartec.waltz.model.utils.IdUtilities + * + * @author Diffblue JCover + */ + +public class IdUtilitiesTest { + + @Test + public void isEmpty() { + assertThat(IdUtilities.indexById(new LinkedList()).isEmpty(), is(true)); + assertThat(IdUtilities.indexByOptId(new LinkedList()).isEmpty(), is(true)); + } + + @Test + public void toIdArrayXsIsEmptyReturnsEmpty() { + assertArrayEquals(new Long[] { }, IdUtilities.toIdArray(new LinkedList())); + } +}