Class DockerLoginMock
java.lang.Object
net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
net.ssehub.easy.producer.scenario_tests.mocks.DockerLoginMock
- All Implemented Interfaces:
net.ssehub.easy.instantiation.core.model.vilTypes.IVilType
public class DockerLoginMock
extends net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
Mocks the instantiator to log into a docker registry.
- Author:
- Monika Staciwa
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandockerLogin(String registry, String user, String password) Logs into the given docker registry.static booleansetResult(boolean res) Changes the mocked result for the following calls.Methods inherited from class net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
determineTargetPath, toString
-
Field Details
-
result
private static boolean result
-
-
Constructor Details
-
DockerLoginMock
public DockerLoginMock()
-
-
Method Details
-
dockerLogin
public static boolean dockerLogin(String registry, String user, String password) throws net.ssehub.easy.instantiation.core.model.common.VilException Logs into the given docker registry. Stores the authentication configuration if successful and applies it automatically.- Parameters:
registry- the registry addressuser- the user namepassword- the password- Returns:
trueif successful- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-
setResult
public static boolean setResult(boolean res) Changes the mocked result for the following calls.- Parameters:
res- the result values- Returns:
- the original value before calling this method
-