RED-10196: Backend adaptions for RM/DM unification

This commit is contained in:
maverickstuder 2024-10-18 12:58:43 +02:00
parent f824ac2876
commit f82670a211

View File

@ -5,6 +5,7 @@ import java.util.List;
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;
@ -26,7 +27,10 @@ public class TestTenantProvider implements TenantProvider {
@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);
}
@ -37,6 +41,17 @@ public class TestTenantProvider implements TenantProvider {
}
@Override
public TenantApplicationType getTenantApplicationType(String s) {
return tenants.stream()
.filter(t -> t.getTenantId().equals(s))
.findFirst()
.map(TenantResponse::getApplicationType)
.orElse(TenantApplicationType.RedactManager);
}
public void addTenant(TenantResponse tenantResponse) {
this.tenants.add(tenantResponse);