UpdatePermanentIdRequestDialog extends IPlantDialog { public PermanentIdRequestUpdate getPermanentIdRequestUpdate() { PermanentIdRequestUpdate update = factory.getStatus().as(); update.setStatus(statusCombo.getCurrentValue().toString()); update.setComments(commentsEditor.getCurrentValue()); return update; } UpdatePermanentIdRequestDialog(String curr_status,
                                          final PermanentIdRequestDetails details,
                                          PermanentIdRequestAutoBeanFactory factory); PermanentIdRequestUpdate getPermanentIdRequestUpdate(); @Override void show();  }
@Test public void testGetPermanentIdRequestUpdate() { when(mockStatusCombo.getCurrentValue()).thenReturn(PermanentIdRequestStatus.Approved); when(mockCommentsEditor.getValue()).thenReturn("testing"); when(mockCurrentStatusLabel.getText()).thenReturn(PermanentIdRequestStatus.Submitted.toString()); when(mockUserEmail.getText()).thenReturn("foo@bar.com"); when(mockPrfactory.getStatus()).thenReturn(mockAutoBeanStatus); when(mockAutoBeanStatus.as()).thenReturn(mockStatusUpdate); final PermanentIdRequestUpdate pru = mock(PermanentIdRequestUpdate.class); pru.setComments("testing"); pru.setStatus(PermanentIdRequestStatus.Approved.toString()); PermanentIdRequestUpdate result = dialog.getPermanentIdRequestUpdate(); assertEquals(pru.getComments(), result.getComments()); assertEquals(pru.getStatus(), result.getStatus()); }