### Question:
DLFileEntryTypeResolversImpl implements DLFileEntryTypeResolvers { @Override public DataFetcher<DLFileEntryType> deleteDLFileEntryTypeDataFetcher() { return environment -> { long fileEntryTypeId = util.getLongArg(environment, "fileEntryTypeId"); return dlFileEntryTypeLocalService.deleteDLFileEntryType(fileEntryTypeId); }; }  @Reference(unbind = "-") void setDLFileEntryTypeLocalService(DLFileEntryTypeLocalService dlFileEntryTypeLocalService); @Reference void setUtil(GraphQLUtil util); @Override DataFetcher<List<DLFileEntryType>> getDLFileEntryTypesDataFetcher(); @Override DataFetcher<List<DLFileEntryType>> getDLFileEntryTypesForFolderDataFetcher(); @Override DataFetcher<CompletableFuture<DLFileEntryType>> getDLFileEntryTypeDataFetcher(); @Override DataFetcher<DLFileEntryType> createDLFileEntryTypeDataFetcher(); @Override DataFetcher<DLFileEntryType> updateDLFileEntryTypeDataFetcher(); @Override DataFetcher<DLFileEntryType> deleteDLFileEntryTypeDataFetcher();  }### Answer:
@Test public void deleteDLFileEntryTypeDataFetcher_should_return_deleted_object() throws Exception { Map<String, Object> arguments = new HashMap<>(); arguments.put("fileEntryTypeId", FILE_ENTRY_TYPE_ID); DataFetchingEnvironment environment = getTestEnvironment(arguments); DLFileEntryType expectedResult = mock(DLFileEntryType.class); expectedResult.setFileEntryTypeId(FILE_ENTRY_TYPE_ID); useMockGraphQLUtil(environment, USER_ID, true); when(localService.deleteDLFileEntryType(eq(FILE_ENTRY_TYPE_ID))) .thenReturn(expectedResult); DLFileEntryType result = resolvers.deleteDLFileEntryTypeDataFetcher() .get(environment); assertNotNull(result); assertEquals(expectedResult, result); }
@Test(expected = NoSuchFileEntryTypeException.class) public void deleteDLFileEntryTypeDataFetcher_without_args_should_return_null_with_exception() throws Exception { DataFetchingEnvironment environment = getTestEnvironment(null); DLFileEntryType expectedResult = mock(DLFileEntryType.class); expectedResult.setFileEntryTypeId(FILE_ENTRY_TYPE_ID); useMockGraphQLUtil(environment, USER_ID, true); when(localService.deleteDLFileEntryType(eq(FILE_ENTRY_TYPE_ID))) .thenThrow(NoSuchFileEntryTypeException.class); DLFileEntryType result = resolvers.deleteDLFileEntryTypeDataFetcher() .get(environment); assertNull(result); }
@Test(expected = NoSuchFileEntryTypeException.class) public void deleteDLFileEntryTypeDataFetcher_with_invalid_id_should_return_null_with_exception() throws Exception { Map<String, Object> arguments = new HashMap<>(); arguments.put("fileEntryTypeId", 789456L); DataFetchingEnvironment environment = getTestEnvironment(arguments); DLFileEntryType expectedResult = mock(DLFileEntryType.class); expectedResult.setFileEntryTypeId(FILE_ENTRY_TYPE_ID); useMockGraphQLUtil(environment, USER_ID, false); when(graphQLUtil.getLongArg(eq(environment), eq("fileEntryTypeId"))) .thenReturn(789456L); when(localService.deleteDLFileEntryType(eq(789456L))) .thenThrow(NoSuchFileEntryTypeException.class); DLFileEntryType result = resolvers.deleteDLFileEntryTypeDataFetcher() .get(environment); assertNull(result); }