Skip to content

Commit

Permalink
Update major/minor version properties in MockServletContext
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbrannen committed Apr 28, 2023
1 parent cefb734 commit aabd685
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ void getMimeTypeWithCustomConfiguredType() {

@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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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<>();

Expand Down

0 comments on commit aabd685

Please sign in to comment.