Class StubsParser
java.lang.Object
org.springframework.cloud.contract.stubrunner.util.StubsParser
Utility to parse string into a list of configuration of stubs.
- Author:
- Marcin Grzejszczak
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<StubConfiguration>
fromString
(Collection<String> collection, String defaultClassifier) The string is expected to be a map with entry called "stubs" that contains a list of Strings in the format groupid:artifactid:version:classifier:port groupid:artifactid:version:classifier groupid:artifactid:version groupid:artifactid In the latter case the provided default stub classifier will be passed.static Map<StubConfiguration,
Integer> fromStringWithPort
(String notation) static boolean
static String
ivyFromStringWithPort
(String notation)
-
Method Details
-
fromString
public static List<StubConfiguration> fromString(Collection<String> collection, String defaultClassifier) The string is expected to be a map with entry called "stubs" that contains a list of Strings in the format- groupid:artifactid:version:classifier:port
- groupid:artifactid:version:classifier
- groupid:artifactid:version
- groupid:artifactid
- Parameters:
collection
- collection of idsdefaultClassifier
- default classifier to append if one is missing- Returns:
- parsed stub configurations
-
fromStringWithPort
- Parameters:
notation
- ivy notation of stubs with ports- Returns:
- mapping of parsed stub configurations to ports on which the stub is running
-
ivyFromStringWithPort
- Parameters:
notation
- ivy notation of stubs with ports- Returns:
- colon seprated dependency notation with port or empty string if no port is present
-
hasPort
- Parameters:
id
- string notation of a stub- Returns:
true
if a port is there in the identifier
-