RM-4312: added comments to unit tests

This commit is contained in:
Silviu Dinuta
2016-11-07 10:47:10 +02:00
parent 567b98b848
commit 4ddac21418
5 changed files with 38 additions and 20 deletions

View File

@@ -50,6 +50,10 @@ public class HoldContainerTypeUnitTest extends BaseUnitTest
/** test object */
private @InjectMocks HoldContainerType holdContainerType;
/**
* Given that we try to add a non "rma:hold" type to hold container,
* Then InvalidParameterException is thrown.
*/
@Test (expected = InvalidParameterException.class)
public void testAddNonHoldTypeToHoldContainer()
{
@@ -64,6 +68,10 @@ public class HoldContainerTypeUnitTest extends BaseUnitTest
holdContainerType.onCreateChildAssociation(mockedChildAssoc, true);
}
/**
* Given that we try to add "rma:hold" type to hold container,
* Then the operation is successful.
*/
@Test
public void testAddHoldTypeToHoldContainer()
{

View File

@@ -50,6 +50,10 @@ public class TransferContainerTypeUnitTest extends BaseUnitTest
/** test object */
private @InjectMocks TransferContainerType transferContainerType;
/**
* Given that we try to add a non "rma:transfer" type to transfer container,
* Then InvalidParameterException is thrown.
*/
@Test(expected = InvalidParameterException.class)
public void testAddNonTransferTypeToTransferContainerTest()
{
@@ -65,6 +69,10 @@ public class TransferContainerTypeUnitTest extends BaseUnitTest
transferContainerType.onCreateChildAssociation(mockedChildAssoc, true);
}
/**
* Given that we try to add "rma:transfer" type to transfer container,
* Then the operation is successful.
*/
@Test
public void testAddTransferFolderToTransferContainer()
{

View File

@@ -52,6 +52,10 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest
@InjectMocks
private UnfiledRecordContainerType unfiledRecordContainerType;
/**
* Given that we try to add a type that is not one of "rma:unfiledRecordFolder", "cm:content" or "rma:nonElectronicDocument" types to unfiled record container,
* Then InvalidParameterException is thrown.
*/
@Test(expected = InvalidParameterException.class)
public void testAddNonAcceptedTypeToUnfiledRecordContainer()
{
@@ -69,6 +73,10 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest
unfiledRecordContainerType.onCreateChildAssociation(mockedChildAssoc, true);
}
/**
* Given that we try to add "rma:unfiledRecordFolder" sub-type to unfiled record container,
* Then the operation is successful.
*/
@Test
public void testAddUnfiledRecordFolderTypeToUnfiledRecordContainer()
{
@@ -86,6 +94,10 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest
unfiledRecordContainerType.onCreateChildAssociation(mockedChildAssoc, true);
}
/**
* Given that we try to add "cm:content" sub-type to unfiled record container,
* Then the operation is successful.
*/
@Test
public void testAddContentTypeToUnfiledRecordContainer()
{
@@ -103,6 +115,10 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest
unfiledRecordContainerType.onCreateChildAssociation(mockedChildAssoc, true);
}
/**
* Given that we try to add "rma:nonElectronicDocument" sub-type to unfiled record container,
* Then the operation is successful.
*/
@Test
public void testNonElectronicDocumentTypeToUnfiledRecordContainer()
{