Skip to content

Commit

Permalink
Disable tests with the @disabled annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdegraaf1234 committed Jun 10, 2024
1 parent 1653bb3 commit fe30b7f
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 169 deletions.
Original file line number Diff line number Diff line change
@@ -1,83 +1,85 @@
// /*
// * Copyright 2017 The Hyve and King's College London
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
// package org.radarbase.producer.schema
//
// import io.ktor.client.*
// import io.ktor.client.engine.cio.*
// import io.ktor.client.plugins.auth.*
// import io.ktor.client.plugins.auth.providers.*
// import io.ktor.client.request.*
// import io.ktor.client.statement.*
// import io.ktor.http.*
// import kotlinx.coroutines.runBlocking
// import org.apache.avro.Schema
// import org.junit.Ignore
// import org.junit.jupiter.api.AfterEach
// import org.junit.jupiter.api.BeforeEach
// import org.junit.jupiter.api.Test
// import org.radarbase.producer.io.timeout
// import java.io.IOException
// import kotlin.time.Duration.Companion.seconds
//
// class SchemaRestClientIntegrationTest {
// private lateinit var retriever: SchemaRestClient
//
// // This testclass requires a functioning confluent cloud provider, therefore all tests here are ignored
//
// @BeforeEach
// fun setUp() {
// val apiSecret = "exampleSecret"
// val apiKey = "exampleKey"
// retriever = SchemaRestClient(
// httpClient = HttpClient {
// timeout(30.seconds)
// install(Auth) {
// basic {
// sendWithoutRequest { true }
// credentials {
// BasicAuthCredentials(username = apiKey, password = apiSecret)
// }
// }
// }
// },
// baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud",
// )
// }
//
// @AfterEach
// @Throws(IOException::class)
// fun tearDown() {
// }
//
// @Test
// fun testSchemaGet() = runBlocking {
// val actualSchemaMetadata = retriever.schemaGet("/schemas/ids/100042")
// println(actualSchemaMetadata)
// }
//
// @Test
// fun testSchemaPost() = runBlocking {
// val postResult = retriever.schemaPost("subjects/d90c8b88-5793-438a-b27d-6c87580cc3d9", Schema.create(Schema.Type.STRING))
//
// println(postResult)
// }
//
// @Test
// fun testRetrieveSchemaById() = runBlocking {
// val res = retriever.retrieveSchemaById(100086)
// println(res)
// }
// }
/*
* Copyright 2017 The Hyve and King's College London
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.radarbase.producer.schema

import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.plugins.auth.*
import io.ktor.client.plugins.auth.providers.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import kotlinx.coroutines.runBlocking
import org.apache.avro.Schema
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.radarbase.producer.io.timeout
import java.io.IOException
import kotlin.time.Duration.Companion.seconds

class SchemaRestClientIntegrationTest {
private lateinit var retriever: SchemaRestClient

// This testclass requires a functioning confluent cloud provider, therefore all tests here are ignored

@BeforeEach
fun setUp() {
val apiSecret = "exampleSecret"
val apiKey = "exampleKey"
retriever = SchemaRestClient(
httpClient = HttpClient {
timeout(30.seconds)
install(Auth) {
basic {
sendWithoutRequest { true }
credentials {
BasicAuthCredentials(username = apiKey, password = apiSecret)
}
}
}
},
baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud",
)
}

@AfterEach
@Throws(IOException::class)
fun tearDown() {
}

@Disabled
@Test
fun testSchemaGet() = runBlocking {
val actualSchemaMetadata = retriever.schemaGet("/schemas/ids/100042")
println(actualSchemaMetadata)
}

@Disabled
@Test
fun testSchemaPost() = runBlocking {
val postResult = retriever.schemaPost("subjects/d90c8b88-5793-438a-b27d-6c87580cc3d9", Schema.create(Schema.Type.STRING))
println(postResult)
}

@Disabled
@Test
fun testRetrieveSchemaById() = runBlocking {
val res = retriever.retrieveSchemaById(100086)
println(res)
}
}
Original file line number Diff line number Diff line change
@@ -1,86 +1,88 @@
// /*
// * Copyright 2017 The Hyve and King's College London
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
// package org.radarbase.producer.schema
//
// import io.ktor.client.*
// import io.ktor.client.engine.cio.*
// import io.ktor.client.plugins.auth.*
// import io.ktor.client.plugins.auth.providers.*
// import io.ktor.client.request.*
// import io.ktor.client.statement.*
// import io.ktor.http.*
// import kotlinx.coroutines.runBlocking
// import org.junit.Ignore
// import org.junit.jupiter.api.AfterEach
// import org.junit.jupiter.api.BeforeEach
// import org.junit.jupiter.api.Test
// import org.radarbase.producer.io.timeout
// import java.io.IOException
// import kotlin.time.Duration.Companion.seconds
//
// class SchemaRetrieverIntegrationTest {
// private lateinit var retriever: SchemaRetriever
//
// // This testclass requires a functioning confluent cloud provider, therefore all tests here are ignored
//
// @BeforeEach
// fun setUp() {
// val apiSecret = "exampleSecret"
// val apiKey = "exampleKey"
// retriever = SchemaRetriever.schemaRetriever(baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud") {
// httpClient = HttpClient(CIO) {
// timeout(30.seconds)
// install(Auth) {
// basic {
// sendWithoutRequest { true }
// credentials {
// BasicAuthCredentials(username = apiKey, password = apiSecret)
// }
// }
// }
// }
// }
//
// val restClient = SchemaRestClient(
// httpClient = HttpClient {
// timeout(30.seconds)
// install(Auth) {
// basic {
// sendWithoutRequest { true }
// credentials {
// BasicAuthCredentials(username = apiKey, password = apiSecret)
// }
// }
// }
// },
// baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud",
// )
// }
//
// @AfterEach
// @Throws(IOException::class)
// fun tearDown() {
// }
//
// @Test
// fun testGetById() = runBlocking {
// val topic = "android_phone_acceleration"
// val id = 100042
// val ofValue = true
// val res = retriever.getById(topic, ofValue, id)
// println(res)
// }
// }
/*
* Copyright 2017 The Hyve and King's College London
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.radarbase.producer.schema

import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.plugins.auth.*
import io.ktor.client.plugins.auth.providers.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import kotlinx.coroutines.runBlocking
import org.junit.Ignore
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.radarbase.producer.io.timeout
import java.io.IOException
import kotlin.time.Duration.Companion.seconds

class SchemaRetrieverIntegrationTest {
private lateinit var retriever: SchemaRetriever

// This testclass requires a functioning confluent cloud provider, therefore all tests here are ignored

@BeforeEach
fun setUp() {
val apiSecret = "exampleSecret"
val apiKey = "exampleKey"
retriever = SchemaRetriever.schemaRetriever(baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud") {
httpClient = HttpClient(CIO) {
timeout(30.seconds)
install(Auth) {
basic {
sendWithoutRequest { true }
credentials {
BasicAuthCredentials(username = apiKey, password = apiSecret)
}
}
}
}
}

val restClient = SchemaRestClient(
httpClient = HttpClient {
timeout(30.seconds)
install(Auth) {
basic {
sendWithoutRequest { true }
credentials {
BasicAuthCredentials(username = apiKey, password = apiSecret)
}
}
}
},
baseUrl = "https://SOME_EXAMPLE.westeurope.azure.confluent.cloud",
)
}

@AfterEach
@Throws(IOException::class)
fun tearDown() {
}

@Disabled
@Test
fun testGetById() = runBlocking {
val topic = "android_phone_acceleration"
val id = 100042
val ofValue = true
val res = retriever.getById(topic, ofValue, id)
println(res)
}
}

0 comments on commit fe30b7f

Please sign in to comment.