1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.impl.repository;
17
18 import org.junit.Before;
19 import org.junit.Test;
20 import org.kuali.rice.krad.service.BusinessObjectService;
21 import org.kuali.rice.krms.api.repository.ReferenceObjectBindingGenTest;
22 import org.kuali.rice.krms.api.repository.reference.ReferenceObjectBinding;
23 import static org.mockito.Mockito.*;
24
25
26
27
28
29 public final class ReferenceObjectBindingBoServiceImplGenTest {
30
31 ReferenceObjectBindingBoServiceImpl referenceObjectBindingBoServiceImpl;
32 ReferenceObjectBinding referenceObjectBinding;
33
34 ReferenceObjectBinding getReferenceObjectBinding() {
35 return referenceObjectBinding;
36 }
37
38 public void setReferenceObjectBindingBoServiceImpl(ReferenceObjectBindingBoServiceImpl impl) {
39 this.referenceObjectBindingBoServiceImpl = impl;
40 }
41
42 public static org.kuali.rice.krms.impl.repository.ReferenceObjectBindingBoServiceImplGenTest create(ReferenceObjectBindingBoServiceImpl impl) {
43 org.kuali.rice.krms.impl.repository.ReferenceObjectBindingBoServiceImplGenTest test = new org.kuali.rice.krms.impl.repository.ReferenceObjectBindingBoServiceImplGenTest();
44 test.setReferenceObjectBindingBoServiceImpl(impl);
45 return test;
46 }
47
48 @Before
49 public void setUp() {
50 referenceObjectBindingBoServiceImpl = new ReferenceObjectBindingBoServiceImpl();
51 referenceObjectBindingBoServiceImpl.setBusinessObjectService(mock(BusinessObjectService.class));
52 }
53
54 @Test(expected = java.lang.IllegalArgumentException.class)
55 public void test_findReferenceObjectBindingsByCollectionName_null_fail() {
56 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByCollectionName(null);
57 }
58
59 @Test(expected = java.lang.IllegalArgumentException.class)
60 public void test_findReferenceObjectBindingsByKrmsDiscriminatorType_null_fail() {
61 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByKrmsDiscriminatorType(null);
62 }
63
64 @Test(expected = java.lang.IllegalArgumentException.class)
65 public void test_findReferenceObjectBindingsByKrmsObject_null_fail() {
66 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByKrmsObject(null);
67 }
68
69 @Test(expected = java.lang.IllegalArgumentException.class)
70 public void test_findReferenceObjectBindingsByNamespace_null_fail() {
71 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByNamespace(null);
72 }
73
74 @Test(expected = java.lang.IllegalArgumentException.class)
75 public void test_findReferenceObjectBindingsByReferenceDiscriminatorType_null_fail() {
76 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByReferenceDiscriminatorType(null);
77 }
78
79 @Test(expected = java.lang.IllegalArgumentException.class)
80 public void test_findReferenceObjectBindingsByReferenceObject_null_fail() {
81 referenceObjectBindingBoServiceImpl.findReferenceObjectBindingsByReferenceObject(null);
82 }
83
84 @Test
85 public void test_from_null_yields_null() {
86 assert(referenceObjectBindingBoServiceImpl.from(null) == null);
87 }
88
89 @Test
90 public void test_from() {
91 ReferenceObjectBinding def = ReferenceObjectBindingGenTest.buildFullReferenceObjectBinding();
92 ReferenceObjectBindingBo referenceObjectBindingBo = referenceObjectBindingBoServiceImpl.from(def);
93 assert(referenceObjectBindingBo.getKrmsDiscriminatorType().equals(def.getKrmsDiscriminatorType()));
94 assert(referenceObjectBindingBo.getKrmsObjectId().equals(def.getKrmsObjectId()));
95 assert(referenceObjectBindingBo.getNamespace().equals(def.getNamespace()));
96 assert(referenceObjectBindingBo.getReferenceDiscriminatorType().equals(def.getReferenceDiscriminatorType()));
97 assert(referenceObjectBindingBo.getReferenceObjectId().equals(def.getReferenceObjectId()));
98 assert(referenceObjectBindingBo.getId().equals(def.getId()));
99 }
100
101 @Test
102 public void test_to() {
103 ReferenceObjectBinding def = ReferenceObjectBindingGenTest.buildFullReferenceObjectBinding();
104 ReferenceObjectBindingBo referenceObjectBindingBo = referenceObjectBindingBoServiceImpl.from(def);
105 ReferenceObjectBinding def2 = ReferenceObjectBindingBo.to(referenceObjectBindingBo);
106 assert(def.equals(def2));
107 }
108
109 @Test
110 public void test_createReferenceObjectBinding() {
111 ReferenceObjectBinding def = ReferenceObjectBindingGenTest.buildFullReferenceObjectBinding();
112 referenceObjectBinding = referenceObjectBindingBoServiceImpl.createReferenceObjectBinding(def);
113 }
114
115 @Test(expected = java.lang.IllegalArgumentException.class)
116 public void test_createReferenceObjectBinding_null_fail() {
117 referenceObjectBindingBoServiceImpl.createReferenceObjectBinding(null);
118 }
119
120 @Test(expected = java.lang.IllegalArgumentException.class)
121 public void test_updateReferenceObjectBinding_null_fail() {
122 referenceObjectBindingBoServiceImpl.updateReferenceObjectBinding(null);
123 }
124
125 @Test(expected = java.lang.IllegalArgumentException.class)
126 public void test_deleteReferenceObjectBinding_null_fail() {
127 referenceObjectBindingBoServiceImpl.deleteReferenceObjectBinding(null);
128 }
129
130
131
132
133
134 }