-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Loading branch information
1 parent
ec268a9
commit df8ec04
Showing
8 changed files
with
69 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ | |
package io.seqera.wave.core | ||
|
||
import spock.lang.Specification | ||
import spock.lang.Unroll | ||
|
||
import io.seqera.wave.model.ContainerCoordinates | ||
import io.seqera.wave.service.ContainerRequestData | ||
import io.seqera.wave.tower.PlatformId | ||
import io.seqera.wave.tower.User | ||
|
||
/** | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
|
@@ -72,6 +72,7 @@ class RoutePathTest extends Specification { | |
|
||
} | ||
|
||
@Unroll | ||
def 'should get manifest path'() { | ||
expect: | ||
RoutePath.v2manifestPath(ContainerCoordinates.parse(CONTAINER)).path == PATH | ||
|
@@ -82,6 +83,20 @@ class RoutePathTest extends Specification { | |
'quay.io/foo/bar:v1.0' | '/v2/foo/bar/manifests/v1.0' | ||
} | ||
|
||
def 'should get manifest path with identity'() { | ||
given: | ||
def CONTAINER = ContainerCoordinates.parse('quay.io/foo/bar:v1.0') | ||
def PATH = '/v2/foo/bar/manifests/v1.0' | ||
def IDENTITY = new PlatformId(new User(id: 1, email: '[email protected]'), 2, 'xyz') | ||
|
||
expect: | ||
RoutePath.v2manifestPath(CONTAINER).path == PATH | ||
RoutePath.v2manifestPath(CONTAINER).identity == PlatformId.NULL | ||
and: | ||
RoutePath.v2manifestPath(CONTAINER, IDENTITY).path == PATH | ||
RoutePath.v2manifestPath(CONTAINER, IDENTITY).identity == IDENTITY | ||
} | ||
|
||
def 'should parse location' () { | ||
expect: | ||
RoutePath.parse(GIVEN) == RoutePath.v2path(TYPE, REG, IMAGE, REF) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters