diff --git a/tests/maven.Tests.ps1 b/tests/maven.Tests.ps1 index 1d7b48b9..e49f96cc 100644 --- a/tests/maven.Tests.ps1 +++ b/tests/maven.Tests.ps1 @@ -47,6 +47,12 @@ Describe "$SUT_TAG create test container" { $exitCode | Should -Be 0 $stdout | Should -Match "Apache Maven $version" } + It 'runs as non admin user' { + $version = $(Get-Content -Path "$PSScriptRoot/../$SUT_TAG/Dockerfile" | Select-String -Pattern 'ARG MAVEN_VERSION.*' | ForEach-Object { $_ -replace 'ARG MAVEN_VERSION=','' }) + $exitCode, $stdout, $stderr = Run-Program -Cmd "docker.exe" -Params "run --rm ${SUT_IMAGE}:${SUT_TAG} echo `$env:USERNAME" + $exitCode | Should -Be 0 + $stdout | Should -Match "ContainerUser" + } } Describe "$SUT_TAG settings.xml is setup" {