File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
client/rest-high-level/src/main/java/org/elasticsearch/client Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2184,8 +2184,12 @@ private Optional<String> getVersionValidation(Response response) throws IOExcept
21842184 return Optional .empty ();
21852185 }
21862186
2187- if ("default" .equals (Build .CURRENT .flavor ()) && "default" .equals (mainResponse .getVersion ().getBuildFlavor ()) == false ) {
2188- return Optional .of ("Invalid or missing build flavor [" + mainResponse .getVersion ().getBuildFlavor () + "]" );
2187+ String responseFlavor = mainResponse .getVersion ().getBuildFlavor ();
2188+ if ("default" .equals (responseFlavor ) == false ) {
2189+ // Flavor is unknown when running tests, and non-mocked responses will return an unknown flavor
2190+ if (Build .CURRENT .flavor () != Build .Flavor .UNKNOWN || "unknown" .equals (responseFlavor ) == false ) {
2191+ return Optional .of ("Invalid or missing build flavor [" + responseFlavor + "]" );
2192+ }
21892193 }
21902194
21912195 if ("You Know, for Search" .equalsIgnoreCase (mainResponse .getTagline ()) == false ) {
You can’t perform that action at this time.
0 commit comments