Search in sources :

Example 11 with StockCardTemplateDto

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

the class StockCardTemplateServiceTest method shouldReturnNullWhenNoTemplateFound.

@Test
public void shouldReturnNullWhenNoTemplateFound() {
    // when: searching for non-existing template
    StockCardTemplateDto dto = stockCardTemplateService.findByProgramIdAndFacilityTypeId(UUID.randomUUID(), UUID.randomUUID());
    // then
    assertNull(dto);
}
Also used : StockCardTemplateDto(org.openlmis.stockmanagement.dto.StockCardTemplateDto) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 12 with StockCardTemplateDto

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

the class StockCardTemplateDataBuilder method createTemplateDto.

/**
 * Create template dto.
 *
 * @return dto.
 */
public static StockCardTemplateDto createTemplateDto() {
    StockCardTemplateDto dto = new StockCardTemplateDto();
    dto.setFacilityTypeId(UUID.randomUUID());
    dto.setProgramId(UUID.randomUUID());
    dto.getStockCardFields().add(new StockCardFieldDto("packSize", true, 123));
    dto.getStockCardLineItemFields().add(new StockCardLineItemFieldDto("documentNumber", true, 456));
    return dto;
}
Also used : StockCardTemplateDto(org.openlmis.stockmanagement.dto.StockCardTemplateDto) StockCardLineItemFieldDto(org.openlmis.stockmanagement.dto.StockCardLineItemFieldDto) StockCardFieldDto(org.openlmis.stockmanagement.dto.StockCardFieldDto)

Aggregations

StockCardTemplateDto (org.openlmis.stockmanagement.dto.StockCardTemplateDto)12 Test (org.junit.Test)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)9 StockCardFieldDto (org.openlmis.stockmanagement.dto.StockCardFieldDto)5 StockCardLineItemFieldDto (org.openlmis.stockmanagement.dto.StockCardLineItemFieldDto)3 UUID (java.util.UUID)2 ValidationMessageException (org.openlmis.stockmanagement.exception.ValidationMessageException)1 ResponseEntity (org.springframework.http.ResponseEntity)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1