Skip to content

Commit

Permalink
Merge pull request #7921 from glennsarti/depreacte-neo4jwrapper-conf
Browse files Browse the repository at this point in the history
Add deprecation warning for neo4j-wrapper in Powershell management scripts
  • Loading branch information
benbc committed Sep 13, 2016
2 parents c17f14c + 8ecd8da commit 1148c06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ Function Get-Neo4jServer
if ( (Get-Neo4jEnv 'NEO4J_CONF') -eq $null) { Set-Neo4jEnv "NEO4J_CONF" $ConfDir }
if ( (Get-Neo4jEnv 'NEO4J_HOME') -eq $null) { Set-Neo4jEnv "NEO4J_HOME" $Neo4jHome }

# Any deprecation warnings
$WrapperPath = Join-Path -Path $ConfDir -ChildPath 'neo4j-wrapper.conf'
If (Test-Path -Path $WrapperPath) { Write-Warning "$WrapperPath is deprecated and support for it will be removed in a future version of Neo4j; please move all your settings to neo4j.conf" }

Write-Output $serverObject
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,17 @@ InModuleScope Neo4j-Management {
Assert-MockCalled Set-Neo4jEnv -Times 0 -ParameterFilter { $Name -eq 'NEO4J_HOME' }
}
}

Context "Deprecation warning if a neo4j-wrapper.conf file is found" {
global:New-MockNeo4jInstall -RootDir 'TestDrive:\neo4j'
Mock Write-Warning

'# Mock File' | Out-File 'TestDrive:\neo4j\conf\neo4j-wrapper.conf'

It "Should raise a warning if conf\neo4j-wrapper.conf exists" {
$neoServer = Get-Neo4jServer -Neo4jHome 'TestDrive:\neo4j\' -ErrorAction Stop
Assert-MockCalled Write-Warning -Times 1
}
}
}
}

0 comments on commit 1148c06

Please sign in to comment.