use of org.jfrog.build.api.dependency.BuildDependency in project build-info by JFrogDev.
the class BuildDependencyBuilderTest method testBuilderSetters.
/**
* Validates the build dependency values after using the builder setters
*/
public void testBuilderSetters() {
String name = "foo";
String number = "123";
String url = "http://myhostA.com/artifactory/builds/foo/123/";
BuildDependency buildDependency = new BuildDependencyBuilder().name(name).number(number).started(timestamp).url(url).build();
assertEquals(buildDependency.getName(), name, "Unexpected name.");
assertEquals(buildDependency.getNumber(), number, "Unexpected number.");
assertEquals(buildDependency.getStarted(), timestamp, "Unexpected started.");
assertEquals(buildDependency.getUrl(), url, "Unexpected url.");
}
use of org.jfrog.build.api.dependency.BuildDependency in project build-info by JFrogDev.
the class BuildTest method testAddBuildDependencyMethod.
public void testAddBuildDependencyMethod() {
Build build = new Build();
assertNull(build.getBuildDependencies(), "Default buildDependencies list should be null.");
BuildDependency buildDependency = new BuildDependencyBuilder().name("foo").number("123").startedDate(new Date()).build();
build.addBuildDependency(buildDependency);
assertFalse(build.getBuildDependencies().isEmpty(), "BuildDependency object should have been added.");
assertEquals(getOnlyElement(build.getBuildDependencies()), buildDependency, "Unexpected build dependency object.");
BuildDependency otherBuildDependency = new BuildDependencyBuilder().name("bar").number("456").startedDate(new Date()).build();
build.addBuildDependency(otherBuildDependency);
assertEquals(build.getBuildDependencies().size(), 2, "Second BuildDependency object should have been added.");
assertEquals(getLast(build.getBuildDependencies()), otherBuildDependency, "Unexpected build dependency object.");
}
Aggregations