use of joynr.infrastructure.DacTypes.OwnerRegistrationControlEntry in project joynr by bmwcarit.
the class GlobalDomainAccessControlListEditorBeanTest method testRemoveOwnerRegistrationControlEntry.
@Test
public void testRemoveOwnerRegistrationControlEntry() {
OwnerRegistrationControlEntry orce = new OwnerRegistrationControlEntry(USER_ID, DOMAIN, INTERFACE_NAME, TrustLevel.HIGH, TrustLevel.LOW, Permission.ASK);
when(ownerRegistrationControlEntryManagerMock.removeByUserIdDomainAndInterfaceName(USER_ID, DOMAIN, INTERFACE_NAME)).thenReturn(orce);
assertTrue(globalDomainAccessControlListEditorSubject.removeOwnerRegistrationControlEntry(USER_ID, DOMAIN, INTERFACE_NAME));
verify(ownerRegistrationControlEntryManagerMock).removeByUserIdDomainAndInterfaceName(eq(USER_ID), eq(DOMAIN), eq(INTERFACE_NAME));
verify(globalDomainAccessControllerBeanMock).doFireOwnerRegistrationControlEntryChanged(eq(ChangeType.REMOVE), eq(orce));
}
use of joynr.infrastructure.DacTypes.OwnerRegistrationControlEntry in project joynr by bmwcarit.
the class OwnerRegistrationControlEntryManagerTest method testCreate.
@Test
public void testCreate() {
String userId = "user";
String domain = "domain";
String interfaceName = "interfaceName";
OwnerRegistrationControlEntry data = new OwnerRegistrationControlEntry(userId, domain, interfaceName, TrustLevel.MID, TrustLevel.HIGH, Permission.ASK);
CreateOrUpdateResult<OwnerRegistrationControlEntry> result = subject.createOrUpdate(data);
assertNotNull(result);
assertEquals(ChangeType.ADD, result.getChangeType());
assertNotNull(result.getEntry());
assertEquals(userId, result.getEntry().getUid());
flushAndClear();
OwnerRegistrationControlEntry[] persisted = subject.findByUserId(userId);
assertNotNull(persisted);
assertEquals(1, persisted.length);
}
use of joynr.infrastructure.DacTypes.OwnerRegistrationControlEntry in project joynr by bmwcarit.
the class OwnerRegistrationControlEntryManagerTest method testFindByUserIdAndThatAreEditable.
@Test
public void testFindByUserIdAndThatAreEditable() {
String userId = "userId";
String domain = "domain1";
create(userId, domain, "interfaceName", TrustLevel.MID, TrustLevel.HIGH, Permission.ASK);
create(userId, "domain2", "interfaceName", TrustLevel.MID, TrustLevel.HIGH, Permission.ASK);
DomainRoleEntryEntity domainRoleEntryEntity = new DomainRoleEntryEntity();
domainRoleEntryEntity.setUserId(userId);
domainRoleEntryEntity.setRole(Role.OWNER);
domainRoleEntryEntity.setDomains(Sets.newHashSet(domain));
entityManager.persist(domainRoleEntryEntity);
flushAndClear();
OwnerRegistrationControlEntry[] result = subject.findByUserIdAndThatIsEditable(userId);
assertNotNull(result);
assertEquals(1, result.length);
}
Aggregations