forked from eclipse-jkube/jkube
-
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.
fix(openshift): build fails with imageStream for buildRecreate value
No need to convert value to lowercase when parsing string value to enum Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
c2c9a0c
commit 2fd7dbc
Showing
3 changed files
with
44 additions
and
1 deletion.
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
42 changes: 42 additions & 0 deletions
42
jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/BuildRecreateModeTest.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,42 @@ | ||
/* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.jkube.kit.common; | ||
|
||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
import static org.junit.jupiter.params.provider.Arguments.arguments; | ||
|
||
class BuildRecreateModeTest { | ||
static Stream<Arguments> fromParameterSource() { | ||
return Stream.of( | ||
arguments("buildConfig", BuildRecreateMode.buildConfig), | ||
arguments("bc", BuildRecreateMode.bc), | ||
arguments("imageStream", BuildRecreateMode.imageStream), | ||
arguments("is", BuildRecreateMode.is), | ||
arguments("all", BuildRecreateMode.all), | ||
arguments("none", BuildRecreateMode.none) | ||
); | ||
} | ||
|
||
@ParameterizedTest(name = "fromParameter({0}) should return {1}") | ||
@MethodSource("fromParameterSource") | ||
void fromParameter_shouldParseEnumCorrectly(String param, BuildRecreateMode expectedValue) { | ||
assertThat(BuildRecreateMode.fromParameter(param)).isEqualTo(expectedValue); | ||
} | ||
} |