Compare commits

..

No commits in common. "feature/RED-10196" and "main" have entirely different histories.

6 changed files with 5 additions and 35 deletions

View File

@ -18,5 +18,4 @@ deploy:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH =~ /^release/
- if: $CI_COMMIT_BRANCH =~ /^feature/
- if: $CI_COMMIT_TAG

View File

@ -1,7 +0,0 @@
package com.knecon.fforesight.tenantcommons;
public enum TenantApplicationType {
RedactManager,
DocuMine,
Clarifynd
}

View File

@ -15,6 +15,4 @@ public interface TenantProvider {
List<TenantResponse> getTenants();
TenantApplicationType getTenantApplicationType(String tenantId);
}

View File

@ -24,7 +24,6 @@ public interface TenantsClient extends TenantProvider {
String TENANT_ID_PARAM = "tenantId";
String DETAILS_PATH = "/details";
String TENANT_ID_PATH_PARAM = "/{" + TENANT_ID_PARAM + "}";
String APPLICATION_TYPE_PATH = "/application-type";
@PostMapping(value = TENANT_PATH + TENANT_ID_PATH_PARAM + DETAILS_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
@ -38,8 +37,4 @@ public interface TenantsClient extends TenantProvider {
@GetMapping(value = TENANT_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
List<TenantResponse> getTenants();
@GetMapping(value = TENANT_PATH + TENANT_ID_PATH_PARAM + APPLICATION_TYPE_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
TenantApplicationType getTenantApplicationType(@PathVariable(TENANT_ID_PARAM) String tenantId);
}

View File

@ -3,8 +3,6 @@ package com.knecon.fforesight.tenantcommons.model;
import java.util.HashMap;
import java.util.Map;
import com.knecon.fforesight.tenantcommons.TenantApplicationType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -28,6 +26,5 @@ public class TenantResponse implements ITenantEvent {
private AuthDetails authDetails;
private Map<String, Object> details = new HashMap<>();
private TenantApplicationType applicationType;
}

View File

@ -2,10 +2,10 @@ package com.knecon.fforesight.tenantcommons.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.knecon.fforesight.tenantcommons.TenantApplicationType;
import com.knecon.fforesight.tenantcommons.TenantProvider;
import com.knecon.fforesight.tenantcommons.listener.ITenantEventHandler;
import com.knecon.fforesight.tenantcommons.model.TenantCreatedEvent;
@ -27,10 +27,7 @@ public class TestTenantProvider implements TenantProvider, ITenantEventHandler<T
@Override
public TenantResponse getTenant(String s) {
return tenants.stream()
.filter(t -> t.getTenantId().equals(s))
.findFirst()
.orElse(null);
return tenants.stream().filter(t -> t.getTenantId().equals(s)).findFirst().orElse(null);
}
@ -41,21 +38,12 @@ public class TestTenantProvider implements TenantProvider, ITenantEventHandler<T
}
@Override
public TenantApplicationType getTenantApplicationType(String s) {
return tenants.stream()
.filter(t -> t.getTenantId().equals(s))
.findFirst()
.map(TenantResponse::getApplicationType)
.orElse(TenantApplicationType.RedactManager);
}
@Override
public void handle(TenantCreatedEvent event) {
tenants.add(TenantResponse.builder().tenantId(event.getTenantId()).build());
tenants.add(TenantResponse.builder()
.tenantId(event.getTenantId())
.build());
}