Skip to content

Commit

Permalink
[ANDROSDK-831] Fix TEA handler test
Browse files Browse the repository at this point in the history
  • Loading branch information
vgarciabnz committed May 25, 2020
1 parent b05be56 commit f4b5bcf
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ public class TrackedEntityAttributeHandlerShould {
@Mock
private IdentifiableObjectStore<TrackedEntityAttribute> trackedEntityAttributeStore;

@Mock
private TrackedEntityAttribute trackedEntityAttribute;

@Mock
private ObjectStyle objectStyle;

@Mock
private Access access;

private TrackedEntityAttribute trackedEntityAttribute;

// object to test
private List<TrackedEntityAttribute> trackedEntityAttributes;
private TrackedEntityAttributeHandler trackedEntityAttributeHandler;
Expand All @@ -70,13 +69,18 @@ public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
trackedEntityAttributeHandler = new TrackedEntityAttributeHandler(trackedEntityAttributeStore);

trackedEntityAttribute = TrackedEntityAttribute.builder()
.uid("test_tracked_entity_attribute_uid")
.style(objectStyle)
.name("name")
.displayName("display_name")
.formName("form_name")
.access(access)
.build();

trackedEntityAttributes = new ArrayList<>();
trackedEntityAttributes.add(trackedEntityAttribute);

when(trackedEntityAttribute.uid()).thenReturn("test_tracked_entity_attribute_uid");
when(trackedEntityAttribute.style()).thenReturn(objectStyle);
when(trackedEntityAttribute.formName()).thenReturn("form_name");
when(trackedEntityAttribute.access()).thenReturn(access);
when(access.read()).thenReturn(true);
}

Expand Down

0 comments on commit f4b5bcf

Please sign in to comment.