@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 ")); }
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 { 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 { 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); }
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);  }
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);   }