forked from fabric8io/kubernetes-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get Request with OpenShift Mock Server Not Working
Adds the case of openshift url also when doing the path URL match to work fine with openshift resouce in openshift mock server crud Mode Fix fabric8io#1144
- Loading branch information
1 parent
29bd0f1
commit ca7f1b7
Showing
5 changed files
with
71 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...etes-tests/src/test/java/io/fabric8/openshift/client/server/mock/BuildConfigCrudTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.fabric8.openshift.client.server.mock; | ||
|
||
import io.fabric8.openshift.api.model.BuildConfig; | ||
import io.fabric8.openshift.api.model.BuildConfigBuilder; | ||
import io.fabric8.openshift.api.model.BuildConfigList; | ||
import io.fabric8.openshift.client.OpenShiftClient; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import java.util.Collections; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class BuildConfigCrudTest { | ||
|
||
@Rule | ||
public OpenShiftServer server = new OpenShiftServer(true, true); | ||
|
||
@Test | ||
public void testCrud() { | ||
OpenShiftClient client = server.getOpenshiftClient(); | ||
|
||
BuildConfig buildConfig = new BuildConfigBuilder() | ||
.withNewMetadata() | ||
.withName("bc2") | ||
.withLabels(Collections.singletonMap("key","value")) | ||
.endMetadata() | ||
.build(); | ||
|
||
client.buildConfigs().create(buildConfig); | ||
|
||
BuildConfig buildConfig1 = client.buildConfigs().withName("bc2").get(); | ||
assertEquals("value", buildConfig1.getMetadata().getLabels().get("key")); | ||
|
||
BuildConfigList buildConfigList = client.buildConfigs().list(); | ||
assertEquals(1, buildConfigList.getItems().size()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters