Surefire Report

Summary


Tests Errors Failures Skipped Success Rate Time
98 0 0 0 100% 4.686

Note: failures are anticipated and checked for with assertions while errors are unanticipated.

Package List


Package Tests Errors Failures Skipped Success Rate Time
com.atlassian.gadgets.dashboard.internal.rest 35 0 0 0 100% 1.168
com.atlassian.gadgets.dashboard.internal.impl 51 0 0 0 100% 0.447
com.atlassian.gadgets.dashboard 12 0 0 0 100% 3.071

Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.

com.atlassian.gadgets.dashboard.internal.rest

Class Tests Errors Failures Skipped Success Rate Time
UpdateGadgetUserPrefsHandlerImplTest 5 0 0 0 100% 0.103
GadgetResourceTest 7 0 0 0 100% 0.373
DeleteGadgetHandlerImplTest 2 0 0 0 100% 0.009
ChangeGadgetColorHandlerImplTest 4 0 0 0 100% 0.456
ChangeLayoutHandlerImplTest 7 0 0 0 100% 0.061
DashboardResourceTest 4 0 0 0 100% 0.071
AddGadgetHandlerImplTest 6 0 0 0 100% 0.095

com.atlassian.gadgets.dashboard.internal.impl

Class Tests Errors Failures Skipped Success Rate Time
DashboardImplTest 21 0 0 0 100% 0.142
DashboardRepositoryImplTest 1 0 0 0 100% 0.059
GadgetImplTest 13 0 0 0 100% 0.081
CachingDashboardStateStoreImplTest 6 0 0 0 100% 0.068
DashboardStateCacheImplTest 4 0 0 0 100% 0.058
GadgetFactoryImplTest 2 0 0 0 100% 0.024
DashboardServiceImplTest 4 0 0 0 100% 0.015

com.atlassian.gadgets.dashboard

Class Tests Errors Failures Skipped Success Rate Time
GadgetUserPrefsTest 10 0 0 0 100% 2.136
DashboardParserTest 2 0 0 0 100% 0.935

Test Cases

DashboardImplTest

assertThatDefaultLayoutIs2EqualColumns 0.006
assertThatColumn1ExistsWhenLayoutIs2EqualColumns 0
assertThatColumn3DoesNotExistWhenLayoutIs2EqualColumns 0
assertThatColumn3ExistsAfterChangingTo3ColumnLayout 0.037
assertThatColumn2DoesNotExistAfterChangingTo1ColumnLayout 0.001
assertThatAppendGadgetWithoutColumnParameterAppendsToFirstColumn 0.038
assertThatAppendGadgetWithColumnParameterAppendsToDesiredColumn 0
assertThatAddGadgetWithoutColumnParameterPrependsToFirstColumn 0
assertThatAddGadgetWithColumnParameterPrependsToDesiredColumn 0
assertThatDashboardContainsAddedGadgets 0.001
assertThatAllGadgetsAreInTheFirstColumnAfterChangingTo1ColumnLayout 0.008
assertThatChangeLayoutThrowsExceptionIfGadgetLayoutContainsMoreColumnsThanDashboardLayoutAllows 0.001
assertThatGadgetsAreInTheRightPlaceAfterRearranging 0.001
assertThatGadgetsNotOnTheDashboardAreIgnoredWhenRearranging 0.002
assertThatGadgetLayoutExceptionIsThrownIfProvidedGadgetLayoutContainsMoreColumnsThanDashboardLayout 0.001
assertThatGadgetLayoutExceptionIsThrownIfProvidedGadgetLayoutDoesNotContainAllGadgetsOnTheDashboard 0.001
assertThatGadgetColorGetsChanged 0.003
assertThatTryingToChangeTheColorOfNonExistentGadgetThrowsException 0
assertThatTryingToChangeTheColorOfNonLoadedGadgetThrowsException 0.001
assertThatRemoveGadgetReallyRemovesTheGadget 0.001
assertThatTryingToRemoveNonExistentGadgetDoesNothing 0.002

GadgetUserPrefsTest

gotCorrectNumberOfInputElements 0.39
basicStringPrefIsRenderedCorrectly 0.261
requiredStringPrefIsRenderedCorrectly 0.248
boolPrefIsRenderedCorrectly 0.177
requiredBoolPrefIsRenderedCorrectly 0.198
enumPrefIsRenderedCorrectly 0.159
requiredEnumPrefIsRenderedCorrectly 0.171
listPrefIsRenderedCorrectly 0.187
requiredListPrefIsRenderedCorrectly 0.157
hiddenPrefIsRenderedCorrectly 0.163

UpdateGadgetUserPrefsHandlerImplTest

assertThatInconsistentDashboardStateExceptionReturnsConflict 0.015
assertThatHandlerReturnsImmediatelyIfDashboardNotFound 0.002
assertThatNoContentStatusCodeIsSentOnSuccess 0.068
assertThatBadRequestStatusCodeIsSentWhenIllegallySettingRequiredPref 0.005
assertThatHandlerReturnsImmediatelyIfGadgetIsNotFound 0.005

GadgetResourceTest

assertthatDeleteGadgetReturnsUnauthorizedIfDashboardIsNotWritable 0.335
assertThatDeleteGadgetViaPOSTRejectsRequestWithEmptyMethodParameter 0.003
assertThatColorChangeReturnsUnauthorizedIfDashboardIsNotWritable 0.001
assertThatInvalidColorParameterCausesBadRequestResponse 0.003
assertThatColorChangeViaPOSTRejectsRequestWithEmptyMethodParameter 0.003
assertThatPrefChangeReturnsUnauthorizedIfDashboardIsNotWritable 0.003
assertThatPrefChangeViaPOSTRejectsRequestWithEmptyMethodParameter 0.01

