Commit f16c2d8266db6db419c84c9f8b292f187c093e97
1 parent
1de62462
Exists in
master
Adição dos testes para update e insert no DelegateCrud
Showing
1 changed file
with
11 additions
and
3 deletions
Show diff stats
impl/core/src/test/java/br/gov/frameworkdemoiselle/template/DelegateCrudTest.java
... | ... | @@ -91,25 +91,33 @@ public class DelegateCrudTest { |
91 | 91 | PowerMock.verify(); |
92 | 92 | } |
93 | 93 | |
94 | - @Ignore | |
94 | + @SuppressWarnings("unchecked") | |
95 | 95 | @Test |
96 | 96 | public void testUpdate() { |
97 | 97 | Whitebox.setInternalState(delegateCrud, "delegate", mockCrud); |
98 | 98 | |
99 | + mockStatic(Beans.class); | |
100 | + | |
101 | + expect(Beans.getReference(EasyMock.anyObject(Class.class))).andReturn(mockCrud); | |
102 | + | |
99 | 103 | Contact update = new Contact(); |
100 | 104 | mockCrud.update(update); |
101 | - replayAll(mockCrud); | |
105 | + replayAll(Beans.class, mockCrud); | |
102 | 106 | |
103 | 107 | delegateCrud.update(update); |
104 | 108 | |
105 | 109 | verifyAll(); |
106 | 110 | } |
107 | 111 | |
108 | - @Ignore | |
112 | + @SuppressWarnings("unchecked") | |
109 | 113 | @Test |
110 | 114 | public void testInsert() { |
111 | 115 | Whitebox.setInternalState(delegateCrud, "delegate", mockCrud); |
112 | 116 | |
117 | + mockStatic(Beans.class); | |
118 | + | |
119 | + expect(Beans.getReference(EasyMock.anyObject(Class.class))).andReturn(mockCrud); | |
120 | + | |
113 | 121 | Contact insert = new Contact(); |
114 | 122 | mockCrud.insert(insert); |
115 | 123 | replayAll(mockCrud); | ... | ... |