|
@@ -87,7 +87,6 @@ public class BakerControllerTest {
|
87
|
87
|
@Test
|
88
|
88
|
public void getBakerById() throws Exception {
|
89
|
89
|
Long bakerId = 1L;
|
90
|
|
-
|
91
|
90
|
given(bakerRepository.findById(bakerId)).willReturn(Optional.of(froilan));
|
92
|
91
|
|
93
|
92
|
mvc.perform(get(GOOD_URL)
|
|
@@ -98,7 +97,6 @@ public class BakerControllerTest {
|
98
|
97
|
@Test
|
99
|
98
|
public void getBakerIdFail() throws Exception {
|
100
|
99
|
Long bakerId = 500L;
|
101
|
|
-
|
102
|
100
|
given(bakerRepository.findById(bakerId)).willReturn(null);
|
103
|
101
|
|
104
|
102
|
mvc.perform(get(GOOD_URL + "/{id}", bakerId)
|
|
@@ -120,7 +118,6 @@ public class BakerControllerTest {
|
120
|
118
|
|
121
|
119
|
@Test
|
122
|
120
|
public void getAllBakersFail() throws Exception {
|
123
|
|
-
|
124
|
121
|
given(bakerRepository.findAll()).willReturn(null);
|
125
|
122
|
|
126
|
123
|
mvc.perform(get(BAD_URL))
|
|
@@ -144,7 +141,6 @@ public class BakerControllerTest {
|
144
|
141
|
@Test
|
145
|
142
|
public void updateBakerFail() throws Exception {
|
146
|
143
|
froilan.setId(500L);
|
147
|
|
-
|
148
|
144
|
given(bakerRepository.findById(froilan.getId())).willReturn(null);
|
149
|
145
|
|
150
|
146
|
|
|
@@ -158,7 +154,6 @@ public class BakerControllerTest {
|
158
|
154
|
|
159
|
155
|
@Test
|
160
|
156
|
public void deleteBakerSuccess() throws Exception {
|
161
|
|
-
|
162
|
157
|
given(bakerRepository.findById(froilan.getId()))
|
163
|
158
|
.willReturn(Optional.ofNullable(froilan));
|
164
|
159
|
|
|
@@ -169,7 +164,6 @@ public class BakerControllerTest {
|
169
|
164
|
|
170
|
165
|
@Test
|
171
|
166
|
public void deleteBakerFail() throws Exception {
|
172
|
|
-
|
173
|
167
|
given(bakerRepository.findById(froilan.getId()))
|
174
|
168
|
.willReturn(null);
|
175
|
169
|
|