Search in sources :

Example 6 with TestTicketUtils

use of com.emc.metalnx.services.tests.tickets.TestTicketUtils in project metalnx-web by irods-contrib.

the class TestTicketWithExpirationDate method setUp.

@Before
public void setUp() throws DataGridException, JargonException, IOException {
    String parentPath = String.format("/%s/home", zone);
    targetPath = String.format("%s/%s", parentPath, username);
    ticketUtils = new TestTicketUtils(irodsServices);
    ticketString = ticketUtils.createTicket(parentPath, username, TicketCreateModeEnum.WRITE);
    ticketUtils.setExpirationDate(ticketString, yesterday());
    localFile = ticketUtils.createLocalFile();
    filePath = String.format("%s/%s", targetPath, localFile.getName());
}
Also used : TestTicketUtils(com.emc.metalnx.services.tests.tickets.TestTicketUtils) Before(org.junit.Before)

Example 7 with TestTicketUtils

use of com.emc.metalnx.services.tests.tickets.TestTicketUtils in project metalnx-web by irods-contrib.

the class TestTicketWithUsesLimit method setUp.

@Before
public void setUp() throws DataGridException, JargonException, IOException {
    String parentPath = String.format("/%s/home", zone);
    targetPath = String.format("%s/%s", parentPath, username);
    ticketUtils = new TestTicketUtils(irodsServices);
    ticketString = ticketUtils.createTicket(parentPath, username, TicketCreateModeEnum.WRITE);
    ticketUtils.setUsesLimit(ticketString, USES_LIMIT);
    localFile = ticketUtils.createLocalFile();
    localFile2 = ticketUtils.createLocalFile("ticket-file-2-" + System.currentTimeMillis());
    filePath1 = String.format("%s/%s", targetPath, localFile.getName());
    filePath2 = String.format("%s/%s", targetPath, localFile2.getName());
}
Also used : TestTicketUtils(com.emc.metalnx.services.tests.tickets.TestTicketUtils) Before(org.junit.Before)

Example 8 with TestTicketUtils

use of com.emc.metalnx.services.tests.tickets.TestTicketUtils in project metalnx-web by irods-contrib.

the class TestTicketWithGroupRestriction method setUp.

@Before
public void setUp() throws DataGridException, JargonException, IOException {
    String parentPath = String.format("/%s/home", zone);
    targetPath = String.format("%s/%s", parentPath, username);
    ticketUtils = new TestTicketUtils(irodsServices);
    ticketString = ticketUtils.createTicket(parentPath, username, TicketCreateModeEnum.WRITE);
    ticketUtils.addGroupRestriction(ticketString, PUBLIC_GROUP);
    localFile = ticketUtils.createLocalFile();
    filePath = String.format("%s/%s", targetPath, localFile.getName());
}
Also used : TestTicketUtils(com.emc.metalnx.services.tests.tickets.TestTicketUtils) Before(org.junit.Before)

Aggregations

TestTicketUtils (com.emc.metalnx.services.tests.tickets.TestTicketUtils)8 Before (org.junit.Before)8 UserTokenDetails (com.emc.metalnx.services.auth.UserTokenDetails)1 IRODSAccount (org.irods.jargon.core.connection.IRODSAccount)1 Authentication (org.springframework.security.core.Authentication)1 SecurityContext (org.springframework.security.core.context.SecurityContext)1