Search in sources :

Example 16 with Security

use of org.codice.ddf.security.impl.Security in project ddf by codice.

the class CommandJobTest method testUnableToGetSessionFactory.

/**
 * Tests that there is no exception when unable to get the {@link SessionFactory}
 */
@Test
public void testUnableToGetSessionFactory() {
    // given
    CommandJob commandJob = new CommandJob(new Security()) {

        @Override
        public Subject getSystemSubject() {
            return createMockSubject();
        }

        @Override
        protected SessionFactory getSessionFactory() {
            return null;
        }
    };
    String command = VALID_COMMAND;
    // when
    commandJob.execute(createMockJobExecutionContext(command));
}
Also used : Security(org.codice.ddf.security.impl.Security) Test(org.junit.Test)

Example 17 with Security

use of org.codice.ddf.security.impl.Security in project ddf by codice.

the class CommandJobTest method testNullContext.

/**
 * Tests that there is no exception when the {@link JobExecutionContext} is null
 */
@Test
public void testNullContext() {
    // given
    CommandJob commandJob = new CommandJob(new Security());
    // when
    commandJob.execute(null);
}
Also used : Security(org.codice.ddf.security.impl.Security) Test(org.junit.Test)

Example 18 with Security

use of org.codice.ddf.security.impl.Security in project ddf by codice.

the class CommandJobTest method testNullCommand.

/**
 * Tests that there is no exception when command input is null
 */
@Test
public void testNullCommand() {
    // given
    CommandJob commandJob = new CommandJob(new Security());
    String command = null;
    // when
    commandJob.execute(createMockJobExecutionContext(command));
}
Also used : Security(org.codice.ddf.security.impl.Security) Test(org.junit.Test)

Aggregations

Security (org.codice.ddf.security.impl.Security)18 Test (org.junit.Test)14 FilterPlugin (ddf.catalog.security.filter.plugin.FilterPlugin)5 PermissionsImpl (ddf.security.permission.impl.PermissionsImpl)4 SecurityLogger (ddf.security.audit.SecurityLogger)3 QueryResponseImpl (ddf.catalog.operation.impl.QueryResponseImpl)2 Subject (ddf.security.Subject)2 SubjectUtils (ddf.security.service.impl.SubjectUtils)2 Before (org.junit.Before)2 AttributeRegistry (ddf.catalog.data.AttributeRegistry)1 Metacard (ddf.catalog.data.Metacard)1 ResultImpl (ddf.catalog.data.impl.ResultImpl)1 GeotoolsFilterAdapterImpl (ddf.catalog.filter.proxy.adapter.GeotoolsFilterAdapterImpl)1 DeleteRequest (ddf.catalog.operation.DeleteRequest)1 QueryResponse (ddf.catalog.operation.QueryResponse)1 ResourceRequest (ddf.catalog.operation.ResourceRequest)1 CreateRequestImpl (ddf.catalog.operation.impl.CreateRequestImpl)1 DeleteResponseImpl (ddf.catalog.operation.impl.DeleteResponseImpl)1 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)1 ResourceResponseImpl (ddf.catalog.operation.impl.ResourceResponseImpl)1