use of org.apache.geode.security.NotAuthorizedException in project geode by apache.
the class ContainsKey66Test method integratedSecurityShouldFailIfNotAuthorized.
@Test
public void integratedSecurityShouldFailIfNotAuthorized() throws Exception {
when(this.securityService.isClientSecurityRequired()).thenReturn(true);
when(this.securityService.isIntegratedSecurity()).thenReturn(true);
doThrow(new NotAuthorizedException("")).when(this.securityService).authorizeRegionRead(eq(REGION_NAME), eq(KEY));
this.containsKey66.cmdExecute(this.message, this.serverConnection, 0);
verify(this.securityService).authorizeRegionRead(eq(REGION_NAME), eq(KEY));
verify(this.errorResponseMessage).send(eq(this.serverConnection));
}
use of org.apache.geode.security.NotAuthorizedException in project geode by apache.
the class ContainsKeyTest method oldSecurityShouldFailIfNotAuthorized.
@Test
public void oldSecurityShouldFailIfNotAuthorized() throws Exception {
when(this.securityService.isClientSecurityRequired()).thenReturn(true);
when(this.securityService.isIntegratedSecurity()).thenReturn(false);
doThrow(new NotAuthorizedException("")).when(this.authzRequest).containsKeyAuthorize(eq(REGION_NAME), eq(KEY));
containsKey.cmdExecute(this.message, this.serverConnection, 0);
verify(this.authzRequest).containsKeyAuthorize(eq(REGION_NAME), eq(KEY));
verify(this.errorResponseMessage).send(eq(this.serverConnection));
}
use of org.apache.geode.security.NotAuthorizedException in project geode by apache.
the class ContainsKeyTest method integratedSecurityShouldFailIfNotAuthorized.
@Test
public void integratedSecurityShouldFailIfNotAuthorized() throws Exception {
when(this.securityService.isClientSecurityRequired()).thenReturn(true);
when(this.securityService.isIntegratedSecurity()).thenReturn(true);
doThrow(new NotAuthorizedException("")).when(this.securityService).authorizeRegionRead(eq(REGION_NAME), eq(KEY));
containsKey.cmdExecute(this.message, this.serverConnection, 0);
verify(this.securityService).authorizeRegionRead(eq(REGION_NAME), eq(KEY));
verify(this.errorResponseMessage).send(eq(this.serverConnection));
}
use of org.apache.geode.security.NotAuthorizedException in project geode by apache.
the class CreateRegionTest method integratedSecurityShouldFailIfNotAuthorized.
@Test
public void integratedSecurityShouldFailIfNotAuthorized() throws Exception {
when(this.securityService.isClientSecurityRequired()).thenReturn(true);
when(this.securityService.isIntegratedSecurity()).thenReturn(true);
doThrow(new NotAuthorizedException("")).when(this.securityService).authorizeDataManage();
this.createRegion.cmdExecute(this.message, this.serverConnection, 0);
verify(this.securityService).authorizeDataManage();
verify(this.errorResponseMessage).send(eq(this.serverConnection));
}
use of org.apache.geode.security.NotAuthorizedException in project geode by apache.
the class DestroyRegionTest method integratedSecurityShouldFailIfNotAuthorized.
@Test
public void integratedSecurityShouldFailIfNotAuthorized() throws Exception {
when(this.securityService.isClientSecurityRequired()).thenReturn(true);
when(this.securityService.isIntegratedSecurity()).thenReturn(true);
doThrow(new NotAuthorizedException("")).when(this.securityService).authorizeDataManage();
this.destroyRegion.cmdExecute(this.message, this.serverConnection, 0);
verify(this.errorResponseMessage).send(this.serverConnection);
}
Aggregations