Skip to content

Commit

Permalink
Added version and test cased to Module Resource default representation (
Browse files Browse the repository at this point in the history
openmrs#291)

Added version to Module Resource default representation

Test cases added to moduleController Test

VersionInDefaultRepresentation added to moduleController Test
  • Loading branch information
suthagar23 authored and dkayiwa committed Aug 7, 2017
1 parent a61911a commit 7a39d69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
description.addProperty("display");
description.addProperty("name");
description.addProperty("description");
description.addProperty("version");
description.addProperty("started");
description.addProperty("startupErrorMessage");
description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ public void shouldIncludeAuthorToFullRepresentation() throws Exception {
Assert.assertNotNull(PropertyUtils.getProperty(result, "author"));
}

@Test
public void shouldIncludeVersionToDefaultRepresentation() throws Exception {
MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + getUuid());
SimpleObject result = deserialize(handle(req));

Assert.assertNotNull(PropertyUtils.getProperty(result, "version"));
}

@Test
public void shouldUploadModule() throws Exception {
byte[] fileData = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("mockModule.omod"));
Expand Down

0 comments on commit 7a39d69

Please sign in to comment.