cuttiesark
05/24/2017, 1:45 PM/**
* API tests for User service
*/
class UserApiTests : RestAssuredSupport {
val config = systemProperties() overriding
EnvironmentVariables() overriding
ConfigurationProperties.fromResource("office.properties")
Can I just have a command line argument for the properties file, or is there a smarter way?amitshekhar
05/24/2017, 1:54 PMnawar
05/24/2017, 5:15 PMobject
, something like this:
object RemoteService (val context: Context) {
init {
// use the `context` here
}
}
voddan
05/24/2017, 5:31 PMarnis71
05/24/2017, 7:13 PMarnis71
05/24/2017, 7:14 PMdiesieben07
05/24/2017, 7:20 PMlist.takeWhile { it > 3 }
diesieben07
05/24/2017, 7:20 PMarnis71
05/24/2017, 7:20 PMarnis71
05/24/2017, 7:24 PMkevinmost
05/24/2017, 7:27 PMlist.find { it == 3 }
?kevinmost
05/24/2017, 7:28 PMfind
and firstOrNull
are identical. first
is also similar but will throw if nothing is found matching the lambdaarnis71
05/24/2017, 8:11 PMarmaxis
05/25/2017, 1:18 AMobject Geometry
, to internal object
, or define as companion class? So many ways to choose from 🙂
public class Geometry {
private Geometry() {}
public static boolean segmentsIntersect(long start1, long end1, long start2, long end2) {
return end1 > start2 && end2 > start1;
}
public static boolean pointWithinSegment(long point, long boundStart, long boundEnd) {
return boundStart <= point && point < boundEnd;
}
}
redrield
05/25/2017, 1:21 AMredrield
05/25/2017, 1:21 AMarmaxis
05/25/2017, 1:22 AMboolean result = Geometry.INSTANCE.segmentsIntersect(....)
redrield
05/25/2017, 1:22 AMredrield
05/25/2017, 1:23 AMinit { }
blocks)armaxis
05/25/2017, 1:26 AMxiphirx
05/25/2017, 5:14 AM@JvmStatic
to have Geometry.segmentsIntersect(...)
cuttiesark
05/25/2017, 10:41 AMorangy
bod
05/25/2017, 2:10 PMdata class Foo(val id: Long)
and I want to have an annotation of id
bod
05/25/2017, 2:11 PMdata class Foo(@Bar val id: Long)
the annotation goes on the constructor parameter, but not the fieldbod
05/25/2017, 2:11 PMdiesieben07
05/25/2017, 2:15 PMbod
05/25/2017, 2:20 PMlupajz
05/25/2017, 3:41 PMdiesieben07
05/25/2017, 3:42 PM