@@ -0,0 +1,2995 @@
+/**%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 io.fabric8.kubernetes.api.model.Secret;%0Aimport io.fabric8.kubernetes.api.model.SecretBuilder;%0Aimport io.fabric8.kubernetes.api.model.SecretList;%0Aimport io.fabric8.kubernetes.client.KubernetesClient;%0Aimport io.fabric8.kubernetes.client.server.mock.KubernetesServer;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport java.util.Collections;%0A%0Aimport static junit.framework.TestCase.assertNotNull;%0Aimport static junit.framework.TestCase.assertTrue;%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class SecretCrudTest %7B%0A  @Rule%0A  public KubernetesServer server = new KubernetesServer(true, true);%0A%0A  @Test%0A  public void testCrud() %7B%0A    KubernetesClient client = server.getClient();%0A%0A    Secret secret1 = new SecretBuilder()%0A      .withNewMetadata().withName(%22secret1%22).addToLabels(%22foo%22, %22bar%22).endMetadata()%0A      .addToData(%22username%22, %22guccifer%22)%0A      .addToData(%22password%22, %22shadowgovernment%22)%0A      .addToData(%22secret1%22, %22SECRET1%22)%0A      .build();%0A%0A    Secret secret2 = new SecretBuilder()%0A      .withNewMetadata().withName(%22secret2%22).addToLabels(%22foo%22, %22bar%22).endMetadata()%0A      .addToData(%22one%22, %221%22)%0A      .build();%0A%0A    client.secrets().inNamespace(%22ns1%22).create(secret1);%0A    client.secrets().inNamespace(%22ns2%22).create(secret2);%0A%0A    SecretList aSecretList = client.secrets().list();%0A    assertNotNull(aSecretList);%0A    assertEquals(0, aSecretList.getItems().size());%0A%0A    aSecretList = client.secrets().inAnyNamespace().list();%0A    assertNotNull(aSecretList);%0A    assertEquals(2, aSecretList.getItems().size());%0A%0A    aSecretList = client.secrets().inNamespace(%22ns1%22).list();%0A    assertNotNull(aSecretList);%0A    assertEquals(1, aSecretList.getItems().size());%0A%0A    aSecretList = client.secrets().inAnyNamespace().withLabels(Collections.singletonMap(%22foo%22, %22bar%22)).list();%0A    assertNotNull(aSecretList);%0A    assertEquals(2, aSecretList.getItems().size());%0A%0A    boolean bDeleted = client.secrets().inNamespace(%22ns1%22).withName(%22secret1%22).delete();%0A    aSecretList = client.secrets().inNamespace(%22ns1%22).list();%0A    assertTrue(bDeleted);%0A    assertNotNull(aSecretList);%0A    assertEquals(0, aSecretList.getItems().size());%0A%0A//    secret2 = client.secrets().inNamespace(%22ns2%22).withName(%22secret2%22).edit().removeFromData(%22one%22).done();%0A//    assertNotNull(secret2);%0A//    assertEquals(null, secret2.getData().get(%22one%22));%0A  %7D%0A%7D%0A

Fix #923 Added SecretCrudTest