Search in sources :

Example 11 with ValidReasonAssignmentDto

use of org.openlmis.stockmanagement.dto.ValidReasonAssignmentDto in project openlmis-stockmanagement by OpenLMIS.

the class ValidReasonAssignmentDtoBuilderTest method shouldReturnNullIfNullIsPassedToBuildDto.

@Test
public void shouldReturnNullIfNullIsPassedToBuildDto() {
    ValidReasonAssignmentDto dto = dtoBuilder.build((ValidReasonAssignment) null);
    assertNull(dto);
}
Also used : ValidReasonAssignmentDto(org.openlmis.stockmanagement.dto.ValidReasonAssignmentDto) Test(org.junit.Test)

Example 12 with ValidReasonAssignmentDto

use of org.openlmis.stockmanagement.dto.ValidReasonAssignmentDto in project openlmis-stockmanagement by OpenLMIS.

the class ValidReasonAssignmentDtoBuilderTest method shouldBuildListOfDtosWithProperServiceUrls.

@Test
public void shouldBuildListOfDtosWithProperServiceUrls() {
    ValidReasonAssignment assignment = new ValidReasonAssignmentDataBuilder().build();
    ValidReasonAssignment assignment2 = new ValidReasonAssignmentDataBuilder().withFacilityType(UUID.randomUUID()).withProgram(UUID.randomUUID()).build();
    List<ValidReasonAssignmentDto> dtos = dtoBuilder.build(Lists.newArrayList(assignment, assignment2));
    assertEquals(2, dtos.size());
    assertValidReasonAssignmentDto(assignment, dtos.get(0));
    assertValidReasonAssignmentDto(assignment2, dtos.get(1));
}
Also used : ValidReasonAssignmentDataBuilder(org.openlmis.stockmanagement.testutils.ValidReasonAssignmentDataBuilder) ValidReasonAssignment(org.openlmis.stockmanagement.domain.reason.ValidReasonAssignment) ValidReasonAssignmentDto(org.openlmis.stockmanagement.dto.ValidReasonAssignmentDto) Test(org.junit.Test)

Aggregations

ValidReasonAssignmentDto (org.openlmis.stockmanagement.dto.ValidReasonAssignmentDto)12 Test (org.junit.Test)9 ValidReasonAssignment (org.openlmis.stockmanagement.domain.reason.ValidReasonAssignment)8 ResultActions (org.springframework.test.web.servlet.ResultActions)5 UUID (java.util.UUID)4 UUID.randomUUID (java.util.UUID.randomUUID)3 StockCardLineItemReason (org.openlmis.stockmanagement.domain.reason.StockCardLineItemReason)2 ValidReasonAssignmentDataBuilder (org.openlmis.stockmanagement.testutils.ValidReasonAssignmentDataBuilder)2 ResponseEntity (org.springframework.http.ResponseEntity)1