mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-11-04 12:28:25 +00:00 
			
		
		
		
	pleasure the linter
This commit is contained in:
		
							parent
							
								
									270e127940
								
							
						
					
					
						commit
						dac7bcc0e7
					
				@ -48,8 +48,8 @@ internal class StatusRequester {
 | 
				
			|||||||
    fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String {
 | 
					    fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String {
 | 
				
			||||||
        if (!redirectedLocation.startsWith("/"))
 | 
					        if (!redirectedLocation.startsWith("/"))
 | 
				
			||||||
            return redirectedLocation
 | 
					            return redirectedLocation
 | 
				
			||||||
        val oldLocation = URL(oldLocation)
 | 
					        val oldLocationURL = URL(oldLocation)
 | 
				
			||||||
        return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString()
 | 
					        return URL(oldLocationURL.protocol, oldLocationURL.host, oldLocationURL.port, redirectedLocation).toString()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private fun getGetMethod(url: String): GetMethod {
 | 
					    private fun getGetMethod(url: String): GetMethod {
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ class StatusRequestorTest {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    fun `update location with an absolute path`() {
 | 
					    fun `update location with an absolute path`() {
 | 
				
			||||||
        val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN/subdir")
 | 
					        val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH")
 | 
				
			||||||
        assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation)
 | 
					        assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -46,9 +46,7 @@ class StatusRequestorTest {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Test
 | 
					    @Test
 | 
				
			||||||
    fun `update location with a relative path`() {
 | 
					    fun `update location with a relative path`() {
 | 
				
			||||||
        val newLocation = requestor.updateLocationWithRedirectPath(
 | 
					        val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH)
 | 
				
			||||||
            TEST_DOMAIN, SUB_PATH
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
        assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation)
 | 
					        assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user