DeleteGadgetHandlerImplTest

assertThatNoContentStatusIsSentOnSuccess 0.002
assertThatInconsistentDashboardStateExceptionReturnsConflict 0.001

ChangeGadgetColorHandlerImplTest

assertThatInconsistentDashboardStateExceptionReturnsConflict 0.377
assertThatHandlerReturnsImmediatelyIfDashboardNotFound 0.012
assertThatNoContentStatusCodeIsSentOnSuccess 0.003
assertThatHandlerReturnsImmediatelyIfGadgetIsNotFound 0.002

DashboardRepositoryImplTest

verifyInconsistentDashboardStateExceptionIsThrownWhenRetrievedStateDoesNotMatchStoredState 0.055

GadgetImplTest

assertThatTryingToGetTitleOfNonLoadedGadgetThrowsException 0.001
assertThatTryingToGetSpecUrlOfNonLoadedGadgetThrowsException 0
assertThatTryingToGetHeightOfNonLoadedGadgetThrowsException 0
assertThatTryingToGetWidthOfNonLoadedGadgetThrowsException 0.001
testUpdateUserPrefs 0.037
updateUserPrefsRejectsNullValueForRequiredPref 0.002
updateUserPrefsRejectsEmptyStringForRequiredPref 0.003
updateUserPrefsTransformsEmptyStringIntoFalseValueForRequiredBooleanPref 0.001
updateUserPrefsAcceptsEmptyStringForNonRequiredPref 0.001
assertThatNonHiddenUserPrefsReturnsTrueWhenThereAreAMixOfHiddenAndNonHiddenUserPrefs 0.004
assertThatNonHiddenUserPrefsReturnsFalseWhenThereAreOnlyHiddenUserPrefs 0.001
assertThatNonHiddenUserPrefsReturnsTrueWhenThereAreOnlyNonHiddenUserPrefs 0.002
assertThatNonHiddenUserPrefsReturnsFalseWhenThereAreNoUserPrefs 0.001

ChangeLayoutHandlerImplTest

assertThatHandlerReturnsImmediatelyIfDashboardNotFound 0.009
assertThatInconsistentStateExceptionReturnsConflict 0.004
assertThatLayoutParameterOnlyRearrangesGadgetsAndSetsNoContentStatus 0.004
assertThatDashboardLayoutIsChangedWhenLayoutParameterIsPresentAndNoContentStatusIsSet 0
assertThatHandlerSendsBadRequestErrorWhenLayoutParameterIsInvalid 0
assertThatThrowingGadgetLayoutExceptionWhenRearrangingGadgetsResultsInSendingBadRequestResponse 0.001
assertThatThrowingGadgetLayoutExceptionWhenChangingDashboardLayoutResultsInSendingBadRequestResponse 0

CachingDashboardStateStoreImplTest

verifyStateIsRetrievedFromCache 0.022
verifyStateIsRetrievedFromStoreAndCachedOnCacheMiss 0
verifyStateIsUpdatedInCacheAndStoredWhenSaved 0.001
verifyCacheIsClearedWhenUnderlyingStoreThrowsAnException 0.038
verifyStateIsRemovedFromCacheWhenRetrievedStateDoesNotMatchStoredState 0
verifyThatStateIsRemovedFromCacheWhenRemovedFromStore 0.001

DashboardStateCacheImplTest

verifyGetDelegatesToCache 0.034
verifyPutDelegatesToCache 0.005
verifyRemoveDelegatesToCache 0.007
verifyRemoveAllDelegatesToCache 0

DashboardResourceTest

addGadgetReturnsBadRequestOnMissingUrlParameter 0.051
addGadgetReturnsServerErrorOnJsonError 0.001
addGadgetReturnsUnauthorizedIfDashboardIsNotWritable 0.005
changeLayoutReturnsUnauthorizedIfDashboardIsNotWritable 0.005

GadgetFactoryImplTest

assertThatCanCreateGadget 0.02
assertThatIllegalUrlThrowsInvalidGadgetSpecUrlException 0.001

DashboardParserTest

parsesEmptyDashboard 0.71
parsesDashboardWithGadget 0.223

DashboardServiceImplTest

assertThatDashboardStateIsReturnedWhenGettingADashboardUserHasReadAccessTo 0.002
assertThatPermissionExceptionIsThrownWhenTryingToGetDashboardAndUserDoesNotHaveReadPermission 0
assertThatDashboardStateIsReturnedWhenSavingADashboardUserHasWriteAccessTo 0.007
assertThatPermissionExceptionIsThrownWhenTryingToSaveDashboardAndUserDoesNotHaveWritePermission 0.001

AddGadgetHandlerImplTest

assertThatCreatedCodeAndLocationHeaderAreSetOnSuccess 0.07
assertThatHandlerReturnsImmediatelyIfDashboardNotFound 0.006
assertThatInvalidGadgetSpecUriCausesBadRequestResponse 0.003
assertThatNonHttpOrHttpsGadgetSpecUriCausesBadRequest 0.005
assertThatBadRequestResponseIsSentIfGadgetFactoryCannotParseGadgetSpec 0.001
assertThatInconsistentStateExceptionReturnsConflict 0.001