Class AdminWebServiceTest
java.lang.Object
ubic.gemma.rest.AdminWebServiceTest
@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
public class AdminWebServiceTest
extends Object
Pure-Mockito tests for
AdminWebService: cache list / clear / clear-named,
Hibernate stats snapshot.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidsetUp()voidvoidvoidvoid
-
Constructor Details
-
AdminWebServiceTest
public AdminWebServiceTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
listCachesReturnsAlphabeticallySortedNames
@Test public void listCachesReturnsAlphabeticallySortedNames() -
clearAllCachesIteratesEveryCache
@Test public void clearAllCachesIteratesEveryCache() -
clearAllCachesTolleratesMissingCache
@Test public void clearAllCachesTolleratesMissingCache() -
clearNamedCacheReturns204
@Test public void clearNamedCacheReturns204() -
clearMissingCacheThrows404
@Test public void clearMissingCacheThrows404() -
hibernateStatsSnapshotMirrorsStatisticsFields
@Test public void hibernateStatsSnapshotMirrorsStatisticsFields() -
resetHibernateStatsClearsStatistics
@Test public void resetHibernateStatsClearsStatistics() -
getJobsReturnsEmptyListWhenNoTasks
@Test public void getJobsReturnsEmptyListWhenNoTasks() -
getJobsAggregatesStatusCountsAndSortsNewestFirst
@Test public void getJobsAggregatesStatusCountsAndSortsNewestFirst() -
getSystemReturnsHeapNonHeapThreadsAndOsBlocks
@Test public void getSystemReturnsHeapNonHeapThreadsAndOsBlocks() -
getSessionsReturnsEmptyWhenNoPrincipals
@Test public void getSessionsReturnsEmptyWhenNoPrincipals() -
getSessionsSkipsPrincipalsWithNoActiveSessions
@Test public void getSessionsSkipsPrincipalsWithNoActiveSessions() -
getSessionsAggregatesUserDetailsAndStringPrincipals
@Test public void getSessionsAggregatesUserDetailsAndStringPrincipals() -
getCurationStatusSnapshotComposesAnnotationSetAndTicketAggregates
@Test public void getCurationStatusSnapshotComposesAnnotationSetAndTicketAggregates() -
getCurationStatusEmptyTablesReturnsZeroes
@Test public void getCurationStatusEmptyTablesReturnsZeroes() -
clearSecurityContext
@AfterEach public void clearSecurityContext() -
getUsers_excludesSoftDeleted_byDefault
@Test public void getUsers_excludesSoftDeleted_byDefault() -
getUsers_includesSoftDeleted_whenFlagTrue
@Test public void getUsers_includesSoftDeleted_whenFlagTrue() -
getUsers_marksAdminFlag_whenAdministratorsGroupPresent
@Test public void getUsers_marksAdminFlag_whenAdministratorsGroupPresent() -
createUser_returnsTempPassword_andCallsManager
@Test public void createUser_returnsTempPassword_andCallsManager() -
createUser_returns409_whenUsernameTaken
@Test public void createUser_returns409_whenUsernameTaken() -
createUser_returns409_whenEmailTaken
@Test public void createUser_returns409_whenEmailTaken() -
createUser_addsToAdminGroup_whenIsAdminTrue
@Test public void createUser_addsToAdminGroup_whenIsAdminTrue() -
patchUser_togglesEnabled
@Test public void patchUser_togglesEnabled() -
patchUser_addsToAdminGroup_whenIsAdminTrueAndNotAlready
@Test public void patchUser_addsToAdminGroup_whenIsAdminTrueAndNotAlready() -
patchUser_removesFromAdminGroup_whenIsAdminFalseAndCurrentlyAdmin
@Test public void patchUser_removesFromAdminGroup_whenIsAdminFalseAndCurrentlyAdmin() -
patchUser_returns400_whenBodyEmpty
@Test public void patchUser_returns400_whenBodyEmpty() -
patchUser_returns404_whenUserNotFound
@Test public void patchUser_returns404_whenUserNotFound() -
deleteUser_callsSoftDelete_andReturns204
@Test public void deleteUser_callsSoftDelete_andReturns204() -
deleteUser_returns404_whenUserNotFound
@Test public void deleteUser_returns404_whenUserNotFound() -
resetUserPassword_returnsTempPassword_andCallsManager
@Test public void resetUserPassword_returnsTempPassword_andCallsManager() -
resetUserPassword_returns404_whenUserNotFound
@Test public void resetUserPassword_returns404_whenUserNotFound() -
resetUserPassword_returns409_whenUserSoftDeleted
@Test public void resetUserPassword_returns409_whenUserSoftDeleted() -
importGeoBatch_happyPath_submitsOneTaskPerAccession
@Test public void importGeoBatch_happyPath_submitsOneTaskPerAccession() -
importGeoBatch_skipsBlankEntries_butSubmitsTheRest
@Test public void importGeoBatch_skipsBlankEntries_butSubmitsTheRest() -
importGeoBatch_returns400_whenBodyMissing
@Test public void importGeoBatch_returns400_whenBodyMissing() -
importGeoBatch_returns400_whenAccessionsEmpty
@Test public void importGeoBatch_returns400_whenAccessionsEmpty() -
importGeoBatch_returns400_whenAllAccessionsBlank
@Test public void importGeoBatch_returns400_whenAllAccessionsBlank() -
importGeoBatch_returns400_whenBatchExceedsCap
@Test public void importGeoBatch_returns400_whenBatchExceedsCap() -
deleteUser_returns409_whenSelfDelete
@Test public void deleteUser_returns409_whenSelfDelete() -
grabGeoRecords_returnsMappedValueObjects
- Throws:
IOException
-
grabGeoRecords_returns400_whenAccessionsEmpty
@Test public void grabGeoRecords_returns400_whenAccessionsEmpty() -
grabGeoRecords_returns502_whenGeoBrowserThrowsIOException
- Throws:
IOException
-
submitGeoScrape_happyPath_submits202
@Test public void submitGeoScrape_happyPath_submits202() -
submitGeoScrape_dryRunTrue_returnsSyncCandidateList
@Test public void submitGeoScrape_dryRunTrue_returnsSyncCandidateList() -
submitGeoScrape_nullBody_submitsDefaults
@Test public void submitGeoScrape_nullBody_submitsDefaults() -
getLastGeoScrape_happyPath_returnsValueObject
@Test public void getLastGeoScrape_happyPath_returnsValueObject() -
getLastGeoScrape_returns404_whenNoWatermark
@Test public void getLastGeoScrape_returns404_whenNoWatermark() -
submitMultifunctionalityRecompute_happyPath_submitsTaskWithResolvedTaxon
@Test public void submitMultifunctionalityRecompute_happyPath_submitsTaskWithResolvedTaxon() -
addBlacklistEntry_happyPath_createsBlacklistedExperiment
@Test public void addBlacklistEntry_happyPath_createsBlacklistedExperiment() -
addBlacklistEntry_happyPath_createsBlacklistedPlatform
@Test public void addBlacklistEntry_happyPath_createsBlacklistedPlatform() -
addBlacklistEntry_returns409_whenAlreadyBlacklisted
@Test public void addBlacklistEntry_returns409_whenAlreadyBlacklisted() -
addBlacklistEntry_returns400_whenBodyMissing
@Test public void addBlacklistEntry_returns400_whenBodyMissing() -
addBlacklistEntry_returns400_whenReasonBlank
@Test public void addBlacklistEntry_returns400_whenReasonBlank() -
addBlacklistEntry_returns400_whenAccessionPrefixUnrecognised
@Test public void addBlacklistEntry_returns400_whenAccessionPrefixUnrecognised() -
deleteBlacklistEntry_happyPath_returns204
@Test public void deleteBlacklistEntry_happyPath_returns204() -
deleteBlacklistEntry_returns404_whenAccessionNotFound
@Test public void deleteBlacklistEntry_returns404_whenAccessionNotFound() -
listBlacklistEntries_paginatesAndSortsByAccession
@Test public void listBlacklistEntries_paginatesAndSortsByAccession() -
listBlacklistEntries_returns400_whenLimitNegative
@Test public void listBlacklistEntries_returns400_whenLimitNegative() -
listBlacklistEntries_capsLimitAtMaxPageSize
@Test public void listBlacklistEntries_capsLimitAtMaxPageSize()
-