Update major/minor version properties in MockServletContext
ServletContext has sets of major/minor version properties that we have not updated in MockServletContext in several years. Since we upgraded the baseline to Servlet 6.0 in Spring Framework 6.0, now seems like a good time to update those version properties. Closes gh-30395
This commit is contained in:
parent
cefb734763
commit
aabd685225
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -111,13 +111,13 @@ public class MockServletContext implements ServletContext {
|
|||
|
||||
private final Map<String, ServletContext> contexts = new HashMap<>();
|
||||
|
||||
private int majorVersion = 3;
|
||||
private int majorVersion = 6;
|
||||
|
||||
private int minorVersion = 1;
|
||||
private int minorVersion = 0;
|
||||
|
||||
private int effectiveMajorVersion = 3;
|
||||
private int effectiveMajorVersion = 6;
|
||||
|
||||
private int effectiveMinorVersion = 1;
|
||||
private int effectiveMinorVersion = 0;
|
||||
|
||||
private final Map<String, RequestDispatcher> namedRequestDispatchers = new HashMap<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -105,10 +105,10 @@ class MockServletContextTests {
|
|||
|
||||
@Test
|
||||
void servletVersion() {
|
||||
assertThat(servletContext.getMajorVersion()).isEqualTo(3);
|
||||
assertThat(servletContext.getMinorVersion()).isEqualTo(1);
|
||||
assertThat(servletContext.getEffectiveMajorVersion()).isEqualTo(3);
|
||||
assertThat(servletContext.getEffectiveMinorVersion()).isEqualTo(1);
|
||||
assertThat(servletContext.getMajorVersion()).isEqualTo(6);
|
||||
assertThat(servletContext.getMinorVersion()).isEqualTo(0);
|
||||
assertThat(servletContext.getEffectiveMajorVersion()).isEqualTo(6);
|
||||
assertThat(servletContext.getEffectiveMinorVersion()).isEqualTo(0);
|
||||
|
||||
servletContext.setMajorVersion(4);
|
||||
servletContext.setMinorVersion(0);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -111,13 +111,13 @@ public class MockServletContext implements ServletContext {
|
|||
|
||||
private final Map<String, ServletContext> contexts = new HashMap<>();
|
||||
|
||||
private int majorVersion = 3;
|
||||
private int majorVersion = 6;
|
||||
|
||||
private int minorVersion = 1;
|
||||
private int minorVersion = 0;
|
||||
|
||||
private int effectiveMajorVersion = 3;
|
||||
private int effectiveMajorVersion = 6;
|
||||
|
||||
private int effectiveMinorVersion = 1;
|
||||
private int effectiveMinorVersion = 0;
|
||||
|
||||
private final Map<String, RequestDispatcher> namedRequestDispatchers = new HashMap<>();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue