Annotations Flashcards

1
Q

This annotation marks a method as a test method.

A

@Test:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Used to indicate that a method should be run once before all the tests in the class.

A

@BeforeAll

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Used to indicate that a method should be run before each test in the class.

A

@BeforeEach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Used to indicate that a method should be run once after all the tests in the class.

A

@AfterAll:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Used to indicate that a method should be run after each test in the class.

A

@AfterEach:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

checks that the expected value is equal to the actual value.

A

assertEquals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

checks that the given condition is true.

A

assertTrue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

checks that the given condition is false.

A

assertFalse

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

checks that the given object is null.

A

assertNull

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

checks that the given executable (a lambda or method reference) throws an exception of the specified type.

A

assertThrows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

checks that the given object is not null.

A

assertNotNul

How well did you know this?
1
Not at all
2
3
4
5
Perfectly