public ProfileId profile(String profile) { return new ProfileId(namespace, profile); }
public ProfileId profile(String profile) { return new ProfileId(namespace, profile); }
@SuppressWarnings("unused") public static ProfileId fromIdParts(Iterable<String> idString) { Iterator<String> iterator = idString.iterator(); return new ProfileId(next(iterator, "namespace"), nextAndEnd(iterator, "profile")); }
@SuppressWarnings("unused") public static ProfileId fromIdParts(Iterable<String> idString) { Iterator<String> iterator = idString.iterator(); return new ProfileId(next(iterator, "namespace"), nextAndEnd(iterator, "profile")); }
@Test public void testSetPreferenceWithProfiles() throws Exception { // put my profile ProfileId myProfile = new ProfileId(TEST_NAMESPACE1, "MyProfile"); putProfile(myProfile, Profile.NATIVE, 200); // put some properties with my profile, it should work fine Map<String, String> properties = new HashMap<>(); properties.put("1st key", "1st value"); properties.put("2nd key", "2nd value"); properties.put(SystemArguments.PROFILE_NAME, "USER:MyProfile"); Map<String, String> expected = ImmutableMap.copyOf(properties); setPreferences(getPreferenceURI(TEST_NAMESPACE1), properties, 200); Assert.assertEquals(expected, getPreferences(getPreferenceURI(TEST_NAMESPACE1), false, 200)); // put some property with non-existing profile, it should fail with 404 properties.put(SystemArguments.PROFILE_NAME, "NonExisting"); setPreferences(getPreferenceURI(TEST_NAMESPACE1), properties, 404); Assert.assertEquals(expected, getPreferences(getPreferenceURI(TEST_NAMESPACE1), false, 200)); // disable the profile and put again, it should fail with 409 disableProfile(myProfile, 200); properties.put(SystemArguments.PROFILE_NAME, "USER:MyProfile"); setPreferences(getPreferenceURI(TEST_NAMESPACE1), properties, 409); Assert.assertEquals(expected, getPreferences(getPreferenceURI(TEST_NAMESPACE1), false, 200)); deletePreferences(getPreferenceURI(TEST_NAMESPACE1), 200); } }
ProfileId myProfile = new ProfileId(NamespaceId.DEFAULT.getNamespace(), "MyProfile"); Profile profile1 = new Profile("MyProfile", Profile.NATIVE.getLabel(), Profile.NATIVE.getDescription(), Profile.NATIVE.getScope(), Profile.NATIVE.getProvisioner());
ProfileId profileId = new ProfileId("myspace", "userProfile"); profileStore.saveProfile(profileId, Profile.NATIVE); profileStore.disableProfile(profileId);
ProfileId myProfile = new ProfileId(NamespaceId.DEFAULT.getNamespace(), "MyProfile"); Profile profile1 = new Profile("MyProfile", Profile.NATIVE.getLabel(), Profile.NATIVE.getDescription(), Profile.NATIVE.getScope(), Profile.NATIVE.getProvisioner()); ProfileId myProfile2 = new ProfileId(NamespaceId.DEFAULT.getNamespace(), "MyProfile2"); Profile profile2 = new Profile("MyProfile2", Profile.NATIVE.getLabel(), Profile.NATIVE.getDescription(), Profile.NATIVE.getScope(), Profile.NATIVE.getProvisioner());