@Test public void test_annotated_but_empty_class_yield_empty_values_in_descriptor() { System.out.println( "AnnotatedValueCollectorTest.test_annotated_but_empty_class_yield_empty_values_in_descriptor() " + collector.collect(new SealedEmptyAccount("123", "personal"))); BeanDescriptor<Value> d = collector.collect(new SealedEmptyAccount("123", "personal")).some(); Assert.assertTrue(d.getValues().isEmpty()); Assert.assertNotNull(d.getSecret()); Assert.assertFalse("".equals(d.getSecret())); }
@Test public void test_sealed_bean_value_mappings() { BeanDescriptor<Value> d = collector.collect(customer).some(); Map<String, Value> values = d.getValues(); Assert.assertEquals(customer.getCustomerNo(), values.get("customerNo").getValue()); Assert.assertEquals(customer.getAccount().getAccountNo(), values.get("account").getValue()); }
@Test public void test_sealed_bean_yields_sealed_values() { BeanDescriptor<Value> d = collector.collect(customer).some(); Assert.assertTrue(d.getValues().containsKey("customerNo")); Assert.assertTrue(d.getValues().containsKey("account")); }
@Test public void test_sealed_bean_with_specified_secret() { Assert.assertEquals("shh!", collector.collect(new BeanWithSecret()).some().getSecret()); }
@Test public void test_unannotated_class_yield_empty() { Assert.assertTrue(collector.collect(account).isNone()); }