use of org.hisp.dhis.webapi.json.domain.JsonOrganisationUnit in project dhis2-core by dhis2.
the class MetadataWorkflowControllerTest method testAcceptUpdateProposal.
@Test
void testAcceptUpdateProposal() {
String proposalId = postUpdateNameProposal(defaultTargetId, "New name");
assertStatus(HttpStatus.OK, POST("/metadata/proposals/" + proposalId));
JsonOrganisationUnit ou = GET("/organisationUnits/{uid}", defaultTargetId).content().as(JsonOrganisationUnit.class);
assertEquals("New name", ou.getName());
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.json.domain.JsonOrganisationUnit in project dhis2-core by dhis2.
the class MetadataWorkflowControllerTest method testAcceptAddProposal.
@Test
void testAcceptAddProposal() {
String proposalId = postAddProposal("My OU", "OU1");
String ouId = assertStatus(HttpStatus.CREATED, POST("/metadata/proposals/" + proposalId));
JsonOrganisationUnit ou = GET("/organisationUnits/{uid}", ouId).content().as(JsonOrganisationUnit.class);
assertEquals("My OU", ou.getName());
JsonMetadataProposal proposal = GET("/metadata/proposals/{uid}", proposalId).content().asObject(JsonMetadataProposal.class);
assertEquals(MetadataProposalStatus.ACCEPTED, proposal.getStatus());
assertNotNull(proposal.getFinalisedBy());
assertNotNull(proposal.getFinalised());
}
Aggregations