Code format - hawkbit-core (#1924)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
SPDX-License-Identifier: EPL-2.0
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit;
|
||||
|
||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||
|
||||
/**
|
||||
* {@link ContextAware} provides means for getting the current context (via {@link #getCurrentContext()}) and then
|
||||
* to execute a {@link Runnable} or a {@link Function} in the same context using {@link #runInContext(String, Runnable)}
|
||||
@@ -38,7 +38,6 @@ public interface ContextAware extends TenantAware {
|
||||
*
|
||||
* @param <T> the type of the input to the function
|
||||
* @param <R> the type of the result of the function
|
||||
*
|
||||
* @param serializedContext created by {@link #getCurrentContext()}. Must be non-<code>null</code>.
|
||||
* @param function function to call in the reconstructed context. Must be non-<code>null</code>.
|
||||
* @param t the argument that will be passed to the function
|
||||
|
||||
@@ -12,7 +12,6 @@ package org.eclipse.hawkbit;
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
@@ -25,6 +24,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "hawkbit.controller")
|
||||
public class ControllerPollProperties implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,12 @@ public class DistributedResourceBundleMessageSource extends ReloadableResourceBu
|
||||
setUseCodeAsDefaultMessage(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResourceLoader(final ResourceLoader resourceLoader) {
|
||||
this.resourceLoader = resourceLoader;
|
||||
super.setResourceLoader(resourceLoader);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertiesHolder refreshProperties(final String filename, final PropertiesHolder propHolder) {
|
||||
final Properties properties = new Properties();
|
||||
@@ -66,10 +72,4 @@ public class DistributedResourceBundleMessageSource extends ReloadableResourceBu
|
||||
}
|
||||
return new PropertiesHolder(properties, lastModified);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResourceLoader(final ResourceLoader resourceLoader) {
|
||||
this.resourceLoader = resourceLoader;
|
||||
super.setResourceLoader(resourceLoader);
|
||||
}
|
||||
}
|
||||
@@ -11,25 +11,26 @@ package org.eclipse.hawkbit;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties for the server e.g. the server's URL which must be configured.
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@ConfigurationProperties("hawkbit.server")
|
||||
public class HawkbitServerProperties {
|
||||
|
||||
private final Anonymous anonymous = new Anonymous();
|
||||
private final Build build = new Build();
|
||||
/**
|
||||
* Defines under which URI the update server can be reached. Used to
|
||||
* calculate download URLs for DMF transmitted update actions.
|
||||
*/
|
||||
private String url = "http://localhost:8080";
|
||||
|
||||
private final Anonymous anonymous = new Anonymous();
|
||||
|
||||
private final Build build = new Build();
|
||||
public void setUrl(final String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties for anonymous API access by Devices/Controllers.
|
||||
@@ -42,7 +43,6 @@ public class HawkbitServerProperties {
|
||||
/**
|
||||
* Properties for artifact download under anonymous API access by
|
||||
* Devices/Controllers.
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public static class Download {
|
||||
@@ -56,7 +56,6 @@ public class HawkbitServerProperties {
|
||||
|
||||
/**
|
||||
* Build information of the hawkBit instance. Influenced by maven.
|
||||
*
|
||||
*/
|
||||
public static class Build {
|
||||
|
||||
@@ -74,8 +73,4 @@ public class HawkbitServerProperties {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setUrl(final String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* Container for a generated Artifact URL.
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class ArtifactUrl {
|
||||
@@ -25,12 +24,9 @@ public class ArtifactUrl {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param protocol
|
||||
* string, e.g. ftp, http, https
|
||||
* @param rel
|
||||
* hypermedia value
|
||||
* @param ref
|
||||
* hypermedia value
|
||||
* @param protocol string, e.g. ftp, http, https
|
||||
* @param rel hypermedia value
|
||||
* @param ref hypermedia value
|
||||
*/
|
||||
public ArtifactUrl(final String protocol, final String rel, final String ref) {
|
||||
this.protocol = protocol;
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.List;
|
||||
/**
|
||||
* Interface declaration of the {@link ArtifactUrlHandler} which generates the
|
||||
* URLs to specific artifacts.
|
||||
*
|
||||
*/
|
||||
public interface ArtifactUrlHandler {
|
||||
|
||||
@@ -23,11 +22,8 @@ public interface ArtifactUrlHandler {
|
||||
* Returns a generated download URL for a given artifact parameters for a
|
||||
* specific protocol.
|
||||
*
|
||||
* @param placeholder
|
||||
* data for URL generation
|
||||
* @param api
|
||||
* given protocol that URL needs to support
|
||||
*
|
||||
* @param placeholder data for URL generation
|
||||
* @param api given protocol that URL needs to support
|
||||
* @return an URL for the given artifact parameters in a given protocol
|
||||
*/
|
||||
List<ArtifactUrl> getUrls(URLPlaceholder placeholder, ApiType api);
|
||||
@@ -36,14 +32,10 @@ public interface ArtifactUrlHandler {
|
||||
* Returns a generated download URL for a given artifact parameters for a
|
||||
* specific protocol.
|
||||
*
|
||||
* @param placeholder
|
||||
* data for URL generation
|
||||
* @param api
|
||||
* given protocol that URL needs to support
|
||||
* @param requestUri
|
||||
* of the request that allows the handler to align the generated
|
||||
* @param placeholder data for URL generation
|
||||
* @param api given protocol that URL needs to support
|
||||
* @param requestUri of the request that allows the handler to align the generated
|
||||
* URL to the original request.
|
||||
*
|
||||
* @return an URL for the given artifact parameters in a given protocol
|
||||
*/
|
||||
List<ArtifactUrl> getUrls(URLPlaceholder placeholder, ApiType api, URI requestUri);
|
||||
|
||||
@@ -23,8 +23,7 @@ public final class Base62Util {
|
||||
private static final int BASE62_BASE = BASE62_ALPHABET.length();
|
||||
|
||||
/**
|
||||
* @param base10
|
||||
* number
|
||||
* @param base10 number
|
||||
* @return converted number into Base62 ASCII string
|
||||
*/
|
||||
public static String fromBase10(final long base10) {
|
||||
@@ -42,8 +41,7 @@ public final class Base62Util {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param base62
|
||||
* number
|
||||
* @param base62 number
|
||||
* @return converted number into Base10
|
||||
*/
|
||||
public static Long toBase10(final String base62) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.net.URL;
|
||||
|
||||
/**
|
||||
* Resolve to reach the server url.
|
||||
*
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface HostnameResolver {
|
||||
|
||||
@@ -40,7 +40,6 @@ import org.springframework.util.StringUtils;
|
||||
* Default (MD5SUM files):
|
||||
* {protocol}://{hostname}:{port}{contextPath}/{tenant}/controller/v1/{controllerId}/
|
||||
* softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}.MD5SUM
|
||||
*
|
||||
*/
|
||||
public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
|
||||
|
||||
@@ -64,16 +63,13 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
|
||||
private static final String TENANT_ID_BASE10_PLACEHOLDER = "tenantId";
|
||||
private static final String TENANT_ID_BASE62_PLACEHOLDER = "tenantIdBase62";
|
||||
private static final String SOFTWARE_MODULE_ID_BASE10_PLACEHOLDER = "softwareModuleId";
|
||||
private static final String SOFTWARE_MODULE_ID_BASE62_PLACEHOLDER = "softwareModuleIdBase62";
|
||||
|
||||
final static String DEFAULT_URL_PROTOCOL_REF = "{" + PROTOCOL_PLACEHOLDER + "}://{" + HOSTNAME_PLACEHOLDER + "}:{" + PORT_PLACEHOLDER + "}{" + CONTEXT_PATH + "}/{" + TENANT_PLACEHOLDER + "}/controller/v1/{" + CONTROLLER_ID_PLACEHOLDER + "}/softwaremodules/{" + SOFTWARE_MODULE_ID_BASE10_PLACEHOLDER + "}/artifacts/{" + ARTIFACT_FILENAME_PLACEHOLDER + "}";
|
||||
|
||||
private static final String SOFTWARE_MODULE_ID_BASE62_PLACEHOLDER = "softwareModuleIdBase62";
|
||||
private final ArtifactUrlHandlerProperties urlHandlerProperties;
|
||||
private final String contextPath;
|
||||
|
||||
/**
|
||||
* @param urlHandlerProperties
|
||||
* for URL generation configuration
|
||||
* @param urlHandlerProperties for URL generation configuration
|
||||
*/
|
||||
public PropertyBasedArtifactUrlHandler(final ArtifactUrlHandlerProperties urlHandlerProperties, final String contextPath) {
|
||||
this.urlHandlerProperties = urlHandlerProperties;
|
||||
@@ -95,6 +91,58 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
|
||||
|
||||
}
|
||||
|
||||
private static String getRequestPort(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return getPort(protocol);
|
||||
}
|
||||
// if port undefined then default protocol port is used
|
||||
return requestUri.getPort() > 0 ? String.valueOf(requestUri.getPort()) : "";
|
||||
}
|
||||
|
||||
private static String getRequestHost(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
return Optional.ofNullable(requestUri.getHost()).orElse(protocol.getHostname());
|
||||
}
|
||||
|
||||
private static String getRequestProtocol(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return protocol.getProtocol();
|
||||
}
|
||||
|
||||
return Optional.ofNullable(requestUri.getScheme()).orElse(protocol.getProtocol());
|
||||
}
|
||||
|
||||
private static String getPort(final UrlProtocol protocol) {
|
||||
return ObjectUtils.isEmpty(protocol.getPort()) ? null : String.valueOf(protocol.getPort());
|
||||
}
|
||||
|
||||
private static String computeHostWithRequestDomain(final UrlProtocol protocol, final URI requestUri) {
|
||||
|
||||
if (requestUri == null) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
if (!protocol.getHostname().contains(".")) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
final String host = StringUtils.delimitedListToStringArray(protocol.getHostname(), ".")[0].trim();
|
||||
|
||||
final List<String> domainElements = Arrays
|
||||
.asList(StringUtils.delimitedListToStringArray(requestUri.getHost(), "."));
|
||||
final String domain = StringUtils.collectionToDelimitedString(domainElements.subList(1, domainElements.size()),
|
||||
".");
|
||||
|
||||
if (ObjectUtils.isEmpty(domain)) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
return host + "." + domain;
|
||||
}
|
||||
|
||||
private String generateUrl(final UrlProtocol protocol, final URLPlaceholder placeholder,
|
||||
final URI requestUri) {
|
||||
final Set<Entry<String, String>> entrySet = getReplaceMap(protocol, placeholder, requestUri).entrySet();
|
||||
@@ -153,56 +201,4 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
|
||||
return replaceMap;
|
||||
}
|
||||
|
||||
private static String getRequestPort(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return getPort(protocol);
|
||||
}
|
||||
// if port undefined then default protocol port is used
|
||||
return requestUri.getPort() > 0 ? String.valueOf(requestUri.getPort()) : "";
|
||||
}
|
||||
|
||||
private static String getRequestHost(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
return Optional.ofNullable(requestUri.getHost()).orElse(protocol.getHostname());
|
||||
}
|
||||
|
||||
private static String getRequestProtocol(final UrlProtocol protocol, final URI requestUri) {
|
||||
if (requestUri == null) {
|
||||
return protocol.getProtocol();
|
||||
}
|
||||
|
||||
return Optional.ofNullable(requestUri.getScheme()).orElse(protocol.getProtocol());
|
||||
}
|
||||
|
||||
private static String getPort(final UrlProtocol protocol) {
|
||||
return ObjectUtils.isEmpty(protocol.getPort()) ? null : String.valueOf(protocol.getPort());
|
||||
}
|
||||
|
||||
private static String computeHostWithRequestDomain(final UrlProtocol protocol, final URI requestUri) {
|
||||
|
||||
if (requestUri == null) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
if (!protocol.getHostname().contains(".")) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
final String host = StringUtils.delimitedListToStringArray(protocol.getHostname(), ".")[0].trim();
|
||||
|
||||
final List<String> domainElements = Arrays
|
||||
.asList(StringUtils.delimitedListToStringArray(requestUri.getHost(), "."));
|
||||
final String domain = StringUtils.collectionToDelimitedString(domainElements.subList(1, domainElements.size()),
|
||||
".");
|
||||
|
||||
if (ObjectUtils.isEmpty(domain)) {
|
||||
return protocol.getHostname();
|
||||
}
|
||||
|
||||
return host + "." + domain;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ package org.eclipse.hawkbit.api;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Container for variables available to the {@link ArtifactUrlHandler}.
|
||||
*/
|
||||
@@ -28,16 +26,11 @@ public class URLPlaceholder {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param tenant
|
||||
* of the client
|
||||
* @param tenantId
|
||||
* of teh tenant
|
||||
* @param controllerId
|
||||
* of the target
|
||||
* @param targetId
|
||||
* of the target
|
||||
* @param softwareData
|
||||
* information about the artifact and software module that can be
|
||||
* @param tenant of the client
|
||||
* @param tenantId of teh tenant
|
||||
* @param controllerId of the target
|
||||
* @param targetId of the target
|
||||
* @param softwareData information about the artifact and software module that can be
|
||||
* accessed by the URL.
|
||||
*/
|
||||
public URLPlaceholder(final String tenant, final Long tenantId, final String controllerId, final Long targetId,
|
||||
@@ -64,14 +57,10 @@ public class URLPlaceholder {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param softwareModuleId
|
||||
* of the module the artifact belongs to
|
||||
* @param filename
|
||||
* of the artifact
|
||||
* @param artifactId
|
||||
* of the artifact
|
||||
* @param sha1Hash
|
||||
* of the artifact
|
||||
* @param softwareModuleId of the module the artifact belongs to
|
||||
* @param filename of the artifact
|
||||
* @param artifactId of the artifact
|
||||
* @param sha1Hash of the artifact
|
||||
*/
|
||||
public SoftwareData(final Long softwareModuleId, final String filename, final Long artifactId,
|
||||
final String sha1Hash) {
|
||||
|
||||
@@ -83,19 +83,8 @@ public abstract class AbstractArtifactRepository implements ArtifactRepository {
|
||||
}
|
||||
}
|
||||
|
||||
private AbstractDbArtifact addMissingHashes(final AbstractDbArtifact existing, final String calculatedSha1,
|
||||
final String calculatedMd5, final String calculatedSha256) {
|
||||
|
||||
final String sha1 = checkEmpty(existing.getHashes().getSha1(), calculatedSha1);
|
||||
final String md5 = checkEmpty(existing.getHashes().getMd5(), calculatedMd5);
|
||||
final String sha256 = checkEmpty(existing.getHashes().getSha256(), calculatedSha256);
|
||||
|
||||
existing.setHashes(new DbArtifactHash(sha1, md5, sha256));
|
||||
return existing;
|
||||
}
|
||||
|
||||
private String checkEmpty(final String value, final String fallback) {
|
||||
return StringUtils.isEmpty(value) ? fallback : value;
|
||||
protected static String sanitizeTenant(final String tenant) {
|
||||
return tenant.trim().toUpperCase();
|
||||
}
|
||||
|
||||
protected void deleteTempFile(final String tempFile) {
|
||||
@@ -116,6 +105,9 @@ public abstract class AbstractArtifactRepository implements ArtifactRepository {
|
||||
return file.getPath();
|
||||
}
|
||||
|
||||
protected abstract AbstractDbArtifact store(final String tenant, final DbArtifactHash base16Hashes,
|
||||
final String contentType, final String tempFile) throws IOException;
|
||||
|
||||
private static File createTempFile() {
|
||||
try {
|
||||
return Files.createTempFile(TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX).toFile();
|
||||
@@ -149,15 +141,23 @@ public abstract class AbstractArtifactRepository implements ArtifactRepository {
|
||||
return providedHashValue != null && !hashValue.equals(providedHashValue);
|
||||
}
|
||||
|
||||
protected abstract AbstractDbArtifact store(final String tenant, final DbArtifactHash base16Hashes,
|
||||
final String contentType, final String tempFile) throws IOException;
|
||||
|
||||
private static DigestInputStream wrapInDigestInputStream(final InputStream input, final MessageDigest mdSHA1,
|
||||
final MessageDigest mdMD5, final MessageDigest mdSHA256) {
|
||||
return new DigestInputStream(new DigestInputStream(new DigestInputStream(input, mdSHA256), mdMD5), mdSHA1);
|
||||
}
|
||||
|
||||
protected static String sanitizeTenant(final String tenant) {
|
||||
return tenant.trim().toUpperCase();
|
||||
private AbstractDbArtifact addMissingHashes(final AbstractDbArtifact existing, final String calculatedSha1,
|
||||
final String calculatedMd5, final String calculatedSha256) {
|
||||
|
||||
final String sha1 = checkEmpty(existing.getHashes().getSha1(), calculatedSha1);
|
||||
final String md5 = checkEmpty(existing.getHashes().getMd5(), calculatedMd5);
|
||||
final String sha256 = checkEmpty(existing.getHashes().getSha256(), calculatedSha256);
|
||||
|
||||
existing.setHashes(new DbArtifactHash(sha1, md5, sha256));
|
||||
return existing;
|
||||
}
|
||||
|
||||
private String checkEmpty(final String value, final String fallback) {
|
||||
return StringUtils.isEmpty(value) ? fallback : value;
|
||||
}
|
||||
}
|
||||
@@ -19,33 +19,22 @@ import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash;
|
||||
|
||||
/**
|
||||
* ArtifactRepository service interface.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface ArtifactRepository {
|
||||
|
||||
/**
|
||||
* Stores an artifact into the repository.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant to store the artifact
|
||||
* @param content
|
||||
* the content to store
|
||||
* @param filename
|
||||
* the filename of the artifact
|
||||
* @param contentType
|
||||
* the content type of the artifact
|
||||
* @param hash
|
||||
* the hashes of the artifact to do hash-checks after storing the
|
||||
* @param tenant the tenant to store the artifact
|
||||
* @param content the content to store
|
||||
* @param filename the filename of the artifact
|
||||
* @param contentType the content type of the artifact
|
||||
* @param hash the hashes of the artifact to do hash-checks after storing the
|
||||
* artifact, might be {@code null}
|
||||
* @return the stored artifact
|
||||
*
|
||||
* @throws MethodNotSupportedException
|
||||
* if implementation does not support the operation
|
||||
* @throws ArtifactStoreException
|
||||
* in case storing of the artifact was not successful
|
||||
* @throws HashNotMatchException
|
||||
* in case {@code hash} is provided and not matching to the
|
||||
* @throws MethodNotSupportedException if implementation does not support the operation
|
||||
* @throws ArtifactStoreException in case storing of the artifact was not successful
|
||||
* @throws HashNotMatchException in case {@code hash} is provided and not matching to the
|
||||
* calculated hashes during storing
|
||||
*/
|
||||
AbstractDbArtifact store(@NotEmpty String tenant, @NotNull InputStream content, @NotEmpty String filename,
|
||||
@@ -54,46 +43,34 @@ public interface ArtifactRepository {
|
||||
/**
|
||||
* Deletes an artifact by its SHA1 hash.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant to store the artifact
|
||||
* @param sha1Hash
|
||||
* the sha1-hash of the artifact to delete
|
||||
*
|
||||
* @throws MethodNotSupportedException
|
||||
* if implementation does not support the operation
|
||||
* @param tenant the tenant to store the artifact
|
||||
* @param sha1Hash the sha1-hash of the artifact to delete
|
||||
* @throws MethodNotSupportedException if implementation does not support the operation
|
||||
*/
|
||||
void deleteBySha1(@NotEmpty String tenant, @NotEmpty String sha1Hash);
|
||||
|
||||
/**
|
||||
* Retrieves a {@link AbstractDbArtifact} from the store by its SHA1 hash.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant to store the artifact
|
||||
* @param sha1Hash
|
||||
* the sha1-hash of the file to lookup.
|
||||
* @param tenant the tenant to store the artifact
|
||||
* @param sha1Hash the sha1-hash of the file to lookup.
|
||||
* @return The artifact file object or {@code null} if no file exists.
|
||||
*
|
||||
* @throws MethodNotSupportedException
|
||||
* if implementation does not support the operation
|
||||
* @throws MethodNotSupportedException if implementation does not support the operation
|
||||
*/
|
||||
AbstractDbArtifact getArtifactBySha1(@NotEmpty String tenant, @NotEmpty String sha1Hash);
|
||||
|
||||
/**
|
||||
* Deletes all artifacts of given tenant.
|
||||
*
|
||||
* @param tenant
|
||||
* to erase
|
||||
* @param tenant to erase
|
||||
*/
|
||||
void deleteByTenant(@NotEmpty String tenant);
|
||||
|
||||
/**
|
||||
* Checks if an artifact exists for a given tenant by its sha1 hash
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant
|
||||
* @param sha1Hash
|
||||
* the sha1-hash of the file to lookup.
|
||||
*
|
||||
* @param tenant the tenant
|
||||
* @param sha1Hash the sha1-hash of the file to lookup.
|
||||
* @return the boolean whether the artifact exists or not
|
||||
*/
|
||||
boolean existsByTenantAndSha1(@NotEmpty String tenant, @NotEmpty String sha1Hash);
|
||||
|
||||
@@ -20,10 +20,8 @@ public class ArtifactStoreException extends RuntimeException {
|
||||
/**
|
||||
* Constructs a ArtifactStoreException with message and cause.
|
||||
*
|
||||
* @param message
|
||||
* the message of the exception
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param message the message of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public ArtifactStoreException(final String message, final Throwable cause) {
|
||||
super(message, cause);
|
||||
@@ -32,8 +30,7 @@ public class ArtifactStoreException extends RuntimeException {
|
||||
/**
|
||||
* Constructs a ArtifactStoreException with message.
|
||||
*
|
||||
* @param message
|
||||
* the message of the exception
|
||||
* @param message the message of the exception
|
||||
*/
|
||||
public ArtifactStoreException(final String message) {
|
||||
super(message);
|
||||
@@ -42,8 +39,7 @@ public class ArtifactStoreException extends RuntimeException {
|
||||
/**
|
||||
* Constructs a ArtifactStoreException with cause.
|
||||
*
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public ArtifactStoreException(final Throwable cause) {
|
||||
super(cause);
|
||||
|
||||
@@ -12,29 +12,21 @@ package org.eclipse.hawkbit.artifact.repository;
|
||||
/**
|
||||
* Thrown when provided hashes and hashes caluclated during storing are not
|
||||
* matching.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class HashNotMatchException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String SHA1 = "SHA-1";
|
||||
public static final String MD5 = "MD5";
|
||||
public static final String SHA256 = "SHA-256";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final String hashFunction;
|
||||
|
||||
/**
|
||||
* Constructs a HashNotMatchException with message and cause.
|
||||
*
|
||||
* @param message
|
||||
* the message of the exception
|
||||
* @param cause
|
||||
* the cause of the exception
|
||||
* @param hashFunction
|
||||
* the hash function which caused this exception
|
||||
* @param message the message of the exception
|
||||
* @param cause the cause of the exception
|
||||
* @param hashFunction the hash function which caused this exception
|
||||
*/
|
||||
public HashNotMatchException(final String message, final Throwable cause, final String hashFunction) {
|
||||
super(message, cause);
|
||||
@@ -44,10 +36,8 @@ public class HashNotMatchException extends RuntimeException {
|
||||
/**
|
||||
* Constructs a HashNotMatchException with message.
|
||||
*
|
||||
* @param message
|
||||
* the message of the exception
|
||||
* @param hashFunction
|
||||
* the hash function which caused this exception
|
||||
* @param message the message of the exception
|
||||
* @param hashFunction the hash function which caused this exception
|
||||
*/
|
||||
public HashNotMatchException(final String message, final String hashFunction) {
|
||||
super(message);
|
||||
|
||||
@@ -22,8 +22,7 @@ public interface TenancyCacheManager extends CacheManager {
|
||||
* tenant key. This is necessary e.g. for retrieving caches not for the
|
||||
* current tenant.
|
||||
*
|
||||
* @param name
|
||||
* the name of the cache to retrieve directly
|
||||
* @param name the name of the cache to retrieve directly
|
||||
* @return the cache associated with the name without tenancy separation
|
||||
*/
|
||||
Cache getDirectCache(String name);
|
||||
@@ -32,8 +31,7 @@ public interface TenancyCacheManager extends CacheManager {
|
||||
* Evicts all caches for a given tenant. All caches under a certain tenant
|
||||
* gets evicted.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant to evict caches
|
||||
* @param tenant the tenant to evict caches
|
||||
*/
|
||||
void evictCaches(final String tenant);
|
||||
}
|
||||
|
||||
@@ -38,10 +38,8 @@ public class TenantAwareCacheManager implements TenancyCacheManager {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param delegate
|
||||
* the {@link CacheManager} to delegate to.
|
||||
* @param tenantAware
|
||||
* the tenant aware to retrieve the current tenant
|
||||
* @param delegate the {@link CacheManager} to delegate to.
|
||||
* @param tenantAware the tenant aware to retrieve the current tenant
|
||||
*/
|
||||
public TenantAwareCacheManager(final CacheManager delegate, final TenantAware tenantAware) {
|
||||
this.tenantAware = tenantAware;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.exception;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* Generic Custom Exception to wrap the Runtime and checked exception
|
||||
*/
|
||||
@@ -93,7 +93,8 @@ public abstract class AbstractServerRtException extends RuntimeException {
|
||||
* @param error detail
|
||||
* @param cause of the exception
|
||||
*/
|
||||
protected AbstractServerRtException(final String message, final SpServerError error, final Throwable cause, final Map<String, Object> info) {
|
||||
protected AbstractServerRtException(final String message, final SpServerError error, final Throwable cause,
|
||||
final Map<String, Object> info) {
|
||||
super(message, cause);
|
||||
this.error = error;
|
||||
this.info = info;
|
||||
|
||||
@@ -13,11 +13,9 @@ package org.eclipse.hawkbit.exception;
|
||||
* {@link GenericSpServerException} is thrown when a given entity in's actual
|
||||
* and cannot be stored within the current session. Reason could be that it has
|
||||
* been changed within another session.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class GenericSpServerException extends AbstractServerRtException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final SpServerError THIS_ERROR = SpServerError.SP_REPO_GENERIC_ERROR;
|
||||
|
||||
@@ -31,8 +29,7 @@ public class GenericSpServerException extends AbstractServerRtException {
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public GenericSpServerException(final Throwable cause) {
|
||||
super(THIS_ERROR, cause);
|
||||
@@ -41,10 +38,8 @@ public class GenericSpServerException extends AbstractServerRtException {
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* custom error message
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param message custom error message
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public GenericSpServerException(final String message, final Throwable cause) {
|
||||
super(message, THIS_ERROR, cause);
|
||||
@@ -53,8 +48,7 @@ public class GenericSpServerException extends AbstractServerRtException {
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* custom error message
|
||||
* @param message custom error message
|
||||
*/
|
||||
public GenericSpServerException(final String message) {
|
||||
super(message, THIS_ERROR);
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.eclipse.hawkbit.exception;
|
||||
|
||||
public enum SpServerError {
|
||||
|
||||
|
||||
SP_REPO_GENERIC_ERROR("hawkbit.server.error.repo.genericError", "unknown error occurred"),
|
||||
SP_REPO_ENTITY_ALREADY_EXISTS("hawkbit.server.error.repo.entitiyAlreayExists",
|
||||
"The given entity already exists in database"),
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Sort and search fields for actions.
|
||||
*/
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.AbstractMap.SimpleImmutableEntry;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the DistributionSet model which can be used in the
|
||||
* REST API e.g. for sorting etc.
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Tag model which can be used in the REST API e.g.
|
||||
* for sorting etc.
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Rollout model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* An RSQL query field interface extended by all the fields that could be used in RSQL queries.
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.AbstractMap.SimpleImmutableEntry;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the SoftwareModule model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@@ -41,6 +41,7 @@ public enum SoftwareModuleFields implements RsqlQueryField {
|
||||
SoftwareModuleFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this(jpaEntityFieldName, List.of(subEntityAttributes), null);
|
||||
}
|
||||
|
||||
SoftwareModuleFields(final String jpaEntityFieldName, final Entry<String, String> subEntityMapTuple) {
|
||||
this(jpaEntityFieldName, Collections.emptyList(), subEntityMapTuple);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.AbstractMap.SimpleImmutableEntry;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Target model which can be used in the REST API
|
||||
* e.g. for sorting etc.
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Target model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
|
||||
@@ -34,10 +34,8 @@ public interface TenantAware {
|
||||
* {@link TenantRunner} it must be ensured that the original tenant before
|
||||
* this invocation is reset.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant which the specific code should run
|
||||
* @param tenantRunner
|
||||
* the runner which is implemented to run this specific code
|
||||
* @param tenant the tenant which the specific code should run
|
||||
* @param tenantRunner the runner which is implemented to run this specific code
|
||||
* under the given tenant
|
||||
* @return the return type of the {@link TenantRunner}
|
||||
*/
|
||||
@@ -50,12 +48,9 @@ public interface TenantAware {
|
||||
* {@link TenantRunner} it must be ensured that the original tenant before
|
||||
* this invocation is reset.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant which the specific code should run with
|
||||
* @param username
|
||||
* the username which the specific code should run with
|
||||
* @param tenantRunner
|
||||
* the runner which is implemented to run this specific code
|
||||
* @param tenant the tenant which the specific code should run with
|
||||
* @param username the username which the specific code should run with
|
||||
* @param tenantRunner the runner which is implemented to run this specific code
|
||||
* under the given tenant
|
||||
* @return the return type of the {@link TenantRunner}
|
||||
*/
|
||||
@@ -66,14 +61,11 @@ public interface TenantAware {
|
||||
* a given tenant by using the
|
||||
* {@link TenantAware#runAsTenant(String, TenantRunner)}.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param <T>
|
||||
* the return type of the runner
|
||||
* @param <T> the return type of the runner
|
||||
*/
|
||||
@FunctionalInterface
|
||||
interface TenantRunner<T> {
|
||||
|
||||
/**
|
||||
* Called to run specific code and a given tenant.
|
||||
*
|
||||
|
||||
@@ -21,10 +21,8 @@ public interface UserAuthoritiesResolver {
|
||||
/**
|
||||
* User authorities/roles lookup based on the tenant and the username
|
||||
*
|
||||
* @param tenant
|
||||
* The tenant that this user belongs to
|
||||
* @param username
|
||||
* The username of the user
|
||||
* @param tenant The tenant that this user belongs to
|
||||
* @param username The username of the user
|
||||
* @return a {@link Collection} of authorities/roles for this user
|
||||
*/
|
||||
Collection<String> getUserAuthorities(String tenant, String username);
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.eclipse.hawkbit.exception.SpServerError;
|
||||
/**
|
||||
* The {@link #InvalidTenantConfigurationKeyException} is thrown when an invalid
|
||||
* configuration key is used.
|
||||
*
|
||||
*/
|
||||
public class InvalidTenantConfigurationKeyException extends AbstractServerRtException {
|
||||
|
||||
@@ -32,8 +31,7 @@ public class InvalidTenantConfigurationKeyException extends AbstractServerRtExce
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public InvalidTenantConfigurationKeyException(final Throwable cause) {
|
||||
super(THIS_ERROR, cause);
|
||||
@@ -42,10 +40,8 @@ public class InvalidTenantConfigurationKeyException extends AbstractServerRtExce
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* of the exception
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param message of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public InvalidTenantConfigurationKeyException(final String message, final Throwable cause) {
|
||||
super(message, THIS_ERROR, cause);
|
||||
@@ -54,8 +50,7 @@ public class InvalidTenantConfigurationKeyException extends AbstractServerRtExce
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* of the exception
|
||||
* @param message of the exception
|
||||
*/
|
||||
public InvalidTenantConfigurationKeyException(final String message) {
|
||||
super(message, THIS_ERROR);
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.eclipse.hawkbit.exception.SpServerError;
|
||||
/**
|
||||
* Exception which is thrown, when the validation of the configuration value has
|
||||
* not been successful.
|
||||
*
|
||||
*/
|
||||
public class TenantConfigurationValidatorException extends AbstractServerRtException {
|
||||
|
||||
@@ -32,8 +31,7 @@ public class TenantConfigurationValidatorException extends AbstractServerRtExcep
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public TenantConfigurationValidatorException(final Throwable cause) {
|
||||
super(THIS_ERROR, cause);
|
||||
@@ -42,10 +40,8 @@ public class TenantConfigurationValidatorException extends AbstractServerRtExcep
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* of the exception
|
||||
* @param cause
|
||||
* of the exception
|
||||
* @param message of the exception
|
||||
* @param cause of the exception
|
||||
*/
|
||||
public TenantConfigurationValidatorException(final String message, final Throwable cause) {
|
||||
super(message, THIS_ERROR, cause);
|
||||
@@ -54,8 +50,7 @@ public class TenantConfigurationValidatorException extends AbstractServerRtExcep
|
||||
/**
|
||||
* Parameterized constructor.
|
||||
*
|
||||
* @param message
|
||||
* of the exception
|
||||
* @param message of the exception
|
||||
*/
|
||||
public TenantConfigurationValidatorException(final String message) {
|
||||
super(message, THIS_ERROR);
|
||||
|
||||
@@ -11,11 +11,10 @@ package org.eclipse.hawkbit.api;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Feature("Unit Tests - Artifact URL Handler")
|
||||
@Story("Base62 Utility tests")
|
||||
|
||||
@@ -13,18 +13,16 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties.UrlProtocol;
|
||||
import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
/**
|
||||
@@ -51,13 +49,10 @@ public class PropertyBasedArtifactUrlHandlerTest {
|
||||
private static final String TENANT = "TEST_TENANT";
|
||||
|
||||
private static final String HTTP_LOCALHOST = "http://localhost:8080/";
|
||||
|
||||
private ArtifactUrlHandler urlHandlerUnderTest;
|
||||
|
||||
private ArtifactUrlHandlerProperties properties;
|
||||
|
||||
private static URLPlaceholder placeholder = new URLPlaceholder(TENANT, TENANT_ID, CONTROLLER_ID, TARGETID,
|
||||
new SoftwareData(SOFTWAREMODULEID, FILENAME_DECODE, ARTIFACTID, SHA1HASH));
|
||||
private ArtifactUrlHandler urlHandlerUnderTest;
|
||||
private ArtifactUrlHandlerProperties properties;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
@@ -142,6 +137,7 @@ public class PropertyBasedArtifactUrlHandlerTest {
|
||||
assertThat(urls).containsExactly(new ArtifactUrl(TEST_PROTO.toUpperCase(), TEST_REL, TEST_PROTO + "://"
|
||||
+ testHost + ":5683/fws/" + TENANT + "/" + TARGETID_BASE62 + "/" + ARTIFACTID_BASE62));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verfies that the protocol of the statically defined hostname is replaced with the protocol of the request.")
|
||||
public void urlGenerationWithProtocolFromRequest() throws URISyntaxException {
|
||||
|
||||
@@ -11,11 +11,10 @@ package org.eclipse.hawkbit.api;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Feature("Unit Tests - Artifact URL Handler")
|
||||
@Story("URL placeholder tests")
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ClassInfo;
|
||||
import io.github.classgraph.ScanResult;
|
||||
import io.qameta.allure.Description;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class FileNameFieldsTest {
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user