Skip to content

Commit

Permalink
Changes after review.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-cebo committed Oct 28, 2024
1 parent 86b7d09 commit 8e18f31
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 66 deletions.
52 changes: 12 additions & 40 deletions pubnub-kotlin/pubnub-kotlin-impl/config/ktlint/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<baseline version="1.0">
<file name="src/integrationTest/kotlin/com/pubnub/api/integration/PublishIntegrationTests.kt">
<error line="11" column="1" source="standard:no-unused-imports" />
<error line="16" column="1" source="standard:no-unused-imports" />
</file>
<file name="src/main/kotlin/com/pubnub/internal/endpoints/FetchMessagesEndpoint.kt">
<error line="47" column="1" source="standard:no-consecutive-blank-lines" />
<error line="155" column="11" source="standard:keyword-spacing" />
<error line="155" column="37" source="standard:curly-spacing" />
</file>
<file name="src/main/kotlin/com/pubnub/internal/endpoints/pubsub/PublishEndpoint.kt">
<error line="91" column="21" source="standard:no-multi-spaces" />
</file>
<file name="src/main/kotlin/com/pubnub/internal/managers/BasePathManager.kt">
<error line="15" column="17" source="standard:property-naming" />
<error line="21" column="17" source="standard:property-naming" />
Expand Down Expand Up @@ -70,22 +77,12 @@
<error line="112" column="9" source="standard:function-naming" />
<error line="181" column="9" source="standard:function-naming" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/history/state/HistoryState.kt">
<error line="1" column="1" source="standard:final-newline" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/history/step/WhenSteps.kt">
<error line="1" column="1" source="standard:final-newline" />
<error line="13" column="1" source="standard:no-empty-first-line-in-class-body" />
<error line="15" column="9" source="standard:function-naming" />
<error line="28" column="105" source="standard:comment-spacing" />
<error line="29" column="9" source="standard:function-naming" />
<error line="43" column="9" source="standard:function-naming" />
<error line="43" column="71" source="standard:curly-spacing" />
<error line="43" column="71" source="standard:function-start-of-body-spacing" />
<error line="49" column="1" source="standard:no-consecutive-blank-lines" />
<error line="51" column="9" source="standard:function-naming" />
<error line="68" column="9" source="standard:function-naming" />
<error line="80" column="1" source="standard:no-blank-line-before-rbrace" />
<error line="14" column="9" source="standard:function-naming" />
<error line="28" column="9" source="standard:function-naming" />
<error line="42" column="9" source="standard:function-naming" />
<error line="49" column="9" source="standard:function-naming" />
<error line="66" column="9" source="standard:function-naming" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/member/step/GivenSteps.kt">
<error line="11" column="9" source="standard:function-naming" />
Expand Down Expand Up @@ -134,29 +131,10 @@
<error line="131" column="9" source="standard:function-naming" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/publish/WhenSteps.kt">
<error line="1" column="1" source="standard:final-newline" />
<error line="9" column="9" source="standard:function-naming" />
<error line="9" column="78" source="standard:curly-spacing" />
<error line="9" column="78" source="standard:function-start-of-body-spacing" />
<error line="10" column="1" source="standard:indent" />
<error line="11" column="1" source="standard:indent" />
<error line="12" column="1" source="standard:indent" />
<error line="13" column="1" source="standard:indent" />
<error line="14" column="1" source="standard:indent" />
<error line="15" column="1" source="standard:indent" />
<error line="16" column="1" source="standard:indent" />
<error line="17" column="1" source="standard:indent" />
<error line="18" column="1" source="standard:indent" />
<error line="18" column="37" source="standard:curly-spacing" />
<error line="19" column="1" source="standard:indent" />
<error line="20" column="1" source="standard:indent" />
<error line="21" column="1" source="standard:indent" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/signal/WhenSteps.kt">
<error line="1" column="1" source="standard:final-newline" />
<error line="9" column="9" source="standard:function-naming" />
<error line="16" column="1" source="standard:indent" />
<error line="17" column="1" source="standard:indent" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/step/ErrorMessageAndDetailsStep.kt">
<error line="10" column="9" source="standard:function-naming" />
Expand All @@ -169,12 +147,6 @@
<error line="47" column="9" source="standard:function-naming" />
<error line="52" column="9" source="standard:function-naming" />
<error line="63" column="9" source="standard:function-naming" />
<error line="63" column="47" source="standard:curly-spacing" />
<error line="63" column="47" source="standard:function-start-of-body-spacing" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/step/ThenSteps.kt">
<error line="23" column="38" source="standard:curly-spacing" />
<error line="23" column="38" source="standard:function-start-of-body-spacing" />
</file>
<file name="src/test/kotlin/com/pubnub/contract/uuidmetadata/step/GivenSteps.kt">
<error line="15" column="9" source="standard:function-naming" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import com.pubnub.api.models.consumer.history.PNFetchMessagesResult

