Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.7.14
d389b41fac321833b103ba17f86fcb3e209f5596

# Scala Steward: Reformat with scalafmt 3.9.5
94def2c6d78085fa01a3d79fe3f499e60fcc0915
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version="3.7.17"
version="3.9.5"

project.git = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,10 @@ class JacksonHelpersTest extends AnyFreeSpec with Matchers {
intercept[NoSuchElementException](discriminatorExpression("3424.3123", "number", Some("foobaz")).value)
}

"random types" in {
"random types" in
intercept[NoSuchElementException](discriminatorExpression("asdsd", "foobaz").value)
}

"non-matching string types" in {
"non-matching string types" in
intercept[NoSuchElementException](discriminatorExpression("asdasd", "integer", Some("int32")).value)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers

class JacksonBuilderParamTest extends AnyFreeSpec with Matchers {
"POJO builders should not accept nulls for required params" in {
"POJO builders should not accept nulls for required params" in
assertThrows[NullPointerException] {
new Pet.Builder(null: String)
.build()
}
}

"POJO builders should accept nulls for the value variant for optional params" in {
val pet = new Pet.Builder("fluffy")
Expand All @@ -20,11 +19,10 @@ class JacksonBuilderParamTest extends AnyFreeSpec with Matchers {
pet.getCategory shouldBe Optional.empty
}

"POJO builders should not accept nulls for the Optional<> variant for optional params" in {
"POJO builders should not accept nulls for the Optional<> variant for optional params" in
assertThrows[NullPointerException] {
new Pet.Builder("fluffy")
.withCategory(null: Optional[Category])
.build()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import polymorphismNested.client.dropwizard.definitions.{ A, B, C, TestResponse

class JacksonNestedTest extends AnyFreeSpec with Matchers {
"Jackson nested schemas" - {
"Should have the nested objects in the right place" in {
"Should have the nested objects in the right place" in
new TestResponse.Builder()
.withEnum1(A.Enum1.B)
.withEnum2(B.Enum2.D)
.withObj(new C.Obj.Builder().withValue("foo").build())
.build()
}

"Should have nested classes as public static members" in {
classOf[C.Obj].getModifiers & Modifier.PUBLIC mustBe Modifier.PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers

class JacksonBuilderParamTest extends AnyFreeSpec with Matchers {
"POJO builders should not accept nulls for required params" in {
"POJO builders should not accept nulls for required params" in
assertThrows[NullPointerException] {
new Pet.Builder(null: String)
.build()
}
}

"POJO builders should accept nulls for the value variant for optional params" in {
val pet = new Pet.Builder("fluffy")
Expand All @@ -20,11 +19,10 @@ class JacksonBuilderParamTest extends AnyFreeSpec with Matchers {
pet.getCategory shouldBe VavrOption.none
}

"POJO builders should not accept nulls for the Optional<> variant for optional params" in {
"POJO builders should not accept nulls for the Optional<> variant for optional params" in
assertThrows[NullPointerException] {
new Pet.Builder("fluffy")
.withCategory(null: VavrOption[Category])
.build()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import polymorphismNested.client.dropwizardVavr.definitions.{ A, B, C, TestRespo

class JacksonNestedTest extends AnyFreeSpec with Matchers {
"Jackson nested schemas" - {
"Should have the nested objects in the right place" in {
"Should have the nested objects in the right place" in
new TestResponse.Builder()
.withEnum1(A.Enum1.B)
.withEnum2(B.Enum2.D)
.withObj(new C.Obj.Builder().withValue("foo").build())
.build()
}

"Should have nested classes as public static members" in {
classOf[C.Obj].getModifiers & Modifier.PUBLIC mustBe Modifier.PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ class BaselineSpecs extends AnyFreeSpec with Matchers with BeforeAndAfterAll wit
assertTrue(content.contains("mouse"))
}

"required param missing" in {
"required param missing" in
mvc
.perform(
get("/v2/pet/findByStatus")
.accept(MediaType.APPLICATION_JSON)
)
.andExpect(status.is4xxClientError())
}

"query params (list)" in {
val entityBody = new util.ArrayList[Pet]()
Expand Down
10 changes: 5 additions & 5 deletions modules/scala-akka-http/src/test/scala/core/issues/Issue43.scala
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner {
val (
ProtocolDefinitions(
ClassDefinition(namePersianCat, tpePersianCat, fullTypePersioanCat, clsPersianCat, staticDefnsPersianCat, persianCatParents)
:: ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents)
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil,
:: ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents)
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil,
_,
_,
_,
Expand Down Expand Up @@ -466,8 +466,8 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner {
val (
ProtocolDefinitions(
ClassDefinition(nameDog, tpeDog, fullTypeDog, clsDog, staticDefnsDog, dogParents)
:: ClassDefinition(namePersianCat, tpePersianCat, fullTypePersianCat, clsPersianCat, staticDefnsPersianCat, persianCatParents)
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil,
:: ClassDefinition(namePersianCat, tpePersianCat, fullTypePersianCat, clsPersianCat, staticDefnsPersianCat, persianCatParents)
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameCat, tpeCat, fullTypeCat, trtCat, staticDefnsCat) :: Nil,
_,
_,
_,
Expand Down Expand Up @@ -566,7 +566,7 @@ class Issue43 extends AnyFunSpec with Matchers with SwaggerSpecRunner {
val (
ProtocolDefinitions(
ClassDefinition(nameCat, tpeCat, fullTypeCat, clsCat, staticDefnsCat, catParents)
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameMammal, tpeMammal, fullTypeMammal, trtMammal, staticDefnsMammal) :: Nil,
:: ADT(namePet, tpePet, fullTypePet, trtPet, staticDefnsPet) :: ADT(nameMammal, tpeMammal, fullTypeMammal, trtMammal, staticDefnsMammal) :: Nil,
_,
_,
_,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ class JacksonHelpersTest extends AnyFreeSpec with Matchers {
intercept[NoSuchElementException](discriminatorExpression("3424.3123", "number", Some("foobaz")).value)
}

"random types" in {
"random types" in
intercept[NoSuchElementException](discriminatorExpression("asdsd", "foobaz").value)
}

"non-matching string types" in {
"non-matching string types" in
intercept[NoSuchElementException](discriminatorExpression("asdasd", "integer", Some("int32")).value)
}
}
}