return array;
}
}
+
+ private static class X6 {
+ @Id
+ int id;
+
+ public X1 getNotaGetter(String aMessage) {
+ return null;
+ }
+
+ public void getNotaGetter2() {
+
+ }
+ }
+
+ private static class X7 {
+ @Id
+ int id;
+
+ private void getX() {
+ fail("Private getters should not be used");
+ }
+ }
@Test
public void testSimple() {
JpaMergeSupport.merge(x, y);
}
+ @Test
+ public void testNotAGetter() {
+ X6 x = new X6();
+ x.id = 100;
+ X6 y = new X6();
+
+ JpaMergeSupport.merge(x,y);
+ assertEquals(x.id, y.id);
+ }
+
+ @Test
+ public void testPrivateGetter() {
+ X7 x = new X7();
+ x.id = 100;
+ X7 y = new X7();
+ JpaMergeSupport.merge(x,y);
+ assertEquals(x.id, y.id);
+ }
}