class HistoryState {
var messages: PNFetchMessagesResult? = null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.contains

class WhenSteps(private val world: World, private val historyState: HistoryState) {

@When("I fetch message history for {string} channel")
fun i_fetch_message_history_for_channel(channelName: String) {
try {
Expand All @@ -25,7 +24,7 @@ class WhenSteps(private val world: World, private val historyState: HistoryState
}
}

@When("I fetch message history with include_custom_message_type set to false for {string} channel") //todo fix it
@When("I fetch message history with include_custom_message_type set to false for {string} channel") // todo fix it
fun i_fetch_message_history_with_includeCustomMessageType_set_to_false_for_channel(channelName: String) {
try {
historyState.messages = world.pubnub.fetchMessages(
Expand All @@ -40,13 +39,12 @@ class WhenSteps(private val world: World, private val historyState: HistoryState
}

@Then("history response contains messages without customMessageType")
fun history_response_contains_messages_without_customMessageType(){
fun history_response_contains_messages_without_customMessageType() {
val customMessageTypesInResponse: List<String?> =
historyState.messages!!.channels.values.flatMap { message -> message.map { it.customMessageType } }
println()
}


@Then("history response contains messages with {string} and {string} message types")
fun history_response_contains_messages_with_message_type(
messageTypeOfFirstMessage: String,
Expand Down Expand Up @@ -77,5 +75,4 @@ class WhenSteps(private val world: World, private val historyState: HistoryState
contains(customMessageTypeOfFirstMessage, customMessageTypeOfSecondMessage),
)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import io.cucumber.java.en.When

class WhenSteps(private val world: World) {
@When("I publish message with {string} customMessageType")
fun i_publish_message_with_custom_message_type(customMessageType: String){
try {
world.pubnub.publish(
channel = "whatever",
message = "whatever",
customMessageType = customMessageType
).sync().let {
world.responseStatus = 200
}
} catch (ex: PubNubException){
world.responseStatus = ex.statusCode
world.pnException = ex
}
fun i_publish_message_with_custom_message_type(customMessageType: String) {
try {
world.pubnub.publish(
channel = "whatever",
message = "whatever",
customMessageType = customMessageType
).sync().let {
world.responseStatus = 200
}
} catch (ex: PubNubException) {
world.responseStatus = ex.statusCode
world.pnException = ex
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class WhenSteps(private val world: World) {
message = "whatever",
customMessageType = customMessageType
).sync().let {
world.responseStatus = 200
}
world.responseStatus = 200
}
} catch (ex: PubNubException) {
world.responseStatus = ex.statusCode
world.pnException = ex
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class KeysetStep(private val world: World) {
}

@Given("the demo keyset with enabled storage")
fun the_demo_keyset_with_enabled_storage(){
fun the_demo_keyset_with_enabled_storage() {
the_demo_keyset()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ThenSteps(private val world: World) {
}

@Then("I receive an error response")
fun i_receive_an_error_response(){
fun i_receive_an_error_response() {
an_error_is_returned()
}

Expand Down

0 comments on commit 8e18f31

Please sign in to comment.