@@ -0,0 +1,3052 @@
+/**%0A * JBoss, Home of Professional Open Source.%0A * Copyright 2014-2019 Red Hat, Inc., and individual contributors%0A * as indicated by the @author tags.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jboss.pnc.integration_new.endpoint;%0A%0Aimport org.jboss.arquillian.container.test.api.Deployment;%0Aimport org.jboss.arquillian.container.test.api.RunAsClient;%0Aimport org.jboss.arquillian.junit.Arquillian;%0A%0Aimport org.jboss.pnc.client.ClientException;%0Aimport org.jboss.pnc.client.RemoteCollection;%0Aimport org.jboss.pnc.client.RemoteResourceException;%0Aimport org.jboss.pnc.integration_new.setup.Deployments;%0Aimport org.jboss.pnc.integration_new.setup.RestClientConfiguration;%0Aimport org.jboss.pnc.test.category.ContainerTest;%0A%0Aimport org.jboss.shrinkwrap.api.spec.EnterpriseArchive;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport org.junit.runner.RunWith;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Aimport org.jboss.pnc.client.EnvironmentClient;%0Aimport org.jboss.pnc.dto.Environment;%0Aimport org.junit.BeforeClass;%0A%0A/**%0A * @author %3Ca href=%22mailto:jbrazdil@redhat.com%22%3EHonza Brazdil%3C/a%3E%0A * @see org.jboss.pnc.demo.data.DatabaseDataInitializer%0A */%0A@RunAsClient%0A@RunWith(Arquillian.class)%0A@Category(ContainerTest.class)%0Apublic class EnvironmentEndpointTest %7B%0A%0A    private static final Logger logger = LoggerFactory.getLogger(EnvironmentEndpointTest.class);%0A    private static String environmentId;%0A%0A%0A    @Deployment%0A    public static EnterpriseArchive deploy() %7B%0A        return Deployments.testEar();%0A    %7D%0A%0A    @BeforeClass%0A    public static void prepareData() throws Exception %7B%0A        EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());%0A        environmentId = client.getAll().iterator().next().getId();%0A    %7D%0A%0A    @Test%0A    public void testGetAllEnvironments() throws RemoteResourceException %7B%0A        EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());%0A%0A        RemoteCollection%3CEnvironment%3E all = client.getAll();%0A%0A        assertThat(all).hasSize(2); // from DatabaseDataInitializer%0A    %7D%0A%0A    @Test%0A    public void testGetSpecificArtifact() throws ClientException %7B%0A        EnvironmentClient client = new EnvironmentClient(RestClientConfiguration.asAnonymous());%0A%0A        Environment environment = client.getSpecific(environmentId);%0A%0A        assertThat(environment.getName()).isEqualTo(%22Demo Environment 1%22); // from DatabaseDataInitializer%0A    %7D%0A%0A%7D%0A

Implement Environment Endpoint Test