mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
merge 2.0.0-m3
This commit is contained in:
@@ -108,7 +108,7 @@ data:
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<--
|
<!--
|
||||||
in a container environment we only need stdout
|
in a container environment we only need stdout
|
||||||
-->
|
-->
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
|||||||
@@ -29,6 +29,17 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
{{- if .Values.plugins }}
|
||||||
|
- name: install-plugins
|
||||||
|
image: alpine:3.8
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command: ['sh', '/scripts/install-plugins.sh']
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
- name: scripts
|
||||||
|
mountPath: /scripts
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Chart.Name }}
|
- name: {{ .Chart.Name }}
|
||||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
@@ -63,6 +74,11 @@ spec:
|
|||||||
- name: config
|
- name: config
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ include "scm-manager.fullname" . }}
|
name: {{ include "scm-manager.fullname" . }}
|
||||||
|
{{- if .Values.plugins }}
|
||||||
|
- name: scripts
|
||||||
|
configMap:
|
||||||
|
name: {{ include "scm-manager.fullname" . }}-scripts
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ toYaml . | indent 8 }}
|
{{ toYaml . | indent 8 }}
|
||||||
|
|||||||
21
deployments/helm/templates/scripts.yaml
Normal file
21
deployments/helm/templates/scripts.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{{- if .Values.plugins }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "scm-manager.fullname" . }}-scripts
|
||||||
|
labels:
|
||||||
|
app: {{ include "scm-manager.name" . }}
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||||
|
release: "{{ .Release.Name }}"
|
||||||
|
heritage: "{{ .Release.Service }}"
|
||||||
|
data:
|
||||||
|
install-plugins.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
chown 1000:1000 /data/plugins
|
||||||
|
{{ range $i, $plugin := .Values.plugins }}
|
||||||
|
# install plugin {{ $plugin.name }}
|
||||||
|
wget -O /data/plugins/{{ $plugin.name }}.smp {{ $plugin.url }}
|
||||||
|
chown 1000:1000 /data/plugins/{{ $plugin.name }}.smp
|
||||||
|
{{ end }}
|
||||||
|
{{- end }}
|
||||||
@@ -10,6 +10,10 @@ image:
|
|||||||
tag: latest
|
tag: latest
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
|
# plugins:
|
||||||
|
# - name: scm-review-plugin
|
||||||
|
# url: https://oss.cloudogu.com/jenkins/job/scm-manager/job/scm-manager-bitbucket/job/scm-review-plugin/job/develop/lastSuccessfulBuild/artifact/target/scm-review-plugin-2.0.0-SNAPSHOT.smp
|
||||||
|
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
|
|
||||||
|
|||||||
@@ -688,10 +688,6 @@
|
|||||||
react "^16.4.2"
|
react "^16.4.2"
|
||||||
react-dom "^16.4.2"
|
react-dom "^16.4.2"
|
||||||
|
|
||||||
"@scm-manager/ui-types@2.0.0-SNAPSHOT":
|
|
||||||
version "2.0.0-20181010-130547"
|
|
||||||
resolved "https://registry.yarnpkg.com/@scm-manager/ui-types/-/ui-types-2.0.0-20181010-130547.tgz#9987b519e43d5c4b895327d012d3fd72429a7953"
|
|
||||||
|
|
||||||
"@types/node@*":
|
"@types/node@*":
|
||||||
version "10.12.0"
|
version "10.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/polyfill": "^7.0.0",
|
||||||
"@fortawesome/fontawesome-free": "^5.3.1",
|
"@fortawesome/fontawesome-free": "^5.3.1",
|
||||||
"@scm-manager/ui-extensions": "^0.1.1",
|
"@scm-manager/ui-extensions": "^0.1.1",
|
||||||
"bulma": "^0.7.1",
|
"bulma": "^0.7.1",
|
||||||
@@ -31,17 +32,19 @@
|
|||||||
"redux": "^4.0.0",
|
"redux": "^4.0.0",
|
||||||
"redux-devtools-extension": "^2.13.5",
|
"redux-devtools-extension": "^2.13.5",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-thunk": "^2.3.0"
|
"redux-thunk": "^2.3.0",
|
||||||
|
"whatwg-fetch": "^3.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"polyfills": "concat node_modules/@babel/polyfill/dist/polyfill.min.js node_modules/whatwg-fetch/dist/fetch.umd.js -o target/scm-ui/polyfills.bundle.js",
|
||||||
"webfonts": "copyfiles -f node_modules/@fortawesome/fontawesome-free/webfonts/* target/scm-ui/styles/webfonts",
|
"webfonts": "copyfiles -f node_modules/@fortawesome/fontawesome-free/webfonts/* target/scm-ui/styles/webfonts",
|
||||||
"build-css": "node-sass-chokidar --include-path ./styles --include-path ./node_modules styles/ -o target/scm-ui/styles",
|
"build-css": "node-sass-chokidar --include-path ./styles --include-path ./node_modules styles/ -o target/scm-ui/styles",
|
||||||
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./styles --include-path ./node_modules styles/ -o target/scm-ui/styles --watch --recursive",
|
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./styles --include-path ./node_modules styles/ -o target/scm-ui/styles --watch --recursive",
|
||||||
"start-js": "ui-bundler serve --target target/scm-ui --vendor vendor.bundle.js",
|
"start-js": "ui-bundler serve --target target/scm-ui --vendor vendor.bundle.js",
|
||||||
"start": "npm-run-all -p webfonts watch-css start-js",
|
"start": "npm-run-all -p webfonts watch-css polyfills start-js",
|
||||||
"build-js": "ui-bundler bundle --mode=production target/scm-ui/scm-ui.bundle.js",
|
"build-js": "ui-bundler bundle --mode=production target/scm-ui/scm-ui.bundle.js",
|
||||||
"build-vendor": "ui-bundler vendor --mode=production target/scm-ui/vendor.bundle.js",
|
"build-vendor": "ui-bundler vendor --mode=production target/scm-ui/vendor.bundle.js",
|
||||||
"build": "npm-run-all -s webfonts build-css build-vendor build-js",
|
"build": "npm-run-all -s webfonts build-css polyfills build-vendor build-js",
|
||||||
"test": "ui-bundler test",
|
"test": "ui-bundler test",
|
||||||
"test-ci": "ui-bundler test --ci",
|
"test-ci": "ui-bundler test --ci",
|
||||||
"flow": "flow",
|
"flow": "flow",
|
||||||
@@ -49,6 +52,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@scm-manager/ui-bundler": "^0.0.21",
|
"@scm-manager/ui-bundler": "^0.0.21",
|
||||||
|
"concat": "^1.0.3",
|
||||||
"copyfiles": "^2.0.0",
|
"copyfiles": "^2.0.0",
|
||||||
"enzyme": "^3.3.0",
|
"enzyme": "^3.3.0",
|
||||||
"enzyme-adapter-react-16": "^1.1.1",
|
"enzyme-adapter-react-16": "^1.1.1",
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<script>
|
<script>
|
||||||
window.ctxPath = "{{ contextPath }}";
|
window.ctxPath = "{{ contextPath }}";
|
||||||
</script>
|
</script>
|
||||||
|
<script src="{{ contextPath }}/polyfills.bundle.js"></script>
|
||||||
<script src="{{ contextPath }}/vendor.bundle.js"></script>
|
<script src="{{ contextPath }}/vendor.bundle.js"></script>
|
||||||
<script src="{{ contextPath }}/scm-ui.bundle.js"></script>
|
<script src="{{ contextPath }}/scm-ui.bundle.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { withRouter } from "react-router-dom";
|
import { withRouter } from "react-router-dom";
|
||||||
import type { Repository, Branch } from "@scm-manager/ui-types";
|
import type { Branch, Repository } from "@scm-manager/ui-types";
|
||||||
import FileTree from "../components/FileTree";
|
import FileTree from "../components/FileTree";
|
||||||
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||||
import BranchSelector from "../../containers/BranchSelector";
|
import BranchSelector from "../../containers/BranchSelector";
|
||||||
@@ -109,9 +109,9 @@ class Sources extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderBranchSelector = () => {
|
renderBranchSelector = () => {
|
||||||
const { repository, branches, revision } = this.props;
|
const { branches, revision } = this.props;
|
||||||
|
|
||||||
if (repository._links.branches) {
|
if (branches) {
|
||||||
return (
|
return (
|
||||||
<BranchSelector
|
<BranchSelector
|
||||||
branches={branches}
|
branches={branches}
|
||||||
|
|||||||
@@ -513,6 +513,13 @@
|
|||||||
"@babel/helper-regex" "^7.0.0"
|
"@babel/helper-regex" "^7.0.0"
|
||||||
regexpu-core "^4.1.3"
|
regexpu-core "^4.1.3"
|
||||||
|
|
||||||
|
"@babel/polyfill@^7.0.0":
|
||||||
|
version "7.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff"
|
||||||
|
dependencies:
|
||||||
|
core-js "^2.5.7"
|
||||||
|
regenerator-runtime "^0.11.1"
|
||||||
|
|
||||||
"@babel/preset-env@^7.0.0":
|
"@babel/preset-env@^7.0.0":
|
||||||
version "7.1.0"
|
version "7.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.0.tgz#e67ea5b0441cfeab1d6f41e9b5c79798800e8d11"
|
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.0.tgz#e67ea5b0441cfeab1d6f41e9b5c79798800e8d11"
|
||||||
@@ -2005,6 +2012,12 @@ concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0:
|
|||||||
readable-stream "^2.2.2"
|
readable-stream "^2.2.2"
|
||||||
typedarray "^0.0.6"
|
typedarray "^0.0.6"
|
||||||
|
|
||||||
|
concat@^1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/concat/-/concat-1.0.3.tgz#40f3353089d65467695cb1886b45edd637d8cca8"
|
||||||
|
dependencies:
|
||||||
|
commander "^2.9.0"
|
||||||
|
|
||||||
connect-history-api-fallback@^1:
|
connect-history-api-fallback@^1:
|
||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a"
|
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a"
|
||||||
@@ -2065,7 +2078,7 @@ copyfiles@^2.0.0:
|
|||||||
through2 "^2.0.1"
|
through2 "^2.0.1"
|
||||||
yargs "^11.0.0"
|
yargs "^11.0.0"
|
||||||
|
|
||||||
core-js@^2.4.0, core-js@^2.5.0:
|
core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7:
|
||||||
version "2.5.7"
|
version "2.5.7"
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e"
|
||||||
|
|
||||||
@@ -2928,12 +2941,11 @@ event-emitter@^0.3.5:
|
|||||||
d "1"
|
d "1"
|
||||||
es5-ext "~0.10.14"
|
es5-ext "~0.10.14"
|
||||||
|
|
||||||
event-stream@~3.3.0:
|
event-stream@3.3.5, event-stream@~3.3.0:
|
||||||
version "3.3.6"
|
version "3.3.5"
|
||||||
resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.6.tgz#cac1230890e07e73ec9cacd038f60a5b66173eef"
|
resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.5.tgz#e5dd8989543630d94c6cf4d657120341fa31636b"
|
||||||
dependencies:
|
dependencies:
|
||||||
duplexer "^0.1.1"
|
duplexer "^0.1.1"
|
||||||
flatmap-stream "^0.1.0"
|
|
||||||
from "^0.1.7"
|
from "^0.1.7"
|
||||||
map-stream "0.0.7"
|
map-stream "0.0.7"
|
||||||
pause-stream "^0.0.11"
|
pause-stream "^0.0.11"
|
||||||
@@ -3251,10 +3263,6 @@ flat-cache@^1.2.1:
|
|||||||
graceful-fs "^4.1.2"
|
graceful-fs "^4.1.2"
|
||||||
write "^0.2.1"
|
write "^0.2.1"
|
||||||
|
|
||||||
flatmap-stream@^0.1.0:
|
|
||||||
version "0.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/flatmap-stream/-/flatmap-stream-0.1.1.tgz#d34f39ef3b9aa5a2fc225016bd3adf28ac5ae6ea"
|
|
||||||
|
|
||||||
flow-bin@^0.79.1:
|
flow-bin@^0.79.1:
|
||||||
version "0.79.1"
|
version "0.79.1"
|
||||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.79.1.tgz#01c9f427baa6556753fa878c192d42e1ecb764b6"
|
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.79.1.tgz#01c9f427baa6556753fa878c192d42e1ecb764b6"
|
||||||
@@ -7056,7 +7064,7 @@ regenerator-runtime@^0.10.5:
|
|||||||
version "0.10.5"
|
version "0.10.5"
|
||||||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
|
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
|
||||||
|
|
||||||
regenerator-runtime@^0.11.0:
|
regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1:
|
||||||
version "0.11.1"
|
version "0.11.1"
|
||||||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
|
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
|
||||||
|
|
||||||
@@ -8530,6 +8538,10 @@ whatwg-fetch@^2.0.4:
|
|||||||
version "2.0.4"
|
version "2.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
|
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
|
||||||
|
|
||||||
|
whatwg-fetch@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
|
||||||
|
|
||||||
whatwg-mimetype@^2.1.0:
|
whatwg-mimetype@^2.1.0:
|
||||||
version "2.2.0"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.2.0.tgz#a3d58ef10b76009b042d03e25591ece89b88d171"
|
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.2.0.tgz#a3d58ef10b76009b042d03e25591ece89b88d171"
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package sonia.scm.api.v2;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.ws.rs.container.ContainerRequestContext;
|
||||||
|
import javax.ws.rs.container.ContainerResponseContext;
|
||||||
|
import javax.ws.rs.container.ContainerResponseFilter;
|
||||||
|
import javax.ws.rs.ext.Provider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the Cache-Control: no-cache header to every api call. But only if non caching headers are set to the response.
|
||||||
|
* The Cache-Control header should fix stale resources on ie.
|
||||||
|
*/
|
||||||
|
@Provider
|
||||||
|
public class CacheControlResponseFilter implements ContainerResponseFilter {
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(CacheControlResponseFilter.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) {
|
||||||
|
if (!isCacheable(responseContext)) {
|
||||||
|
LOG.trace("add no-cache header to response");
|
||||||
|
responseContext.getHeaders().add("Cache-Control", "no-cache");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCacheable(ContainerResponseContext responseContext) {
|
||||||
|
return hasLastModifiedDate(responseContext) || hasEntityTag(responseContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasEntityTag(ContainerResponseContext responseContext) {
|
||||||
|
return responseContext.getEntityTag() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean hasLastModifiedDate(ContainerResponseContext responseContext) {
|
||||||
|
return responseContext.getLastModified() != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package sonia.scm.api.v2;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
|
||||||
|
import javax.ws.rs.container.ContainerRequestContext;
|
||||||
|
import javax.ws.rs.container.ContainerResponseContext;
|
||||||
|
import javax.ws.rs.core.EntityTag;
|
||||||
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
public class CacheControlResponseFilterTest {
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private ContainerRequestContext requestContext;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private ContainerResponseContext responseContext;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private MultivaluedMap<String, Object> headers;
|
||||||
|
|
||||||
|
private CacheControlResponseFilter filter = new CacheControlResponseFilter();
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUpMocks() {
|
||||||
|
when(responseContext.getHeaders()).thenReturn(headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void filterShouldAddCacheControlHeader() {
|
||||||
|
filter.filter(requestContext, responseContext);
|
||||||
|
|
||||||
|
verify(headers).add("Cache-Control", "no-cache");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void filterShouldNotSetHeaderIfLastModifiedIsNotNull() {
|
||||||
|
when(responseContext.getLastModified()).thenReturn(new Date());
|
||||||
|
|
||||||
|
filter.filter(requestContext, responseContext);
|
||||||
|
|
||||||
|
verify(headers, never()).add("Cache-Control", "no-cache");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void filterShouldNotSetHeaderIfEtagIsNotNull() {
|
||||||
|
when(responseContext.getEntityTag()).thenReturn(new EntityTag("42"));
|
||||||
|
|
||||||
|
filter.filter(requestContext, responseContext);
|
||||||
|
|
||||||
|
verify(headers, never()).add("Cache-Control", "no-cache");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user