use of org.hisp.dhis.webapi.controller.json.JsonMetadataProposal in project dhis2-core by dhis2.
the class MetadataWorkflowControllerTest method testAcceptRemoveProposal.
@Test
void testAcceptRemoveProposal() {
String proposalId = postRemoveProposal(defaultTargetId);
assertStatus(HttpStatus.OK, POST("/metadata/proposals/" + proposalId));
assertStatus(HttpStatus.NOT_FOUND, GET("/organisationUnits/{uid}", defaultTargetId));
JsonMetadataProposal proposal = GET("/metadata/proposals/{uid}", proposalId).content().asObject(JsonMetadataProposal.class);
assertEquals(MetadataProposalStatus.ACCEPTED, proposal.getStatus());
assertNotNull(proposal.getFinalisedBy());
assertNotNull(proposal.getFinalised());
}
use of org.hisp.dhis.webapi.controller.json.JsonMetadataProposal in project dhis2-core by dhis2.
the class MetadataWorkflowControllerTest method testMakeUpdateProposal.
@Test
void testMakeUpdateProposal() {
String proposalId = postUpdateNameProposal(defaultTargetId, "New Name");
JsonMetadataProposal proposal = GET("/metadata/proposals/{uid}", proposalId).content().asObject(JsonMetadataProposal.class);
assertEquals(MetadataProposalStatus.PROPOSED, proposal.getStatus());
assertEquals(MetadataProposalType.UPDATE, proposal.getType());
assertEquals(MetadataProposalTarget.ORGANISATION_UNIT, proposal.getTarget());
assertEquals(defaultTargetId, proposal.getTargetId());
assertNotNull(proposal.getCreated());
assertNotNull(proposal.getCreatedBy());
assertNull(proposal.getFinalisedBy());
assertNull(proposal.getFinalised());
assertNull(proposal.getComment());
assertNull(proposal.getReason());
assertTrue(proposal.getChange().isArray());
}
Aggregations