@@ -0,0 +1,3154 @@
+/**%0A * Copyright (C) 2015 Red Hat, Inc.%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 */%0A%0Apackage io.fabric8.kubernetes.client.mock;%0A%0Aimport com.squareup.okhttp.Response;%0Aimport io.fabric8.kubernetes.api.model.Pod;%0Aimport io.fabric8.kubernetes.api.model.PodBuilder;%0Aimport io.fabric8.kubernetes.api.model.PodList;%0Aimport io.fabric8.kubernetes.api.model.PodListBuilder;%0Aimport io.fabric8.kubernetes.api.model.SecurityContextConstraints;%0Aimport io.fabric8.kubernetes.api.model.SecurityContextConstraintsBuilder;%0Aimport io.fabric8.kubernetes.api.model.SecurityContextConstraintsList;%0Aimport io.fabric8.kubernetes.api.model.SecurityContextConstraintsListBuilder;%0Aimport io.fabric8.kubernetes.api.model.WatchEvent;%0Aimport io.fabric8.kubernetes.client.KubernetesClient;%0Aimport io.fabric8.kubernetes.client.KubernetesClientException;%0Aimport io.fabric8.kubernetes.client.Watch;%0Aimport io.fabric8.kubernetes.client.Watcher;%0Aimport io.fabric8.kubernetes.client.dsl.ExecListener;%0Aimport io.fabric8.kubernetes.client.dsl.ExecWatch;%0Aimport io.fabric8.kubernetes.server.mock.OutputStreamMessage;%0Aimport org.junit.Test;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0Aimport java.util.concurrent.CountDownLatch;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class SecurityContextConstraintsTest extends KubernetesMockServerTestBase %7B%0A%0A  @Test%0A  public void testList() %7B%0A    expect().withPath(%22/api/v1/securitycontextconstraints%22).andReturn(200, new SecurityContextConstraintsListBuilder()%0A            .addNewItem().endItem()%0A            .build()).once();%0A%0A%0A    KubernetesClient client = getClient();%0A    SecurityContextConstraintsList sccList = client.securityContextConstraints().list();%0A    assertNotNull(sccList);%0A    assertEquals(1, sccList.getItems().size());%0A  %7D%0A%0A%0A  @Test%0A  public void testDelete() %7B%0A    expect().withPath(%22/api/v1/securitycontextconstraints/scc1%22).andReturn(200, new SecurityContextConstraintsBuilder().build()).once();%0A    expect().withPath(%22/api/v1/securitycontextconstraints/scc2%22).andReturn(200, new SecurityContextConstraintsBuilder().build()).once();%0A%0A    KubernetesClient client = getClient();%0A%0A    Boolean deleted = client.securityContextConstraints().withName(%22scc1%22).delete();%0A    assertNotNull(deleted);%0A%0A    deleted = client.securityContextConstraints().withName(%22scc1%22).delete();%0A    assertFalse(deleted);%0A%0A    deleted = client.securityContextConstraints().withName(%22scc2%22).delete();%0A    assertTrue(deleted);%0A  %7D%0A%0A%7D%0A

Add SecurityContextConstraintsTest.