Skip to content
Snippets Groups Projects
Select Git revision
  • f9cc382b020e842e021a9a7a9e3286c6b85ef5b1
  • main default protected
  • release
  • master-interface-proto4
  • ozg-5634-ozgcloud-ingress
  • OZG-3322_connect_to_mongodb_over_tls
  • 2.19.0
  • 2.18.0
  • 2.17.0
  • 2.16.0
  • 2.15.0
  • 2.14.0
  • 2.13.0
  • 2.12.0
  • 2.11.0
  • 2.10.1
  • 2.10.0
  • 2.9.0
  • 2.8.0
  • 2.7.1
  • 2.7.0
  • 2.6.0
  • 2.5.1
  • 2.5.0
  • 2.4.0
  • 2.3.0
26 results

UserService.java

Blame
  • MongoConfigServerTest.java 1.16 KiB
    package de.ozgcloud.admin.environment;
    
    import static org.junit.jupiter.api.Assertions.*;
    
    import org.junit.jupiter.api.Test;
    import org.springframework.boot.test.context.SpringBootTest;
    import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
    import org.springframework.boot.test.web.client.TestRestTemplate;
    import org.springframework.boot.test.web.server.LocalServerPort;
    import org.springframework.cloud.config.environment.Environment;
    import org.springframework.http.HttpStatus;
    import org.springframework.http.ResponseEntity;
    
    import de.ozgcloud.admin.AdministrationApplication;
    
    @SpringBootTest(classes = AdministrationApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT)
    class MongoConfigServerTest {
    	private final String APPNAME = "testapp";
    	private final String PROFILE = "testprofile";
    	private final String LABEL = "testlabel";
    	@LocalServerPort
    	private int port;
    
    	@Test
    	void shouldHaveHttpEndpoint() {
    		ResponseEntity<Environment> response = new TestRestTemplate().getForEntity("http://localhost:"
    				+ port + "/" + APPNAME + "/" + PROFILE + "/" + LABEL, Environment.class);
    		assertEquals(HttpStatus.OK, response.getStatusCode());
    	}
    }