Should tests perform a single assertion, or are multiple related assertions acceptable

Assume a client is making a request to an API endpoint that returns a JSON response where the structure and data change depending on whether the request was successful or not. Possible responses may look as follows:

Scenario with a success response

{   "status": XXX,   "data": [{     ...   }] } 

Scenario with a failure response

{   "status": XXX,   "errors": [{     ...   }] } 

Example of test scenarios for the above would be:

  • Assert the expected status code
  • Assert the expected JSON structure
  • Assert the expected JSON data

When performing tests where you have more than one assertion you can perform, is it recommended to provide a single test for each assertion, or group the assertions into a single test?

Retrofit response retornando null com codigo 406 Not Acceptable

Fala pessoal, to usando Retrofit2 com Kotlin e estou tentando realizar uma requisição POST onde será retornado um Json.

A requisição é feita e a parte do servidor funciona (cadastra o usuario), porem quando vou tratar o response, ele sempre retorna null (com código 406 Not Acceptable)

Requisição feita no Postman: Requisição feita no Postman RetrofitConfig.kt

class RetrofitConfig(baseUrl: String) { private val gson = GsonBuilder().create() private val httpClient = OkHttpClient.Builder() private val retrofitBuilder = Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(GsonConverterFactory.create(gson)) private var retrofit = retrofitBuilder.build()  fun loginService(): LoginService {     return createService(LoginService::class.java) }  fun registerService(): RegisterService {     return createService(RegisterService::class.java) }  fun <S> createService(serviceClass: Class<S>): S {     retrofitBuilder.client(httpClient.build())     retrofit = retrofitBuilder.build()     return retrofit.create(serviceClass) } 

RegisterService.kt

interface RegisterService {     @POST("registrar/")     fun registrar(@Body usuario: Usuario): Call<AuthResponse> } 

Realizando a Requisição

val call = RetrofitConfig(baseUrl).registerService().registrar(usuario)      call.enqueue(object : Callback<AuthResponse> {         override fun onFailure(call: Call<AuthResponse>?, t: Throwable?) {             Toast.makeText(this@AuthFragmentRouterActivity, "Sem conexão com a internet.", Toast.LENGTH_LONG).show()         }         override fun onResponse(call: Call<AuthResponse>?, response: Response<AuthResponse>?) {             val body = response?.body()             Log.d("Quiz", "Response: $  {response?.code()}")             if (response?.isSuccessful == true) {                 if (body!!.sucesso) {                     val it = Intent(this@AuthFragmentRouterActivity, QuizFragmentRouterActivity::class.java)                     it.putExtra("usuario", Gson().toJson(usuario))                     startActivity(it)                     finish()                 } else Toast.makeText(this@AuthFragmentRouterActivity, body.mensagem, Toast.LENGTH_LONG).show()             } else Toast.makeText(this@AuthFragmentRouterActivity, "Ocorreu um erro.", Toast.LENGTH_LONG).show()         }     }) 

South Korean tourist visa – is funds parking acceptable in my situation?

I’m travelling to South Korea soon with my Korean girlfriend. We both live in a Southeast Asian country of which I am a citizen. I used to lived in Europe till a few months back so I have a bank account there which holds most of my savings. For proving that I have enough funds for the trip, I need to submit a bank statement with transactions from the last 6 months. The problem is that it is impossible for me to get those bank statements stamped by the bank since I’m here.

I also have a bank account in my home country but it barely has had any money since the past 6 months. My girlfriend recently transferred $ 2000 into that account so that I could submit a proper stamped statement from this account as well.

Now I understand that these type of last minute deposits are referred to as ‘funds parking’ and are generally discouraged. But in my situation, since I’m also submitting an unstamped statement from my European bank, will it okay? Is it too suspicious that my gf who is also travelling with me transferred so much money into my account just before my visa appointment?

Acceptable to use synchronous call to another microservice for time-sensitve state change?

Say there are two microservices (example is simplified)

PickupRequestService: lists pick-up requests of passengers

DriverService: drivers use to accept pickup requests

On a completely decoupled communication method (via message queues), DriverService would make an async call to accept a pick-up request e.g., PickupRequestService->accept(pickupId). This looks fine however, for a few seconds, this will cause other drivers to see pick-up requests that are already taken.

You could probably eventually send a compensating failed message for those hopeful drivers that accepted a taken pick-up request e.g., “your request to accept the passenger has been rejected…” but that won’t be a good UX.

My question is, for scenarios similar to this, where a state changing operation is time sensitive, is it okay to make synchronous inter-microservice REST calls? E.g., DriverService synchronously calls PickupRequestService->accept(pickupId) so that the state change is instantaneous and no other driver sees old pick-up requests anymore.

Is it acceptable to load crucial parts of website from a third-party content management system (CMS)?

Is it acceptable to load the main title and other essential content of a website from a third-party CMS?

In this way, non-developers can manage the content. However, if there is an outage, the website will be down as well and will have no control over the problem.

Is it worth the effort to have fallback data in case the third-party service is down?

CMS should be pretty reliable, so should I just assume the CMS will be available? It’s a standard commercial website.

I have recovered my credit card PAN (6 chars masked) and expiration date on a merchant site, acceptable or not?

I have a credit card saved in X merchant. I only see the last 4 digits in the UI.

I have launched a 3D secure payment transaction by using my saved card. Then I have noticed that even in the failed transactions browser posts back my stored credit card information (PAN’s 6 chars masked + expiry date) to the X merchant’s website.

IMHO this is a security risk. I would not do this as a developer. But what about PCI DSS? Is this complies with PCI DSS?

The first six and last four digits are the maximum number of digits that may be displayed.

Reference

It looks like PCI DSS allows displaying PAN like this. But I could not find any information about masking expiry date. That’s the point I have no answers.

enter image description here

Is a pteranodon acceptable as a beast companion for a beast master?

I’ve just started to play dnd with a few of my friends and we’re unsure if a beast master having a pteranodon as their beast companion would be unbalanced.

I’m playing as a flying character (an Aarakocra) and think it wouldnt be a good idea to have a landbound beast companion (like a panther) as this might not synergise well. So instead, I looked further into flying charachters and found out about pteranodons and I think it would work very well. Their abilities dont seem particularly overpowered however I’m not even fully sure of the benefits of having a medium sized beast. I’d really like the advice of an experienced player as I really need advice my friends are unable to give me.

Would a hard to learn UI be acceptable?

Most often I see software aiming for easy to use. This usually does not mean easy to use, but easy to learn.

For example, vim is really easy to use, but extremely hard to learn. Most webpages are easy to learn but hard to use (delay in response time, multiple mouse clicks, etc.).

Many programs (like MS Word) tries to be easy to use with and easy to learn UI that they combine with shortcuts. This works rather well, but it’s still aimed towards easy to learn as a primary objective.

For professional users that works heavily with a program I would think that easy to use should be more important than easy to learn. However I sense that it’s not always the case.

So my question is, is it okay to produce easy to use UI rather than easy to learn UI for a professional audience?

32 premium one word .xyz domain for sale. Bulk or Single order acceptable

goodmovie.xyz
annoy.xyz
albeit.xyz
awhile.xyz
beaten.xyz
begun.xyz
coward.xyz
crosse.xyz
yorker.xyz
theres.xyz
thence.xyz
theirs.xyz
taught.xyz
repeal.xyz
manure.xyz
larvae.xyz
evenly.xyz
wreak.xyz
waved.xyz
threw.xyz
swung.xyz
quits.xyz
posed.xyz
pesky.xyz
paved.xyz
lumpy.xyz
jumpy.xyz
flown.xyz
flung.xyz
glued.xyz
nursingjobs.xyz
aides.xyz

Happy Bidding!