Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-272

SetAttribute does not persist attributes in JPA provider

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • PLINK_2.5.1.Final
    • IDM

      This test fails in setAttibute to a BasicModel entity:

      @Test
      	@InSequence(1)
      	@Transactional
      	public void testIdentityManagerUserCreation() throws Exception {
      		/* Bad userName */
      		
      		String userName = "testusername";
      		String userLocaleCode = "ca-es";
      		
      		User newUser = new User(userName);
      		newUser.setEmail("test@test.com");
      		
      		identityManager.add(newUser);
      		Password password = new Password("password");
      		this.identityManager.updateCredential(newUser, password);
      			
      		User user = BasicModel.getUser(identityManager, userName);
      		newUser.setAttribute(new Attribute<String>(Constants.ATTRIBUTE_NAME_LOCALE_CODE, "ca-es"));
      		
      		identityManager.update(newUser);
      		
      		user = BasicModel.getUser(identityManager, userName);
      		Assert.assertNotNull(user);
      		Attribute<String> localeCodeAttribute = user.getAttribute(Constants.ATTRIBUTE_NAME_LOCALE_CODE);
      		Assert.assertNotNull(localeCodeAttribute);
      		
      		Assert.assertEquals(localeCodeAttribute.getValue(), userLocaleCode);
      		
      
      		
      		
      	}
      

              psilva@redhat.com Pedro Igor Craveiro
              esteveavi_jira Esteve Aviles (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: