Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java')
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
index 3a4d3256b43..d7d63ef070f 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/attribute/ArtifactTest.java
@@ -73,10 +73,10 @@ public class ArtifactTest {
@SuppressWarnings("rawtypes")
@Mock private Attribute attribute;
+ @Mock private Attribute<Integer> integerAttribute;
+ @Mock private Attribute<String> notDeleted;
@SuppressWarnings("rawtypes")
- @Mock private Attribute notDeleted;
- @SuppressWarnings("rawtypes")
- @Mock private Attribute deleted;
+ @Mock private Attribute<String> deleted;
@SuppressWarnings("rawtypes")
@Mock private Attribute differentType;
@@ -118,7 +118,7 @@ public class ArtifactTest {
@Test
@SuppressWarnings("unchecked")
public void testAddAndGet() {
- Attribute<Object> attribute = mock(Attribute.class);
+ Attribute<String> attribute = mock(Attribute.class);
when(attribute.getOrcsData()).thenReturn(attributeData);
Assert.assertEquals(0, artifact.getAttributes().size());
artifact.add(CoreAttributeTypes.GeneralStringData, attribute);
@@ -142,7 +142,7 @@ public class ArtifactTest {
@Test
@SuppressWarnings("unchecked")
public void testAreAttributesDirty() {
- Attribute<Object> attribute = mock(Attribute.class);
+ Attribute<String> attribute = mock(Attribute.class);
when(attribute.getOrcsData()).thenReturn(attributeData);
artifact.add(CoreAttributeTypes.GeneralStringData, attribute);
Assert.assertFalse(artifact.areAttributesDirty());
@@ -311,9 +311,9 @@ public class ArtifactTest {
Assert.assertTrue(attributes.contains(differentType));
Assert.assertFalse(attributes.contains(deleted));
- attributes = artifact.getAttributes(CoreAttributeTypes.AccessContextId);
- Assert.assertEquals(1, attributes.size());
- Assert.assertTrue(attributes.contains(notDeleted));
+ List<Attribute<String>> attributes2 = artifact.getAttributes(CoreAttributeTypes.AccessContextId);
+ Assert.assertEquals(1, attributes2.size());
+ Assert.assertTrue(attributes2.contains(notDeleted));
}
@Test
@@ -322,16 +322,16 @@ public class ArtifactTest {
artifact.add(CoreAttributeTypes.AccessContextId, deleted);
when(notDeleted.getValue()).thenReturn("notDeleted");
when(deleted.getValue()).thenReturn("deleted");
- List<Object> values = artifact.getAttributeValues(CoreAttributeTypes.AccessContextId);
+ List<String> values = artifact.getAttributeValues(CoreAttributeTypes.AccessContextId);
Assert.assertEquals(1, values.size());
Assert.assertTrue(values.contains("notDeleted"));
}
@Test
public void testGetSoleAttributeAsString() {
- when(notDeleted.getValue()).thenReturn(new Integer(5));
- artifact.add(CoreAttributeTypes.AccessContextId, notDeleted);
- String attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.AccessContextId);
+ when(integerAttribute.getValue()).thenReturn(new Integer(5));
+ artifact.add(CoreAttributeTypes.ReviewId, integerAttribute);
+ String attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.ReviewId);
Assert.assertEquals("5", attribute);
attribute = artifact.getSoleAttributeAsString(CoreAttributeTypes.Category, "default");

Back to the top