### Question:
DataEngineCommonHandler { protected void updateEntity(String userId, String entityGUID, InstanceProperties instanceProperties, String entityTypeName) throws UserNotAuthorizedException, PropertyServerException { final String methodName = "updateEntity"; TypeDef entityTypeDef = repositoryHelper.getTypeDefByName(userId, entityTypeName); repositoryHandler.updateEntity(userId, entityGUID, entityTypeDef.getGUID(), entityTypeDef.getName(), instanceProperties, methodName); } DataEngineCommonHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler,
                                   RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper,
                                   DataEngineRegistrationHandler dataEngineRegistrationHandler);   }### Answer:
@Test void updateEntity() throws UserNotAuthorizedException, PropertyServerException { dataEngineCommonHandler.updateEntity(USER, GUID, instanceProperties, ENTITY_TYPE_NAME); verify(repositoryHandler, times(1)).updateEntity(USER, GUID, ENTITY_TYPE_GUID, ENTITY_TYPE_NAME, instanceProperties, "updateEntity"); }
@Test void updateEntity_throwsUserNotAuthorizedException() throws UserNotAuthorizedException, PropertyServerException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { String methodName = "updateEntity"; UserNotAuthorizedException mockedException = mockException(UserNotAuthorizedException.class, methodName); doThrow(mockedException).when(repositoryHandler).updateEntity(USER, GUID, ENTITY_TYPE_GUID, ENTITY_TYPE_NAME, instanceProperties, "updateEntity"); UserNotAuthorizedException thrown = assertThrows(UserNotAuthorizedException.class, () -> dataEngineCommonHandler.updateEntity(USER, GUID, instanceProperties, ENTITY_TYPE_NAME)); assertTrue(thrown.getMessage().contains("OMAS-DATA-ENGINE-404-001 ")); }