Collection attributes =new TreeSet(new AttributeNameComparator());
Attribute attribute = new Attribute("test");
attributes.add(attribute);
resource2.setAttributes(attributes);
resources.add(resource2);
Application application = new Application("test");
application.setResources(resources);
Resource resource3 = new Resource("test3");
String currentResource3 = resource.getId();
resources2.add(resource3);
Resource resource4 = new Resource("test4");
String currentResource4 = resource2.getId();
resources2.add(resource4);
Application application2 = new Application("test2");
application2.setResources(resources2);
applications.add(application);
applications.add(application2);
resource2.setBaseDn("BaseDn");
Application a = applicationService.get(application.getId(), applications);
resourceService.save(resource2,a);
assertEquals("BaseDn must be equals to BaseDn","BaseDn",resourceService.get(resource2.getId(),a).getBaseDn());
assertFalse("Attributes must not be null",resourceService.get(resource2.getId(),a).getAttributes().size()==0);