Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

/*
* StatusRepositoryTest.java
* Copyright (c) 2017 Veterans Affairs.
*/
package gov.va.oneconsult.seoc.api.repository;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import gov.va.oneconsult.seoc.api.model.Status;
import gov.va.oneconsult.seoc.api.util.Constants;

/**
* Description: StatusRepository Level Test Cases
* @author AbleVets
*/
@RunWith(SpringJUnit4ClassRunner.class)
@DataJpaTest
public class StatusRepositoryTest
{

@Autowired
private StatusRepository statusRepo;

private String draft = Constants.STATUS_INPROGRESS;

/**
* Description:SetUp method run before each test case
*/
@Before
public void setUp()
{

}

/**
* Description:TearDown to be run after each test case.
*/
@After
public void tearDown()
{

}

/**
* Description:Test case to check the correctness of status record obtained by
* description.
*/
@Test
public void testFindByDescription()
{
// Obtain status for draft
Status status = statusRepo.findByDescription(draft);
// Check if the description has value DRAFT
assertThat(status).hasFieldOrPropertyWithValue("description", draft);
}

}