|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,68 @@ |
|||
/** |
|||
* Copyright © 2016-2024 The Thingsboard Authors |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 (the "License"); |
|||
* you may not use this file except in compliance with the License. |
|||
* You may obtain a copy of the License at |
|||
* |
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
|||
* |
|||
* Unless required by applicable law or agreed to in writing, software |
|||
* distributed under the License is distributed on an "AS IS" BASIS, |
|||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
* See the License for the specific language governing permissions and |
|||
* limitations under the License. |
|||
*/ |
|||
package org.springframework.http.converter.xml; |
|||
|
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.fasterxml.jackson.dataformat.xml.XmlMapper; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; |
|||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; |
|||
import org.springframework.util.Assert; |
|||
|
|||
import java.lang.reflect.Type; |
|||
import java.nio.charset.StandardCharsets; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* RestTemplate firstly uses MappingJackson2XmlHttpMessageConverter converter instead of MappingJackson2HttpMessageConverter. |
|||
* It produces error UnsupportedMediaType, so this converter had to be shadowed for read and write operations to use the correct converter |
|||
*/ |
|||
public class MappingJackson2XmlHttpMessageConverter extends AbstractJackson2HttpMessageConverter { |
|||
private static final List<MediaType> problemDetailMediaTypes; |
|||
|
|||
public MappingJackson2XmlHttpMessageConverter() { |
|||
this(Jackson2ObjectMapperBuilder.xml().build()); |
|||
} |
|||
|
|||
public MappingJackson2XmlHttpMessageConverter(ObjectMapper objectMapper) { |
|||
super(objectMapper, new MediaType[]{new MediaType("application", "xml", StandardCharsets.UTF_8), new MediaType("text", "xml", StandardCharsets.UTF_8), new MediaType("application", "*+xml", StandardCharsets.UTF_8)}); |
|||
Assert.isInstanceOf(XmlMapper.class, objectMapper, "XmlMapper required"); |
|||
} |
|||
|
|||
public void setObjectMapper(ObjectMapper objectMapper) { |
|||
Assert.isInstanceOf(XmlMapper.class, objectMapper, "XmlMapper required"); |
|||
super.setObjectMapper(objectMapper); |
|||
} |
|||
|
|||
protected List<MediaType> getMediaTypesForProblemDetail() { |
|||
return problemDetailMediaTypes; |
|||
} |
|||
|
|||
static { |
|||
problemDetailMediaTypes = Collections.singletonList(MediaType.APPLICATION_PROBLEM_XML); |
|||
} |
|||
|
|||
@Override |
|||
public boolean canRead(Type type, Class<?> contextClass, MediaType mediaType) { |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
public boolean canWrite(Class<?> clazz, MediaType mediaType) { |
|||
return false; |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
/** |
|||
* Copyright © 2016-2024 The Thingsboard Authors |
|||
* |
|||
* Licensed under the Apache License, Version 2.0 (the "License"); |
|||
* you may not use this file except in compliance with the License. |
|||
* You may obtain a copy of the License at |
|||
* |
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
|||
* |
|||
* Unless required by applicable law or agreed to in writing, software |
|||
* distributed under the License is distributed on an "AS IS" BASIS, |
|||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
* See the License for the specific language governing permissions and |
|||
* limitations under the License. |
|||
*/ |
|||
package org.thingsboard.server.controller; |
|||
|
|||
import lombok.Getter; |
|||
import org.springframework.boot.test.mock.mockito.SpyBean; |
|||
import org.springframework.test.context.TestPropertySource; |
|||
import org.thingsboard.server.dao.service.DaoSqlTest; |
|||
import org.thingsboard.server.dao.sqlts.insert.sql.DedicatedEventsSqlPartitioningRepository; |
|||
|
|||
@DaoSqlTest |
|||
@TestPropertySource(properties = { |
|||
"spring.datasource.events.enabled=true", |
|||
"spring.datasource.events.url=${spring.datasource.url}", |
|||
"spring.datasource.events.driverClassName=${spring.datasource.driverClassName}", |
|||
}) |
|||
public class AuditLogControllerTest_DedicatedEventsDataSource extends AuditLogControllerTest { |
|||
|
|||
@Getter |
|||
@SpyBean |
|||
private DedicatedEventsSqlPartitioningRepository partitioningRepository; |
|||
|
|||
} |
|||