Пример #1
0
 @Test
 public void testConverterEnforcement() {
   ProfileHelper.setEnforceProfileDefinition(true);
   try {
     definition.addAttribute(NAME, new FakeConverter());
     assertEquals(FAKE_VALUE, definition.convert(NAME, VALUE));
   } finally {
     ProfileHelper.setEnforceProfileDefinition(false);
   }
 }
Пример #2
0
 @Test
 public void testNoConverterEnforcement() {
   ProfileHelper.setEnforceProfileDefinition(true);
   try {
     assertNull(definition.convert(NAME, VALUE));
   } finally {
     ProfileHelper.setEnforceProfileDefinition(false);
   }
 }
Пример #3
0
 @Test
 public void testConverterNoEnforcement() {
   definition.addAttribute(NAME, new FakeConverter());
   assertEquals(FAKE_VALUE, definition.convert(NAME, VALUE));
 }
Пример #4
0
 @Test
 public void testNoConverterNoEnforcement() {
   assertEquals(VALUE, definition.convert(NAME, VALUE));
 }