use of org.jboss.pnc.client.BuildConfigurationClient in project pnc by project-ncl.
the class BuildConfigurationEndpointTest method testGetBuildTypeDefaultAlignmentParameters.
@Test
public void testGetBuildTypeDefaultAlignmentParameters() throws RemoteResourceException {
BuildConfigurationClient client = new BuildConfigurationClient(RestClientConfiguration.asAnonymous());
for (BuildType buildType : BuildType.values()) {
AlignmentParameters params = client.getBuildTypeDefaultAlignmentParameters(buildType.name());
// NPM and SBT default alignment params are empty
if (!BuildType.NPM.equals(buildType) && !BuildType.SBT.equals(buildType)) {
assertThat(params.getParameters()).isNotEmpty();
assertThat(params.getBuildType()).isNotEmpty();
}
}
}
use of org.jboss.pnc.client.BuildConfigurationClient in project pnc by project-ncl.
the class BuildConfigurationEndpointTest method testGetDependencies.
@Test
@InSequence(30)
public void testGetDependencies() throws ClientException {
BuildConfigurationClient client = new BuildConfigurationClient(RestClientConfiguration.asAnonymous());
RemoteCollection<BuildConfiguration> all = client.getDependencies(configuration3Id);
assertThat(all).hasSize(2);
}
use of org.jboss.pnc.client.BuildConfigurationClient in project pnc by project-ncl.
the class BuildConfigurationEndpointTest method createBuildConfigurationWithDependencyAndValidateResults.
private BuildConfiguration createBuildConfigurationWithDependencyAndValidateResults(String projectId, String environmentId, String repositoryConfigurationId, String name, String genericParameterValue1, Map<String, BuildConfigurationRef> dependencies) throws ClientException {
BuildConfiguration buildConfiguration = BuildConfiguration.builder().project(ProjectRef.refBuilder().id(projectId).build()).environment(Environment.builder().id(environmentId).build()).scmRepository(SCMRepository.builder().id(repositoryConfigurationId).build()).name(name).parameters(Collections.singletonMap(PARAMETER_KEY, genericParameterValue1)).buildType(BuildType.MVN).dependencies(dependencies).build();
BuildConfigurationClient client = new BuildConfigurationClient(RestClientConfiguration.asUser());
BuildConfiguration newBC = client.createNew(buildConfiguration);
return newBC;
}
use of org.jboss.pnc.client.BuildConfigurationClient in project pnc by project-ncl.
the class BuildConfigurationEndpointTest method testGetBuilds.
@Test
public void testGetBuilds() throws ClientException {
BuildConfigurationClient client = new BuildConfigurationClient(RestClientConfiguration.asAnonymous());
RemoteCollection<Build> all = client.getBuilds(configurationId, null);
assertThat(all).hasSize(2).allMatch(b -> configurationId.equals(b.getBuildConfigRevision().getId()));
}
use of org.jboss.pnc.client.BuildConfigurationClient in project pnc by project-ncl.
the class BuildConfigurationEndpointTest method testGetGroupConfig.
@Test
public void testGetGroupConfig() throws ClientException {
BuildConfigurationClient client = new BuildConfigurationClient(RestClientConfiguration.asAnonymous());
RemoteCollection<GroupConfiguration> all = client.getGroupConfigs(configurationId);
assertThat(all).hasSize(1).allMatch(gc -> gc.getBuildConfigs().containsKey(configurationId));
}
Aggregations