Skip to content
Snippets Groups Projects
Select Git revision
  • f892b9eae80f7d5d5b3ddda9bfa55057bd92bc59
  • main default protected
  • OZG-7967-rename-admin
  • OZG-8271-fix-date-bug
  • OZG-7985-Statistik-Datenfreigabe
  • OZG-7970-AlfaCodeFlow
  • OZG-7856_schadcode_scanner
  • OZG-8305-Create-webpack-sbom
  • tooltip-improvements
  • ods-remove-class-inputs
  • release-info
  • release-administration
  • release
  • OZG-7714-UpgradeKeycloakDependencyTo25
  • OZG-8086-Admin-Datenanfrage-erstellen
  • OZG-8086-Datenanfrage-Umbenennung
  • mongodb-7-0-16-e2e
  • OZG-6220-Bescheid-speichern-ohne-Postfach
  • OZG-7922-KeycloakOperatorExceptions
  • OZG-8142-poc-cards
  • OZG-8086-E2E
  • 1.11.0-info
  • 1.11.0-administration
  • 2.26.0-alfa
  • 1.10.0-info
  • 1.10.0-administration
  • 2.25.0-alfa
  • 1.9.0-info
  • 1.9.0-administration
  • 2.24.0-alfa
  • 1.8.0-info
  • 1.8.0-administration
  • 2.23.0-alfa
  • 1.7.0-info
  • 1.7.0-administration
  • 2.22.0-alfa
  • 1.6.0-info
  • 1.6.0-administration
  • 2.21.0-alfa
  • 1.5.0-info
  • 1.5.0-administration
41 results

settings-resource.service.ts

Blame
  • XtaClientITCase.java 1.92 KiB
    package de.ozgcloud.xta.client;
    
    import static org.assertj.core.api.Assertions.*;
    
    import java.io.File;
    import java.io.IOException;
    import java.util.List;
    
    import org.junit.jupiter.api.BeforeEach;
    import org.junit.jupiter.api.DisplayName;
    import org.junit.jupiter.api.Nested;
    import org.junit.jupiter.api.Test;
    
    import com.google.common.io.Files;
    
    import de.ozgcloud.xta.client.config.XtaClientConfig;
    import lombok.SneakyThrows;
    
    class XtaClientITCase {
    
    	private XtaClient client;
    
    	private static final String CLIENT_IDENTIFIER = "afmsh:010600000000_Online-Dienste";
    
    	private static final String BASE_URL = "https://li33-0005.dp.dsecurecloud.de/MB_XTA-WS/XTA210";
    
    	private static final XtaClientFactory clientFactory;
    
    	private static final XtaClientConfig CONFIG;
    
    	static {
    		var clientCertKeyStore = XtaClientConfig.KeyStore.builder()
    				.content(readBytesFromFile("/path/to/KOP_SH_KIEL_DEV.p12"))
    				.type("PKCS12")
    				.password("***".toCharArray())
    				.build();
    		CONFIG = XtaClientConfig.builder()
    				.clientIdentifiers(List.of(CLIENT_IDENTIFIER))
    				.managementServiceUrl(BASE_URL + "managementPort.svc")
    				.sendServiceUrl(BASE_URL + "sendPort.svc")
    				.msgBoxServiceUrl(BASE_URL + "msgBoxPort.svc")
    				.clientCertKeystore(clientCertKeyStore)
    				.logSoapRequests(true)
    				.logSoapResponses(true)
    				.build();
    		clientFactory = XtaClientFactory.from(CONFIG);
    	}
    
    	@BeforeEach
    	@SneakyThrows
    	void mock() {
    		client = clientFactory.create();
    	}
    
    	@DisplayName("get status list")
    	@Nested
    	class TestGetStatusList {
    
    		@DisplayName("should return with no pending messages")
    		@Test
    		@SneakyThrows
    		void shouldReturnWithNoPendingMessages() {
    			var result = client.getMessagesMetadata(CLIENT_IDENTIFIER);
    
    			assertThat(result.pendingMessageCount()).isZero();
    		}
    	}
    
    	private static byte[] readBytesFromFile(String path) {
    		try {
    			return Files.toByteArray(new File(path));
    		} catch (IOException e) {
    			throw new RuntimeException(e);
    		}
    	}
    }